-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNmapScanner.py
More file actions
71 lines (56 loc) · 1.72 KB
/
NmapScanner.py
File metadata and controls
71 lines (56 loc) · 1.72 KB
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
import os
import time
TargetIP = input("Enter the IP of Target Machine :")
print("Enter the number to perform the tasks :\n")
print("""
Press 1 for Basic Scanning
Press 2 for Scanning Specific Port No
Press 3 for Scanning IP Ranges
Press 4 for Scanning top-popular ports
Press 5 for Scanning with disbaling DNS resolution
Press 6 for Scanning to detect services used
Press 7 for Scanning only TCP protocols
Press 8 for Scanning only UDP protocols
Press 9 for Scanning CVE detection
Press 10 for Scanning Aggresive Scanning\n""")
usrInput = int(input("Enter the Number To Perform the Scans :"))
print("[INFO] performing the scan...")
time.sleep(2.0)
if (usrInput == 1):
os.system("nmap {}".format(TargetIP))
exit(0)
elif (usrInput == 2):
port=input("Enter the IP Port to Scan :")
os.system("nmap -p {} {}".format(port,TargetIP))
exit(0)
elif (usrInput == 3):
#range=input("Enter the IP ranges to Scan :")
iprange = input("Enter the Complete IP Range :")
os.system("nmap -p {}".format(iprange))
exit(0)
elif (usrInput == 4):
num=int(input("Enter the count of ports you want to Scan :"))
os.system("nmap --top-ports {} {}".format(num,TargetIP))
exit(0)
elif (usrInput == 5):
os.system("nmap -p 80 -n {}".format(TargetIP))
exit(0)
elif (usrInput == 6):
os.system("nmap -sV {}".format(TargetIP))
exit(0)
elif (usrInput == 7):
os.system("nmap -sT {}".format(TargetIP))
exit(0)
elif (usrInput == 8):
os.system("nmap -sU {}".format(TargetIP))
exit(0)
elif (usrInput == 9):
os.system("nmap -Pn --script vuln {}".format(TargetIP))
exit(0)
elif (usrInput == 10):
os.system("nmap -sV -O -A -Pn {}".format(TargetIP))
exit(0)
else:
print("[INFO] exiting...")
time.sleep(2.0)
print("Please Enter Correct Number!!!")