Wednesday, January 7, 2015

Insertion encoder/decoder shellcode


For this solution I decided to incorporate the homework and the assignment and put two random characters between two legitimate shellcode values.
Key:
Legit = Legitimate piece of shellcode
Random = Bogus character placed to evade IDS.
-------------------------------------------------------------------------------------------------------------
|Legit |Legit |Random |Random |Legit |Legit |Random |Random|.....
-------------------------------------------------------------------------------------------------------------
The code that encodes the shellcode is a simple python script shown below
** It should be noted that the shellcode is a basic /bin/sh shellcode
The code below shows the decoder stub which should decode the bin/sh shellcode to give us back our original /bin/sh shellcode.

Still on the subject of insertion, I wrote another encoder decoder based on Vivek's poor man's encoder/decoder.
The python script below first reverses the shellcode and then inserts a random character between each value.
 **Note that the random characters generared dont include 255 (0xff) as we use it to signal the end of our shellcode.
Decoder All the code used here can be found at my github account here.

No comments:

Post a Comment