Advertisement
lol222222

SANS_PORTS

Jan 18th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. #sans ports
  2. #pip install termcolor
  3. #pip install sockets
  4. #pip install DateTime
  5. #pip install threaded
  6.  
  7. from datetime import datetime
  8. import threading
  9. from termcolor import colored
  10.  
  11.  
  12. def ports():
  13. lresult = "==========================="
  14.  
  15. print(colored('''
  16. VERSION:1.0.0
  17. --------------------------------------------------------------------------
  18. | |
  19. | _$$$$____$$$$___$$__$$___$$$$___$$$$$____$$$$___$$$$$___$$$$$$___$$$$ |
  20. | $$______$$__$$__$$$_$$__$$______$$__$$__$$__$$__$$__$$____$$____$$ |
  21. | _$$$$___$$$$$$__$$_$$$___$$$$___$$$$$___$$__$$__$$$$$_____$$_____$$$$ |
  22. | ____$$__$$__$$__$$__$$______$$__$$______$$__$$__$$__$$____$$________$$ |
  23. | _$$$$___$$__$$__$$__$$___$$$$___$$_______$$$$___$$__$$____$$_____$$$$ |
  24. | |
  25. --------------------------------------------------------------------------
  26. ''', 'green'))
  27.  
  28. print(colored('>>>without http and https example www.youtube.com!!! \n','red'))
  29.  
  30. #soket
  31. ip = input(colored('Enter_link:>>> ','yellow'))
  32. print()
  33. def scan_port(ip,port):
  34. sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  35. sock.settimeout(0.5)
  36. try:
  37. connect = sock.connect((ip,port))
  38. print(lresult)
  39. print(colored('[ PORT: >>>','yellow'),port,colored('<<< :OPEN ] ','green'))
  40. print(lresult,'\n')
  41. connect.close()
  42. except:
  43. pass
  44. for i in range(1000):
  45. potoc = threading.Thread(target=scan_port, args=(ip,i))
  46. potoc.start()
  47. #==============================
  48. #time result port
  49. start = datetime.now()
  50. ends = datetime.now()
  51. print('Time : {}'.format(ends-start))
  52. #===============================
  53.  
  54.  
  55. ports()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement