예제 #1
0
 def test_stVuln1(self):
     self.val=heartbleed.check('fitnessland.spb.ru')
     self.assertEqual(self.val, status.Status.stVuln)
예제 #2
0
 def test_stVuln2(self):
     self.val=heartbleed.check('jquery.page2page.ru')
     self.assertEqual(self.val, status.Status.stVuln)
예제 #3
0
 def test_stOk2(self):
     self.val=heartbleed.check('vk.com')
     self.assertEqual(self.val, status.Status.stOk)
예제 #4
0
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)