Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import sys, signal, requests
- def def_handler(sig, frame):
- print("\n\n[!] Saliendo..\n")
- sys.exit(1)
- # Ctrl+C
- signal.signal(signal.SIGINT, def_handler)
- #127.0.0.1 seria lo mismo que utilizar la ip 192.168.139.131 ya que la solicitud seria mediante el squid proxie que para el seria lo mismo que hacer la solicitud a si mismo)
- main_url = "http://127.0.0.1"
- squid_proxy = {'http': 'http://192.168.139.131:3128'}
- def portDiscovery():
- # Conjunto de puertos TCP comunes a escanear
- common_tcp_ports = {
- 20, # FTP - File Transfer Protocol (Data)
- 21, # FTP - File Transfer Protocol (Control)
- 22, # SSH - Secure Shell
- 23, # Telnet
- 25, # SMTP - Simple Mail Transfer Protocol
- 53, # DNS - Domain Name System
- 80, # HTTP - Hypertext Transfer Protocol
- 110, # POP3 - Post Office Protocol version 3
- 115, # SFTP - Simple File Transfer Protocol
- 119, # NNTP - Network News Transfer Protocol
- 123, # NTP - Network Time Protocol
- 143, # IMAP - Internet Message Access Protocol
- 161, # SNMP - Simple Network Management Protocol
- 194, # IRC - Internet Relay Chat
- 443, # HTTPS - Hypertext Transfer Protocol Secure
- 993, # IMAPS - Internet Message Access Protocol over SSL/TLS
- 995, # POP3S - Post Office Protocol version 3 over SSL/TLS
- 1080, # Socks - Proxy
- 1433, # MSSQL - Microsoft SQL Server
- 1521, # Oracle database default listener
- 1723, # PPTP - Point-to-Point Tunneling Protocol
- 3306, # MySQL database system
- 3389, # RDP - Remote Desktop Protocol
- 5432, # PostgreSQL database system
- 5900, # VNC - Virtual Network Computing
- 8080, # HTTP Proxy
- 8443, # HTTPS-alt - Alternative HTTP Secure
- 9100, # Printer
- 27017, # MongoDB database system
- 27018, # MongoDB database system
- 27019, # MongoDB database system
- 28017, # MongoDB database system (Web Interface)
- 50000, # SAP - Systems, Applications, and Products in Data Processing
- 50070, # Hadoop HDFS NameNode default port
- 50075, # Hadoop HDFS DataNode default port
- 54321, # Pentaho Report Designer
- 5500, # VNC remote desktop protocol (RFB)
- 5501, # Hotline tracker server connection
- 5672, # RabbitMQ messaging system
- 6379, # Redis key-value store
- 7001, # WebLogic Server (SSL)
- 8086, # InfluxDB database
- 8089, # Splunk
- 8888, # Jupyter Notebook
- 9000, # Elasticsearch
- 9042, # Cassandra database
- 9160, # Cassandra database
- 9200, # Elasticsearch RESTful API
- 9300, # Elasticsearch transport
- 10000, # Webmin - web-based system administration tool
- 11211, # Memcached
- 27015, # Valve Steam servers
- }
- for tcp_port in common_tcp_ports:
- # Realizar una solicitud GET a cada puerto en el servidor especificado
- r = requests.get(main_url + ':' + str(tcp_port), proxies=squid_proxy)
- if r.status_code != 503:
- # Si el código de estado de la respuesta no es 503 (Servicio no disponible), el puerto se considera abierto
- print("\n[+] Port " + str(tcp_port) + " - OPEN")
- if _name_ == "_main_":
- portDiscovery()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement