bug in zyxel
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import requests
|
||||
import re
|
||||
from urllib.parse import urljoin
|
||||
|
||||
ROUTER = "https://192.168.178.2"
|
||||
|
||||
r = requests.get(ROUTER, verify=False, timeout=5)
|
||||
|
||||
scripts = re.findall(r'<script[^>]+src=["\']([^"\']+)', r.text)
|
||||
|
||||
for script in scripts:
|
||||
if script.endswith("/app.js"):
|
||||
url = urljoin(ROUTER, script)
|
||||
|
||||
print("Downloading:", url)
|
||||
|
||||
js = requests.get(url, verify=False, timeout=10).text
|
||||
|
||||
print("Size:", len(js), "bytes")
|
||||
|
||||
# Print strings containing things that are likely to be API endpoints
|
||||
print("\nInteresting URLs/strings:\n")
|
||||
|
||||
patterns = [
|
||||
r'["\']([^"\']*(?:api|cgi|device|client|status|dhcp|wifi|wireless|lan)[^"\']*)["\']',
|
||||
]
|
||||
|
||||
found = set()
|
||||
|
||||
for pattern in patterns:
|
||||
for match in re.findall(pattern, js, re.IGNORECASE):
|
||||
if len(match) < 300:
|
||||
found.add(match)
|
||||
|
||||
for item in sorted(found):
|
||||
print(item)
|
||||
Reference in New Issue
Block a user