Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socket import *
- if __name__ == '__main__':
- target = raw_input('Enter host to scan: ')
- targetIP = gethostbyname(target)
- print 'Starting scan on host ', targetIP
- #scan reserved ports
- for i in range(20, 1025):
- s = socket(AF_INET, SOCK_STREAM)
- result = s.connect_ex((targetIP, i))
- if(result == 0) :
- print 'Port %d: OPEN' % (i,)
- s.close()
Add Comment
Please, Sign In to add comment