Advertisement
miutextun

Port Scanner CLI

May 2nd, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. #!/usr/bin/python
  2. import socket
  3.  
  4.  
  5. print"""
  6. _____    ___  _____
  7. /  ___|  /   ||  ___|
  8. \ `--.  / /| || |__  
  9. `--. \/ /_| ||  __|
  10. /\__/ /\___  || |___
  11. \____/     |_/\____/
  12.  
  13. [+]Simple Port Scanner (Python)
  14. [+]Coded by miutex(TUNISIAN CYBER)
  15. [+]Sites:sec4ever.com,exploit4arab.net
  16. """
  17.  
  18. sec4 =raw_input('IP Address:')
  19. for port in range(1,400):
  20.   s0ck = socket.socket()
  21.   s0ck.settimeout(0.5)
  22.   ip = sec4
  23.   response = s0ck.connect_ex((ip, port))
  24.   if response:
  25.    print ("%d\tclose" %port)
  26.  
  27.   else:
  28.       print ("%d\topen" %port)
  29.   s0ck.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement