Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Python3-NmapScanner
Simple network scanner - built with Python3 and Nmap.

## requirements:
`pip3 install python-nmap`
25 changes: 11 additions & 14 deletions Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@

ip_addr = input("Please enter the IP address you want to scan: ")
print("The IP you entered is: ", ip_addr)
type(ip_addr)

resp = input("""\nPlease enter the type of scan you want to run
1)SYN ACK Scan
2)UDP Scan
3)Comprehensive Scan \n""")
1) SYN ACK Scan
2) UDP Scan
3) Comprehensive Scan \n""")
print("You have selected option: ", resp)
resp_dict={'1':['-v -sS','tcp'],'2':['-v -sU','udp'],'3':['-v -sS -sV -sC -A -O','tcp']}

resp_dict = {'1': ['-v -sS', 'tcp'], '2': ['-v -sU', 'udp'], '3': ['-v -sS -sV -sC -A -O', 'tcp']}
if resp not in resp_dict.keys():
print("enter a valid option")
print("Enter a valid option")
else:
print("nmap version: "sccaner.nmap_version())
scanner.scan(ip_addr,"1-1024",resp_dict[resp][0]) #the # are port range to scan, the last part is the scan type
print("nmap version:", scanner.nmap_version())
scanner.scan(ip_addr, "1-1024", resp_dict[resp][0])
print(scanner.scaninfo())
if scanner.scaninfo()=='up':
print("Scanner Status: ",scanner[ip_addr].state())
if 'up' in scanner[ip_addr].state():
print("Scanner Status: ", scanner[ip_addr].state())
print(scanner[ip_addr].all_protocols())
print("Open Ports: ",scanner[ip_addr][resp_dict[resp][1]].keys()) #display all open ports



print("Open Ports: ", scanner[ip_addr][resp_dict[resp][1]].keys())



Expand Down