Your Ad Here

Posted By

trg on 01/06/10


Tagged

network port scanner


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

adkatrit
magna


Python Port Scanner


 / Published in: Python
 

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

  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  

You need to login to post a comment.