Limited characters, process and much more Flashcards
From what part of memory DLL’s can be used to choose PPR?
Either application DLL, application exe or system DLL’
How to find all instances of shellcode?
Save the shellcode in bin file and compare with memory using MSF pattern and bin file comparison
How can we troubleshoot the final shellcode before egg hunter jumps to it?
look into all memory regions where final shell code is and see it is unmodified. Setup breakpoints in egg hunter and diagnose
Why do we use NOPS or NOP equivalent instructions?
Bcoz the encoded shellcode will get decoded. So it is good have NOPS or NOP like instruction to allow space for decoding
How do we know whether an exploit broken or not bcoz of opcodes and how to verify it before?
For any code that we write, we need to know it’s opcode and ascii value to speculate the possibility of exploit getting broken
What are things that we need to consider before choosing PPR?
It should not be compiled with safeSEH and it is subjected to limited charset. So pick an address in allowed ascii charset
How will you search PPR address?
Either through mona or manually search through immunity
How is limited charset different from ascii range?
Though ascii characters are printable, only few charters are allowed in certain buffer spaces like username, filename, etc. So we have a limited charset within ascii range
What are the problems if shellcode is not executing?
It could be due to wrong architecture of shellcode or it could be some missing sys cal functions or it could be due to port numbers or it could be due to ESP alignment corruption
Do we have to use alpha3 to encode egg hunter evrey time for limited charset scenario?
We should only use alpha3 egghunter only when we have limited nuffer above REt overw rite and final shell code is somewhere is memory, unmodified.
If the final shell code is below the RET overwrite then the final shell code can be encoded. We have plenty of room!!!!!
Do we have to write custom code based on stack and memory?
No, custom code can be created based on chosen register and its offset with egg hunter starting byte. Just a common addition and subtraction.
Why we use sub EAX and why not other registers?
Bcoz sub EAX comes under allowed limited charset
What are the possible problems if the egg hunter is not executing?
It could be due to sys call code or it could be due to executing corrupt code or it could be due to absence of NOPS like instructions before the encoded egg hunter
How can we position ESP at bottom to run custom decoded code?
By few pop functions
How can we troubleshoot egg hunter?
We can troubleshoot egg hunter by looking into the starting EDX value and then see from where it begins.etup breakpoints in egg hunter and diagnose
How do we find compatible characters?
We need to research and find the list of characters possible in the exploit .I.e filenames compatible depending upon the place where exploit is written ‘/‘ is not file compatible but still it will work in file name inside zip folder
Alternate scenario to adjust ESP and jumping to final shell code?..”Hitting two birds in one stone”
The custom decoder will push bytecode to the stack. In order to be able to execute that bytecode, we will need to control the location where this code is written to, so we can get it to execute after it was reproduced. That location is esp.
So perhaps we can use the same value as esp and put that in ebx, and use it as base address for doing the math. That way, we may be able to do our math calculation and produce the desired address in ebx, based on that value
There are a number of ways to modify esp. We could copy a value from a register, or pop one from the stack. If we have a good start value in esp, we can easily put it in ebx as well.
Why should you modify the egg hunter starting position?
Bcoz it takes lot of time to search through memory locations. Hence we should modify. Also there might be lot of chances to execute the corrupt code first
How to choose the NOPS in limited scenario?
It is based on a register which is not a buffer register and also at times we should also look for other things like EDX in egg hunter (e.g. inc edx 42 and ins eax 40)
Should we really care about egg - in character limitation scenario?
Yes if the egg contains bad character it might break the exploit
How can we position ESP above RET overwrite to execute custom code?
By using some conditional jump statements
How do you choose the buffer register for custom encoder?
Buffer can be chosen after we copy the egg hunter and see which registers are close by . The egg hunter can be again recreated using the identified new buffer
How can we walk over PPR address?
We have to choose PPR in such a way that it aligns and execution pass through the code below
If pop esp”/” in ESP alingment breaks the exploit then what would be another way?
Is to use POPAD to basically reduce down to ESP or junk fillers. If the number of instrcution in popad is not not enough to be filled in the stack below, then jump above ret overwrite and put them for enough room