-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathvulnerability_analysis_menu.py
64 lines (51 loc) · 2.77 KB
/
vulnerability_analysis_menu.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
# ################################################################################
# ## DATE: 2019-17-07
# ## AUTHOR: Óscar J. Rubio
# ##
# ################################################################################
# ## 1.0 initial release
from common_utils import menu_utils
from common_utils import var_utils
from vulnerability_analysis import *
def menu():
while 1:
""" VULNERABILITY ANALYSIS MENU """
option = menu_utils.nice_menu('Select hacking tool', ['Scapy', 'Nmap', 'Banner grabbing'])
if (option < 1) | (option > 3):
return
elif option == 1:
""" SCAPY submenu """
while 1:
sub_option = menu_utils.nice_menu("Select analysis mode", ["Based on TCP", "Based on XMAS",
"Based on NULL", "Based on ACK",
"Based on UDP", "Based on ALL of them"])
if (sub_option < 1) | (sub_option > 6):
break
ips = var_utils.parse_cidr_ips(menu_utils.highlighted_input('target IPs (in CIDR format, e.g. '
'192.168.1.4/30, 192.168.2.7)'))
ports = var_utils.parse_ports(menu_utils.highlighted_input('target ports (e.g. 20-22, 80)'))
for ip in ips:
if sub_option == 1:
scapy_scan.scan('TCP', ip, ports)
elif sub_option == 2:
scapy_scan.scan('XMAS', ip, ports)
elif sub_option == 3:
scapy_scan.scan('NULL', ip, ports)
elif sub_option == 4:
scapy_scan.scan('ACK', ip, ports)
elif sub_option == 5:
scapy_scan.scan('UDP', ip, ports)
else:
scapy_scan.scan('ALL', ip, ports)
elif option == 2:
ips = var_utils.parse_cidr_ips(menu_utils.highlighted_input('target IPs (in CIDR format, e.g. '
'192.168.1.4/30, 192.168.2.7)'))
ports = menu_utils.highlighted_input('target ports (e.g. 20-22, 80)')
for ip in ips:
nmap_scan.scan(ip, ports)
elif option == 3:
ips = var_utils.parse_cidr_ips(menu_utils.highlighted_input('target IPs (in CIDR format, e.g. '
'192.168.1.4/30, 192.168.2.7)'))
ports = var_utils.parse_ports(menu_utils.highlighted_input('target ports (e.g. 20-22, 80)'))
for ip in ips:
banner_scan.scan(ip, ports)