17 lines
404 B
Python
17 lines
404 B
Python
import socket
|
|
|
|
socket.setdefaulttimeout(0.03)
|
|
|
|
|
|
target_ip=["127.0.0.1"]
|
|
target_port=[21,22,23,25,80,110,443,]
|
|
for ip in target_ip:
|
|
for port in target_port:
|
|
s = socket.socket()
|
|
try:
|
|
s.connect((ip,port))
|
|
banner = s.recv(1024)
|
|
s.close()
|
|
print(banner, ip, port)
|
|
except:
|
|
print('Ca marche pas ' + ip,port,'ne répond pas') |