- Code: Select all
from socket import *
def scan(host, port, ports):
porte=range(port, ports+1)
for i in porte:
c=socket(AF_INET, SOCK_STREAM)
try:
c.connect((host, i))
print'[+] Porta %d aperta [+]'%(i)
i=i+1
except:
print'[~] Porta %d chiusa [~]'%(i)
continue
c.close()
while 1:
print'DekScan 1.0'
print'Powered by dekster'
print
print
print'Host:'
host=raw_input()
print'Porta iniziale:'
port=input()
print'Porta finale:'
ports=input()
scan(host, port, ports)
e questo è l'output
- Code: Select all
dekster@debian:~$ python DekScan.py
DekScan 1.0
Powered by dekster
Host:
127.0.0.1
Porta iniziale:
20
Porta finale:
30
[~] Porta 20 chiusa [~]
[~] Porta 21 chiusa [~]
[~] Porta 22 chiusa [~]
[~] Porta 23 chiusa [~]
[~] Porta 24 chiusa [~]
[+] Porta 25 aperta [+]
[~] Porta 26 chiusa [~]
[~] Porta 27 chiusa [~]
[~] Porta 28 chiusa [~]
[~] Porta 29 chiusa [~]
[~] Porta 30 chiusa [~]

