Advertisement
Guest User

scanner.py

a guest
May 22nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/python3
  2. # slow gan ane hanya newbie hehehe
  3.  
  4. class NyariPort:
  5.     def __init__(self, ip):
  6.         self.ip = ip
  7.     def getPort(self):
  8.         self.host = socket.gethostbyname(self.ip)
  9.         print("menghubungkan ke {}\n".format(self.host))
  10.         for port in range(1,10000):
  11.             net = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  12.             res = net.connect_ex((self.host,port))
  13.             if res == 0:
  14.                 print("port {} terbuka! ^_^".format(port))
  15.         print("\n\033[91mRampung coy -.-")
  16.        
  17. if __name__=='__main__':
  18.     import socket
  19.     url = input("target host: ")
  20.     e = NyariPort(url)
  21.     e.getPort()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement