/
ac6.py
58 lines (47 loc) · 1.2 KB
/
ac6.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from requests import Session, ConnectionError
import hashlib
# Router IP
IP = "192.168.0.1"
# Router Password
PASS = ""
PASS_HASH = hashlib.md5(PASS.encode()).hexdigest()
HEADERS = {
"Host": IP,
"User-Agent": "User-Agent: Mozilla/5.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Referer": f"http://{IP}/login.html",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"DNT": "1",
"Connection": "close"
}
def main():
session = Session()
# Force Logout
session.get(
f"http://{IP}/goform/exit"
)
# Auth
session.post(
f"http://{IP}/login/Auth",
headers=HEADERS,
data={
'username': 'admin',
'password': f'{PASS_HASH}'
}
)
# Enable Telnet
try:
session.get(
f"http://{IP}/goform/telnet",
headers=HEADERS
)
except ConnectionError as e:
if "load telnetd success" in str(e):
print("Telnetd Enabled")
print("Username: root")
print("Password: Fireitup")
if __name__ == "__main__":
main()