-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestSSL.py
53 lines (47 loc) · 1.55 KB
/
testSSL.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
try:
import time
from sys import __stdout__, stdout
from threading import Thread
from subprocess import *
import os
import sys
import subprocess
import threading
import readline
from termcolor import colored
except ImportError:
print("\ncheck for prerequisities ")
def testssl(target):
os.system('clear')
p = './output/ssl_test/'
try:
os.mkdir(p)
except FileExistsError as exc:
print(exc)
# delete previous scan
try:
subprocess.run("rm output/ssl_test/*.txt', shell=True, stdout=PIPE")
except FileNotFoundError:
pass
print(colored("\n--------------------------------------------",
'red', attrs=['bold']))
print(
colored("[+] Starting SSL TEST", 'red', attrs=['bold']))
print(colored("--------------------------------------------",
'red', attrs=['bold']))
print(colored("\n[*]\tRunning SSL TEST scans\n[*]", 'red', attrs=['bold']))
cmd = [
' ~/Tools/testssl.sh/testssl.sh --quiet --color 0 -U ' +
target + ' | tee output/ssl_test/ssltest.txt'
]
try:
proc = subprocess.run(cmd, shell=True, stderr=STDOUT, stdout=PIPE)
if(proc.returncode != 0):
print(colored('Step 1 Failed! Check/Update prerequisitie packages. \nError: ',
'blue', attrs=['bold']) + proc.stderr.rstrip())
return False
else:
print(colored("[x] Executed", 'blue', attrs=['bold']))
return True
except:
return False