nice work mate. i basically did the same thing as you with the dynamic message box shellcode – its a little different though, http://www.bmgsec.com.au/download/8/ – i used an encoder to get around the null byte problem. In total the shellcode weighs 302 bytes itself, with nulls, but when the encoder is used, it weighs 302+22. cool stuff
by the way: I reviewed my code again, and I have turned it into 283 bytes of null-byte-free code 🙂 (no encoder used) cheers Peter
Peter, I haven’t read all of them yet as I just stumbled upon your blog, but I have to say that is a fantastic series of articles. I understood what buffer overflows were in an abstract sort of way, but you’ve given me a much better understanding of how they’re exploited. You mention that you’re no asm expert. Do you have any recommended reading for someone that wants to learn some asm, whether books, tutorials, or anything else you feel is necessary? I’m not looking to become an expert in writing asm code, but I feel it’s a useful skill to have, and is something i’ve always regarded as somewhat of a dark art. I would like to gain a better understanding of what’s going on so that I can start experimenting on my own. Keep it up!
Hey, I believe the Randall Hyde book/website is not bad to learn asm. And you’ll probably want to grab yourself a copy of the intel processor manual too. What also helps is: write a simple application in C, and open the application in a debugger, and just try to understand what happens…
Hi ,Peter !! I think that i’m lost in the course ..exactaly in the part of “Converting asm to shellcode : Putting things together”… Because I can’t compile the “shellcodetest.c” correctelly..In fact i think that i used an incorrect address of “MessageBoxA” ,for this action I used Ollydbg (open —>user32.dll ;right bottun —>search for >Name (label)in current module—>MessageBoxA )…..I found this address “77D5050B” .so ,i used in my code ;and I compile it with dev-c++ ,but I obtained an Error “Acces violation!!” …!! ——————————————————————– 1-So,Address of “MessageBoxA” Is that correct?? if yes ,are u can help me for finding the Error ?? Thank u Peter or Any body hwo can Help me !! THANKX ***************Smainoo************************
Hi, can you please post your question in the forum : http://www.corelan.be:8800/index.php/forum/exploit-writing-win32-shellcoding/ thanks Peter
Hi Peter, This article is one of the most informative ones regarding shellcoding on Windows. Especially for those who want to code shellcodes on Windows 7. Thanks, Saleh
Hi, this article is awesome like the all the others, but I think there is a little error in the call $+4 section. CALL $+4 ; puts the address of RET on the stack and jumps to $+4 wich is the last byte if the call instruction itself this one —-v \xe8\xff\xff\xff\xff ; call $+4 ;so the next instruction which will get executed is \xff\xc3 which is (i think) DEC ECX \xc3 : ret ; \x59 : pop ecx ; ; and this POP ECX just pop’s the return value (pushed by call $+4) into ecx. ; The “ret” itself will never get executed as a “ret”(which would pop the pushed return; ; address and ; jump to it which is ret again, that would pop another maybe random value of the stack and ; go there, maybe crashing the application due an acces violation) ; so you have to remember that this will change ECX in case you prepared this register for ; later use and wanted to pop into another register correct me if I’m wrong please regards reapinghook
Hi, would it be possible to repeat your comment/question in the forum please ? http://www.corelan.be:8800/index.php/forum/exploit-writing-win32-shellcoding/ that way, I will be able to properly answer your good comment/question thanks
Just…wow. Brilliant. Seriously, you are doing for Windows shell code and exploitation what Jon Erikson did for Linux. You should really put this into a book…