-
Notifications
You must be signed in to change notification settings - Fork 5
/
Nessus_SSL_POC_Extractor.py
567 lines (512 loc) · 30.3 KB
/
Nessus_SSL_POC_Extractor.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
#/usr/bin/python
#import count
import os
import csv
# Console colors
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
GR = '\033[37m' # gray
Y = '\033[93m'
BOLD = '\033[1m'
END = '\033[0m'
def banner():
print O+'#############################################################################################'
print '# <<<Nessus Vulnerability Extractor>>> #'
print '# #'
print '# Made by <<RISHABH SHARMA>> #'
print '# Twitter : @blacknet22 #'
print '# operating system : Linux #'
print '# #'
print '#############################################################################################'+END
def Name_Sanitizer(vuln_name):
sanitize = ["/","*","\\","?","_","\",","(",")","-","?","'","\\","[","]","{","}"]
for x in sanitize:
vuln_name = vuln_name.replace(x," ")
return vuln_name
def Nessus_SSL_POC_Extractor(Folder_Path):
print BOLD+P+"Start Analysing Nessus CSV Output....\n"+END
file = open(Folder_Path, 'r')
reader = csv.reader(file)
for line in reader:
if (line[7] == "SSL Medium Strength Cipher Suites Supported"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+ssl-enum-ciphers -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if ((line[7] == "SSL Certificate Signed Using Weak Hashing Algorithm") or (line[7] == "SSL Certificate Cannot Be Trusted") or (line[7] == "SSL Self-Signed Certificate") or (line[7] == "SSL Certificate Expiry")):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+ssl-cert -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL RC4 Cipher Suites Supported (Bar Mitzvah)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssl-enum-ciphers -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -4 -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL/TLS Diffie-Hellman Modulus <= 1024 Bits (Logjam)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssl-enum-ciphers -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -J -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL Version 2 and 3 Protocol Detection"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+sslv2 -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -J -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if ((line[7] == "SSH Weak Algorithms Supported") or (line[7] == "SSH Server CBC Mode Ciphers Enabled") or (line[7] == "SSH Weak MAC Algorithms Enabled")):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -J -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL/TLS Protocol Initialization Vector Implementation Information Disclosure Vulnerability (BEAST)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -A -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL 64-bit Block Size Cipher Suites Supported (SWEET32)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -W -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSLv3 Padding Oracle On Downgraded Legacy Encryption Vulnerability (POODLE)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -O -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_Cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL/TLS EXPORT_RSA <= 512-bit Cipher Suites Supported (FREAK)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -F -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL DROWN Attack Vulnerability (Decrypting RSA with Obsolete and Weakened eNcryption)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -D -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "Transport Layer Security (TLS) Protocol CRIME Vulnerability"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -C -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SSL/TLS Renegotiation Handshakes MiTM Plaintext Data Injection"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
#nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
#print nmap_cmd
#os.system(nmap_cmd)
testssl_cmd = "./testssl/testssl.sh --quiet -R -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
print BOLD+O+testssl_cmd+END
os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "SMB Signing Disabled"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+ssh2-enum-algos -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -W -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+rdp-enum-encryption -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
rdp_cmd = "perl rdp/rdp-sec-check.pl --outfile Output/"+vuln_name+"/"+ip_port+"_.txt "+ip
print BOLD+O+rdp_cmd+END
os.system(rdp_cmd)
#rdp_Screenshot= "python EyeWitness/EyeWitness.py --rdp --no-dns --no-prompt -d Output/"+vuln_name+" --single "+ip
#print BOLD+O+rdp_Screenshot+END
#os.system(rdp_Screenshot)
print "Scanning done......"
if (line[7] == "MS12-020: Vulnerabilities in Remote Desktop Could Allow Remote Code Execution (2671387) (uncredentialed check)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+rdp-vuln-ms12-020 -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -W -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
nmap_cmd = "nmap -sS -Pn --script=+smb-vuln-ms17-010 -oN Output/"+vuln_name+"/"+ip_port+"_.txt -p "+port+" "+ip
print BOLD+O+nmap_cmd+END
os.system(nmap_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -W -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "Microsoft Windows SMB Log In Possible"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
enum4linux_cmd = "enum4linux -a -o -i -n -v "+ip+" > Output/"+vuln_name+"/"+ip_port+"_.txt "
print BOLD+O+enum4linux_cmd+END
os.system(enum4linux_cmd)
#testssl_cmd = "./testssl/testssl.sh --quiet -W -oL Output/"+vuln_name+"/"+ip_port+"_.txt "+ip+":"+port
#os.system(testssl_cmd)
#screenshot_cmd = "gnome-screenshot -f "+vulnerable_path+"/"+ip_port+".jpg"
#os.system(screenshot_cmd)
print "Scanning done......"
if (line[7] == "Terminal Services Doesn't Use Network Level Authentication (NLA) Only"):
vuln_name = str(line[7])
ip = str(line[4])
port = str(line[6])
ip_port = ip+"_"+port
vuln_name = Name_Sanitizer(vuln_name)
vuln_name = vuln_name.replace(" ","_")
vulnerable_path = "Output/"+vuln_name
if not os.path.exists(vulnerable_path):
os.makedirs(vulnerable_path)
rdp_Screenshot= "python EyeWitness/EyeWitness.py --rdp --no-dns --no-prompt -d Output/"+vuln_name+"/"+ip_port+" --single "+ip
print BOLD+O+rdp_Screenshot+END
os.system(rdp_Screenshot)
print "Scanning done......"
def Nessus_SSL_POC_count(Folder_Path):
print BOLD+P+"Start Analysing Nessus CSV Output....\n"+END
file = open(Folder_Path, 'r')
reader = csv.reader(file)
count1 = 0
count2 = 0
count3 = 0
count4 = 0
count5 = 0
count6 = 0
count7 = 0
count8 = 0
count9 = 0
count10 = 0
count11 = 0
count12 = 0
count13 = 0
count14 = 0
count15 = 0
count16 = 0
count17 = 0
count18 = 0
count19 = 0
count20 = 0
count21 = 0
count22 = 0
count23 = 0
count24 = 0
count25 = 0
count26 = 0
count27 = 0
for line in reader:
if (line[7] == "SSL Medium Strength Cipher Suites Supported"):
count1 = count1 + 1
if (line[7] == "SSL Certificate Signed Using Weak Hashing Algorithm"):
count2 = count2 + 1
if (line[7] == "SSL Certificate Cannot Be Trusted"):
count3 = count3 + 1
if (line[7] == "SSL Self-Signed Certificate"):
count4 = count4 + 1
if (line[7] == "SSL Certificate Expiry"):
count5 = count5 + 1
if (line[7] == "SSL RC4 Cipher Suites Supported (Bar Mitzvah)"):
count6 = count6 + 1
if (line[7] == "SSL/TLS Diffie-Hellman Modulus <= 1024 Bits (Logjam)"):
count7 = count7 + 1
if (line[7] == "SSL Certificate Chain Contains RSA Keys Less Than 2048 bits"):
count8 = count8 + 1
if (line[7] == "SSL Version 2 and 3 Protocol Detection"):
count9 = count9 + 1
if (line[7] == "SSH Weak Algorithms Supported"):
count10 = count10 + 1
if (line[7] == "SSH Server CBC Mode Ciphers Enabled"):
count11 = count11 + 1
if (line[7] == "SSH Weak MAC Algorithms Enabled"):
count12 = count12 + 1
if (line[7] == "SSL/TLS Protocol Initialization Vector Implementation Information Disclosure Vulnerability (BEAST)"):
count13 = count13 + 1
if (line[7] == "SSL 64-bit Block Size Cipher Suites Supported (SWEET32)"):
count14 = count14 + 1
if (line[7] == "SMB Signing Disabled"):
count15 = count15 + 1
if (line[7] == "SSLv3 Padding Oracle On Downgraded Legacy Encryption Vulnerability (POODLE)"):
count16 = count16 + 1
if (line[7] == "SSL/TLS EXPORT_RSA <= 512-bit Cipher Suites Supported (FREAK)"):
count17 = count17 + 1
if (line[7] == "SSL DROWN Attack Vulnerability (Decrypting RSA with Obsolete and Weakened eNcryption)"):
count18 = count18 + 1
if (line[7] == "Transport Layer Security (TLS) Protocol CRIME Vulnerability"):
count19 = count19 + 1
if (line[7] == "SSL/TLS Renegotiation Handshakes MiTM Plaintext Data Injection"):
count20 = count20 + 1
if (line[7] == "Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness"):
count21 = count21 + 1
if (line[7] == "Terminal Services Encryption Level is not FIPS-140 Compliant"):
count22 = count22 + 1
if (line[7] == "Terminal Services Encryption Level is Medium or Low"):
count23 = count23 + 1
if (line[7] == "Terminal Services Encryption Level is Medium or Low"):
count24 = count24 + 1
if (line[7] == "MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)"):
count25 = count25 + 1
if (line[7] == "Microsoft Windows SMB Log In Possible"):
count26 = count26 + 1
if (line[7] == "Terminal Services Doesn't Use Network Level Authentication (NLA) Only"):
count27 = count27+1
print BOLD+O+"SSL Medium Strength Cipher Suites Supported: "+END,BOLD+P+str(count1)+END
print BOLD+O+"SSL Certificate Signed Using Weak Hashing Algorithm: "+END,BOLD+P+str(count2)+END
print BOLD+O+"SSL Certificate Cannot Be Trusted: "+END,BOLD+P+str(count3)+END
print BOLD+O+"SSL Self-Signed Certificate: "+END,BOLD+P+str(count4)+END
print BOLD+O+"SSL Certificate Expiry: "+END,BOLD+P+str(count5)+END
print BOLD+O+"SSL RC4 Cipher Suites Supported (Bar Mitzvah): "+END,BOLD+P+str(count6)+END
print BOLD+O+"SSL/TLS Diffie-Hellman Modulus <= 1024 Bits (Logjam): "+END,BOLD+P+str(count7)+END
print BOLD+O+"SSL Certificate Chain Contains RSA Keys Less Than 2048 bits: "+END,BOLD+P+str(count8)+END
print BOLD+O+"SSL Version 2 and 3 Protocol Detection: "+END,BOLD+P+str(count9)+END
print BOLD+O+"SSH Weak Algorithms Supported: "+END,BOLD+P+str(count10)+END
print BOLD+O+"SSH Server CBC Mode Ciphers Enabled: "+END,BOLD+P+str(count11)+END
print BOLD+O+"SSH Weak MAC Algorithms Enabled: "+END,BOLD+P+str(count12)+END
print BOLD+O+"SSL/TLS Protocol Initialization Vector Implementation Information Disclosure Vulnerability (BEAST): "+END,BOLD+P+str(count13)+END
print BOLD+O+"SSL 64-bit Block Size Cipher Suites Supported (SWEET32): "+END,BOLD+P+str(count14)+END
print BOLD+O+"SMB Signing Disabled: "+END,BOLD+P+str(count15)+END
print BOLD+O+"SSLv3 Padding Oracle On Downgraded Legacy Encryption Vulnerability (POODLE): "+END,BOLD+P+str(count16)+END
print BOLD+O+"SSL/TLS EXPORT_RSA <= 512-bit Cipher Suites Supported (FREAK): "+END,BOLD+P+str(count17)+END
print BOLD+O+"SSL DROWN Attack Vulnerability (Decrypting RSA with Obsolete and Weakened eNcryption): "+END,BOLD+P+str(count18)+END
print BOLD+O+"Transport Layer Security (TLS) Protocol CRIME Vulnerability: "+END,BOLD+P+str(count19)+END
print BOLD+O+"SSL/TLS Renegotiation Handshakes MiTM Plaintext Data Injection: "+END,BOLD+P+str(count20)+END
print BOLD+O+"Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness: "+END,BOLD+P+str(count21)+END
print BOLD+O+"Terminal Services Encryption Level is not FIPS-140 Compliant: "+END,BOLD+P+str(count22)+END
print BOLD+O+"Terminal Services Encryption Level is Medium or Low: "+END,BOLD+P+str(count23)+END
print BOLD+O+"MS12-020: Vulnerabilities in Remote Desktop Could Allow Remote Code Execution (2671387) (uncredentialed check): "+END,BOLD+P+str(count24)+END
print BOLD+O+"MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check): "+END,BOLD+P+str(count25)+END
print BOLD+O+"Microsoft Windows SMB Log In Possible: "+END,BOLD+P+str(count26)+END
print BOLD+O+"Terminal Services Doesn't Use Network Level Authentication (NLA) Only"+END,BOLD+P+str(count27)+END
def main():
banner()
Output_Path = "Output"
if not os.path.exists(Output_Path):
os.makedirs(Output_Path)
try:
Folder_Path = raw_input(BOLD+Y+"Enter Nessus CSV Output File Name: ")
Nessus_SSL_POC_Extractor(Folder_Path)
Nessus_SSL_POC_count(Folder_Path)
except KeyboardInterrupt:
print "\nKeyboard Interrupt..."
except IOError,i:
print "\nInput Output Error..."
print i
except Exception,e:
print "\nError in file..."
print e
if __name__ =='__main__':
main()