Topic: python port scaning
sharing pengalaman belajar socket dikit
#!/usr/bin/python
from import socket *
iptarget = raw_input(‘ hostname ‘)
target = gethostbyname(iptarget)
for port in range(20,1025):
s = socket(AF_INET, SOCK_STREAM)
ulang = s.connect_ex((iptarget, port))
if(ulang==0):
print ‘Port %d: OPEN’ % (port,)
s.close()ket :
s = socket(AF_INET, SOCK_STREAM)
AF_INET ==> socket dihubungkan dengan protokol internet
SOCK_STREM ==> program ini memakai stream socket/tcp
klo g berguna dihapus aj![]()
