def test_stVuln1(self): self.val=beast.funbest('yandex.ru') self.assertEqual(self.val, status.Status.stVuln)
def test_stOk2(self): self.val=beast.funbest('ruranobe.ru') self.assertEqual(self.val, status.Status.stOk)
def test_stVuln2(self): self.val=beast.funbest('google.ru') self.assertEqual(self.val, status.Status.stVuln)
def test_stOk1(self): self.val=beast.funbest('github.com') self.assertEqual(self.val, status.Status.stOk)
def chk_main(url, vuln, firstLaunch=True): host = url if firstLaunch==True: #root.destroy() #destroy gui host = url2host(url) #transfrom url to hostaddr print("host: " + host) if checkAccess(host)==False: #checking if site is available print("SSL on this host is not available! Scan has been interrupted!") return if vuln==1: print(">>>Heartbleed has been choosen<<<<") return heartbleed.check(host) elif vuln==2: print(">>>Beast has been choosen<<<") return beast.funbest(host) elif vuln==3: print(">>>Poodle has been choosen<<<") return poodle.poodlefun(host) elif vuln==4: print(">>>>Freak has been choosen<<<<") return freak.check(host) elif vuln==5: print(">>>Logjam has been choosen<<<") return logjam.funlogjam(host) elif vuln==6: print(">>>SSL2 availability has been choosen<<<") return certificat.ssl2av(host) elif vuln==7: print(">>>SSL3 availability has been choosen<<<") return certificat.ssl3av(host) elif vuln==8: print(">>>TLS1.0 availability has been choosen<<<") return certificat.tlsav(host) elif vuln==9: print(">>>TLS1.1 availability has been choosen<<<") return certificat.tls11av(host) elif vuln==10: print(">>>TLS1.2 availability has been choosen<<<") return certificat.tls12av(host) elif vuln==11: print(">>>Certificate info has been choosen<<<") return certificat.cert_info(host) elif vuln==12: print("Cheking site for the whole list of vulnerabilities\n") results = [0] * 6 for i in range(1, 12): results[i-1] = chk_main(host, i, False) print('>>>Result<<<') for i in range(1, 12): result = '' if(results[i-1]==status.Status.stOk): result = 'Not vulnerable' if(results[i-1]==status.Status.stVuln): result = 'Vulnerable' if(results[i-1]==status.Status.stError): result = 'Error' if(results[i-1]==status.Status.stUnknown): result = 'Unknown' if(results[i-1]==None): result = 'Unknown' print(str(i)+'. '+vulnerabilities[i-1]+': '+result)