Re: Shellcode not working
Does your shellcode have enough room to decode? Could be you need to add some more nops at the beginning of your buffer to let it breathe, or perform some stack adjustment. Then again, I may not know what I'm talking about :)
Re: Shellcode not working
Maybe add some xor(all exept esp,ebp) at the start of the shellcode.
Re: Shellcode not working
If you have ruled out mangling due to bad characters, and the exploit reaches the point where the CPU actually starts to execute your encoded shellcode, Id tend to agree with f1guref0ur and say that the problem lies in the decoding process. Try the same encoded shellcode in another simple exploit and watch how it decodes in a debugger - this should give you an idea of how the decoding works and where the problem may lie.
Re: Shellcode not working
Thanks for the replies. This is what I've tried so far. I added plenty of room to allow for decoding, so there really isn't much of an issue there. I have 80 bytes of NOPs prior to my shellcode on the stack and the shellcode decoding process never really gets to the point where it runs into any of that. I've also added the following before my shellcode to zero out the 2 registers that have values in them when the shellcode starts executing:
33 c9 xor ecx, ecx
33 d2 xor edx, edx
That didn't work either.
I don't know. Maybe there is an issue with the shellcode that I have generated due to the number of bad characters. I will try encoding it again and see if I get the same results. I'll post back how it goes.
Re: Shellcode not working
So... Did you get it to work?
Re: Shellcode not working
Quote:
I don't know. Maybe there is an issue with the shellcode that I have generated due to the number of bad characters. I will try encoding it again and see if I get the same results. I'll post back how it goes.
Try zeroing out the stack space, say a sub 40h esp is used for some function make sure all that space is zeroed, the function migh expect it to be zero with a normal function program
Re: Shellcode not working
Still haven't gotten the shellcode to execute properly on the stack without any exceptions. Like I said, it does start to execute, but I always get an exception midway through. I haven't tried zeroing out the stack space. But, I am beginning to realize why the original exploit used a JIT Spray method to load the shellcode into a different place in memory.
The original exploit is here: SigPlus Pro v3.74 ActiveX LCDWriteString() Remote BoF JIT Spray - aslr/dep bypass
I tried using a Heap Spray method, but I am trying to get the exploit to work under IE8 and I don't know any techniques of spraying the heap under IE8's memory protection.
It looks like interpreter exploitation techniques are the best way under IE8, but I haven't found a good JIT Spray tutorial after searching the internet far and wide. If anyone knows of any, let me know. Thanks for all the help!
Re: Shellcode not working
Quote:
Originally Posted by
Clonmac
Still haven't gotten the shellcode to execute properly on the stack without any exceptions. Like I said, it does start to execute, but I always get an exception midway through. I haven't tried zeroing out the stack space. But, I am beginning to realize why the original exploit used a JIT Spray method to load the shellcode into a different place in memory.
The original exploit is here:
SigPlus Pro v3.74 ActiveX LCDWriteString() Remote BoF JIT Spray - aslr/dep bypass
I tried using a Heap Spray method, but I am trying to get the exploit to work under IE8 and I don't know any techniques of spraying the heap under IE8's memory protection.
It looks like interpreter exploitation techniques are the best way under IE8, but I haven't found a good JIT Spray tutorial after searching the internet far and wide. If anyone knows of any, let me know. Thanks for all the help!
Check this out http://www.dsecrg.com/files/pub/pdf/...d%20profit.pdf
Re: Shellcode not working
Thanks Cryptik. Ya, I originally looked at that document when trying to learn about JIT Spray. It was about the only JIT spray doc I could find. I downloaded the scripts they had posted on dsecrg.com and was able to generate the Action Script and compile it to a SWF file. The only trouble I have with the process is determining the return address into the JIT stage-0 shellcode. The process is a bit above me at the moment. I'll have to read up on it several more times for it to make sense.
Thanks again.