|
|||||||
| Pentesting Specific topics related to legal penetration testing |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Boot it up ( from live cd, mount -o rw /dev/blah ), install sebek, reboot it. Instant rootkit, forensicly capable, and it doesn't get caught by my nightly search-for-setuid.
__________________
Never underestimate the power of human stupidity - it is like a force of nature, capable of destroying even the most well laid plans. |
|
||||
|
Hey could you post the command you use to check your entire hard disk for programs that have the SUID bit set, I've been meaning to do this myself.
__________________
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests". |
|
||||
|
Quote:
Code:
find / -perm -4000 -print | mail gitsnik Programs like rkhunter search this up, as does the FreeBSD security program each morning. I actually use a lot of badly hacked perl and a secured database on another server to do my checks (I'm a little paranoid on my internal LAN :P) because, of course, some programs are meant to be set uid.
__________________
Never underestimate the power of human stupidity - it is like a force of nature, capable of destroying even the most well laid plans. |
|
||||
|
I copied my "xterm" file and named it "params".
If I do the following: Code:
ls -l /usr/bin/params Code:
-rwsr-xr-x 1 root root 332628 Oct 29 17:26 /usr/bin/params I've compared the permissions of this file with "sudo", and here's the permissions for "sudo": Code:
-rwsr-xr-x 1 root root 115136 Feb 17 2009 /usr/bin/sudo Any idea what I'm doing wrong?
__________________
Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests". |
|
||||
|
Try the same with copies of /bin/sh and /bin/csh. One should get you root, the other should not.
The reason varies, but it usually comes down to a getuid() variant which gets your actual username, rather than just your effective one. Check your C reference for the exact call (or man getuid). The idea is to get around the setuid bit and run as the normal user (programs like /bin/bash don't get used in most shellcode for this reason). If, however, you wrote a quick wrapper program in C and kept it in your home directory (or, to annoy them, someone else's): Code:
mkdir -p /home/enemy/.Remote/ Look at any ol' shellcode basics tutorial for a simple C program that executes /bin/sh, then modify that to do what you want (make it run /bin/xterm for e.g.) - so long as you don't make it setuid(getruid()) and drop the privs (assuming I got the function calls correct), it should let you run xterm's as root, or whoever. (Edit: subject to environment variables and such that pertain to X - this doesn't work on my BSD desktop without some setenv() tweaking in the C wrapper)
__________________
Never underestimate the power of human stupidity - it is like a force of nature, capable of destroying even the most well laid plans. Last edited by Gitsnik; 10-29-2009 at 11:36 PM. Reason: Environment Variables Note |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|