Live data from Hacker News

Shellcode Injection

dhavalkapil.com

1–10 of 17 posts

Re: Shellcode Injection

#6
post #4

Why "echo 0 | dd of=foo" and not simply "echo 0 > foo"?

    echo 0 > foo //wont work with sudo ..
    sudo echo 0 > foo //will fail ... 
    sudo sh -c 'echo 0 > file' //If you want echo with sudo
else what author has done is right

Re: Shellcode Injection

#8
post #7

> ... -fno-stack-protector -z execstack Does anyone know how common stack protector is in the wild?

Depends on which distributions patch gcc to enable it by default. From what I'm aware, a lot of them do, though.

Re: Shellcode Injection

#10
Almost every program nowadays is compiled with W^X (--no_execstack) by default which means the memory is not executable and writable at once (Windows equivalent is DEP). Still a good example of how a basic overflow can lead to arbitrary code execution. A follow-up post using ROP or return-to-libc would be interesting, with W^X enabled.
Post reply on HN