Advertisement
Felanpro

Basic Portscanner

Mar 1st, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import socket
  2.  
  3. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  4. server = 'saboon.org'
  5.  
  6. def pscan(port):
  7.     try:
  8.         s.connect((server,port))
  9.         return True
  10.     except:
  11.         return False
  12.  
  13. for x in range(1,81):
  14.     if pscan(x):
  15.         print('Port',x,'is open!!!!!!')
  16.     else:
  17.         print('Port',x,'is closed')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement