-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXScanner.py
More file actions
75 lines (67 loc) · 4.32 KB
/
Copy pathXScanner.py
File metadata and controls
75 lines (67 loc) · 4.32 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
72
73
74
75
#!/usr/bin/python3
import nmap
print()
print(" ### ## ####### # ### ## ##### # ## ##### # ## ##### ## ##### /## ")
print(" /#### #### / / ### / /### / /#### ###### /# #### / ###### /# #### / ###### /### / ###### / ## ")
print("/ ### /####/ / ## / / ###/ / ### /# / / ## ###/ /# / / ## ###/ /# / / ###/ /# / / ## ")
print(" ### / ## ## # / ## ## /## / / / ## # # / / / ## # # / / / ## / / / ## ")
print(" ### / ### / ### / ## / / ## # / / ## # / / / / / ")
print(" ###/ ## ### ## ## / ## ## ## ## # ## ## ## # ## ## ## ## / ")
print(" ### ### ### ## ## / ## ## ## ## # ## ## ## # ## ## ## ## / ")
print(" /### ### ### ## ## / ## ## ## ## # ## ## ## # ## ###### ## ###/ ")
print(" / ### ### /## ## ## / ## ## ## ## # ## ## ## # ## ##### ## ## ### ")
print(" / ### #/ /## ## ## /######## ## ## ## # ## ## ## # ## ## ## ## ## ")
print(" / ### #/ ## ## ## / ## # ## ### # ## ### # ## # ## ## ")
print(" / ### # / ## # / # ## / ### / ### / / ## ")
print(" / ### / /## / ### / /#### ## /##/ ## /##/ ## /##/ / /##/ ### ")
print(" / ####/ / ########/ ######/ / #### ## / / ##### / ##### / ##########/ / #### ## ")
print(" / ### / ##### ### / ## #/ / ## / ## / ###### / ## # ")
print(" | # # # # # ")
print(" \\) ## ## ## ## ## ")
print()
print("[Info] This is a PortScanner to scan diferents open ports on a target IP address. ")
print(" || Function on NMAP (network mapper) library for python 3.")
print(" || Support my repository and give support to the project.")
ip=input("[+] IP Objetivo ==> ")
nm = nmap.PortScanner()
puertos_abiertos="-p "
results = nm.scan(hosts=ip,arguments="-sT -n -Pn -T4")
count=0
#print (results)
print("\nHost : %s" % ip)
print("State : %s" % nm[ip].state())
for proto in nm[ip].all_protocols():
print("Protocol : %s" % proto)
print()
lport = nm[ip][proto].keys()
sorted(lport)
for port in lport:
print ("port : %s\tstate : %s" % (port, nm[ip][proto][port]["state"]))
if count==0:
puertos_abiertos=puertos_abiertos+str(port)
count=1
else:
puertos_abiertos=puertos_abiertos+","+str(port)
print("\nPuertos abiertos: "+ puertos_abiertos +" "+str(ip))
import nmap
ip input("[+] Introduce the IP direction first: ")
nm = nmap.PortScanner()
puertos_abiertos="-p "
results = nm.scan(hosts=ip,arguments="-sT -n -Pn -T4")
count=0
#print (results) + Info of scanner IP...
print("\nHost : %s" % ip)
print("State : %s" % nm[ip].state())
for proto in nm[ip].all_protocols():
print("Protocol : %s" % proto)
print()
lport = nm[ip][proto].keys()
sorted(lport)
for port in lport:
print ("port : %s\tstate : %s" % (port, nm[ip][proto][port]["state"]))
if count==0:
puertos_abiertos=puertos_abiertos+str(port)
count=1
else:
puertos_abiertos=puertos_abiertos+","+str(port)
print("\nPuertos abiertos: "+ puertos_abiertos +" "+str(ip))