Python Port Scanner


/ Published in: Python
Save to your folder(s)

This is mostly just a "Hello World" post for Snipplr... nothing impressive here


Copy this code and paste it in your HTML
  1. #!/usr/bin/python
  2.  
  3. import sys
  4. from socket import *
  5.  
  6. for port in range(int(sys.argv[2].split('-')[0]), int(sys.argv[2].split('-')[1])+1):
  7. try:socket(AF_INET, SOCK_STREAM).connect((sys.argv[1], port)); print "Able to connect to port:", port
  8. except: pass

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.