Windows Exploiting (Basic Guide - OSCP lvl)
Last updated
Last updated
Every time you need to restart the service SLMail you can do it using the windows console:
Go to Options >> Appearance >> Fonts >> Change(Consolas, Blod, 9) >> OK
File --> Attach
And press START button
Every time you break the service you should restart it as is indicated in the beginnig of this page.
The pattern should be as big as the buffer you used to broke the service previously.
Change the buffer of the exploit and set the pattern and lauch the exploit.
A new crash should appeard, but with a different EIP address:
Check if the address was in your pattern:
Looks like we can modify the EIP in offset 2606 of the buffer.
Check it modifing the buffer of the exploit:
With this buffer the EIP crashed should point to 42424242 ("BBBB")
Looks like it is working.
600B should be enough for any powerfull shellcode.
Lets change the bufer:
launch the new exploit and check the EBP and the length of the usefull shellcode
You can see that when the vulnerability is reached, the EBP is pointing to the shellcode and that we have a lot of space to locate a shellcode here.
In this case we have from 0x0209A128 to 0x0209A2D6 = 430B. Enough.
Change again the buffer:
The badchars starts in 0x01 because 0x00 is almost always bad.
Execute repeatedly the exploit with this new buffer delenting the chars that are found to be useless:.
For example:
In this case you can see that you shouldn't use the char 0x0A (nothing is saved in memory since the char 0x09).
In this case you can see that the char 0x0D is avoided:
Using:
You will list the memory maps. Search for some DLl that has:
Rebase: False
SafeSEH: False
ASLR: False
NXCompat: False
OS Dll: True
Now, inside this memory you should find some JMP ESP bytes, to do that execute:
Then, if some address is found, choose one that don't contain any badchar:
In this case, for example: 0x5f4a358f
If the exploit is not working but it should (you can see with ImDebg that the shellcode is reached), try to create other shellcodes (msfvenom with create different shellcodes for the same parameters).
Add some NOPS at the beginning of the shellcode and use it and the return address to JMP ESP, and finish the exploit:
There are shellcodes that will overwrite themselves, therefore it's important to always add some NOPs before the shellcode
Add this parameters: