Skip to content
Open
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
54 changes: 28 additions & 26 deletions nmap-pro.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import socket
import socket
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 1-23 refactored with the following changes:

import threading
import os

Expand All @@ -18,9 +18,11 @@
| INSTAGRAM : @retropacketz |
------------------------------------------------""")
print ("")
print (red +"WARNING: This scan can take a while depending on your network speed")
print (red + "so have a cup of coffee and relax until finished 😎")
print (cyan +"")
print(
f"{red}WARNING: This scan can take a while depending on your network speed"
)
print(f"{red}so have a cup of coffee and relax until finished 😎")
print(f"{cyan}")


target = input("""Target: """) # scan local host
Expand All @@ -29,7 +31,7 @@ def port_scanner(port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((target, port))
print(green + f"""[*] Port {port} is open""")
print(f"""{green}[*] Port {port} is open""")
Comment on lines -32 to +34
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function port_scanner refactored with the following changes:

except:
pass

Expand All @@ -40,41 +42,41 @@ def port_scanner(port):


print ("")
print (Y + "[*] Confirming Results For " + target, "With Nmap...")
print (green + "")
os.system("sudo nmap --top-ports 50 " + target)
print(f"{Y}[*] Confirming Results For {target}", "With Nmap...")
print(f"{green}")
os.system(f"sudo nmap --top-ports 50 {target}")

print ("")
print (Y + "[*] Scanning Using TCP Protocols For: " + target)
print (green + "")
os.system("sudo nmap -sT " + target)
print(f"{Y}[*] Scanning Using TCP Protocols For: {target}")
print(f"{green}")
os.system(f"sudo nmap -sT {target}")



print ("")
print (Y + "[*] Scanning Using UDP Protocols For: " + target)
print(green + "")
os.system("sudo nmap -sU " + target)
print(f"{Y}[*] Scanning Using UDP Protocols For: {target}")
print(f"{green}")
os.system(f"sudo nmap -sU {target}")

print ("")
print (Y + "[*] Performing OS/Service Detection On: " + target)
print (green + "")
os.system("sudo nmap -A -T4 " + target)
print(f"{Y}[*] Performing OS/Service Detection On: {target}")
print(f"{green}")
os.system(f"sudo nmap -A -T4 {target}")

print ("")
print (Y + "[*] Detecting Service/Daemon Versions For: " + target)
print (green + "")
os.system("sudo nmap -sV " + target)
print(f"{Y}[*] Detecting Service/Daemon Versions For: {target}")
print(f"{green}")
os.system(f"sudo nmap -sV {target}")

print ("")
print (Y + "[*] Performing CVE Detection For: " + target)
print (green + "")
os.system("sudo nmap -Pn --script vuln " + target)
print(f"{Y}[*] Performing CVE Detection For: {target}")
print(f"{green}")
os.system(f"sudo nmap -Pn --script vuln {target}")

print ("")
print (Y + "[*] Detecting Malware Infections On Remote Hosts For: " + target)
print (green + "")
os.system("sudo nmap -sV --script=http-malware-host " + target)
print(f"{Y}[*] Detecting Malware Infections On Remote Hosts For: {target}")
print(f"{green}")
os.system(f"sudo nmap -sV --script=http-malware-host {target}")
Comment on lines -43 to +79
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 43-77 refactored with the following changes:


print ("")
#print (Y +"")
Expand Down