vinissh

basic_port_scan

Jan 11th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import socket
  2. import sys
  3.  
  4. try:
  5. #ip = input('Digite o IP ou Host para analise :')
  6. ip = sys.argv[1]
  7. ports = [21, 22, 23, 135, 8080, 80, 443, 3306]
  8. print("""\033[92m """)
  9. print("""\033[92m ___ _ ___ """)
  10. print("""\033[92m | . \ ___ _ _ _| |_ / __> ___ ___ ._ _ """)
  11. print("""\033[92m | _// . \| '_> | | \__ \/ | '<_> || ' | """)
  12. print("""\033[92m |_| \___/|_| |_| <___/\_|_.<___||_|_| """)
  13.  
  14. print()
  15.  
  16. for port in ports:
  17. client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  18. client.settimeout(0.05)
  19. code = client.connect_ex((ip, port))
  20. if code == 0:
  21. print('Scann ==>' + str(port) + ' [?] Porta aberta [?]')
  22. else:
  23. print('Scann ==>' + str(port) + ' [*] Porta fechada [*]')
  24. except ValueError:
  25. pass
Advertisement
Add Comment
Please, Sign In to add comment