![]() |
|
[Assembly] Can not execute when encode to shell code .. - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5) +---- Thread: [Assembly] Can not execute when encode to shell code .. (/showthread.php?tid=4771847) |
Can not execute when encode to shell code .. - SIM-1866423 - Apr 10, 2015 There my first hello world app with asm(Litle edit,trying bypass null bytes etc..). PHP Code When ım complie script to executable file, everything going normal. PHP Code There dump info ; PHP Code When im making that shellcode cant execute 😧 Already try to execute in Python/C/C++ ım always get this error ; PHP Code I'm too hectic right now, sorry for this.So any idea why fail ? 😁 * - LevelUp - Apr 10, 2015 Well firstly you can't utilise your 'message' variable in such a manner because you do not know what is going to be at address because ASLR will randomize that sections base address. You will have to instead utilise a: Code _start:Also if you were using this as part of a buffer overflow, it would not work to use 'add <reg32>,0xwhatever' as you've done in your code because you have not zeroed out the registers yet. Instead just use: Code xor <reg32>,<reg32>To be noted that you'll still get a segfault with making that initial change I first suggested because you must disable NX stack first by compiling with -fno-stack-protector -z execstack. * - SIM-1866423 - Apr 10, 2015 I'm pretty new in asm,asm looks like me little higgledy-piggledy.I will try again, thanks for advice 😉 |