Skip to content

Instantly share code, notes, and snippets.

@pwgit-create
Created April 30, 2022 18:44
Show Gist options
  • Save pwgit-create/5ac0f1a40033d123a2456bc791ff493c to your computer and use it in GitHub Desktop.
Save pwgit-create/5ac0f1a40033d123a2456bc791ff493c to your computer and use it in GitHub Desktop.
Find forgotten SSL port on ASUS RT-AX82U
# Purpose for script: Find forgotten SSL port on your ASUS RT-AX82U router
# This can be useful if you have enabled the SSL only option for the admin interface login.
# If you also have enabled all the security features like disabling ICMP and activated the "AI Protection" it’s not-
# That easy to do a quick Nmap-scan. A simple enumeration will do the trick though 😊
import requests
# Sends multiply Get requests to find the first open port on a host with a webserver.
def find_port(host, start_port, end_scan_port):
status = True
port = start_port
reqString = ""
while (port < end_scan_port and status):
try:
reqString = host + ":" + str(port)
r = requests.get(reqString)
except requests.exceptions.SSLError:
print('Found Port -> ' + str(port)) # Found SSL port with missing certificate
status = False
except requests.ConnectionError:
print(host + ":" + str(port))
port = port + 1
except:
print("Something else went wrong")
else:
print('Found Port -> ' + str(port)) # found Port
status = False
find_port("https://your.router.ip", 4000, 14000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment