|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
a question for the pro's |
|
Posted: Tue Aug 01, 2006 4:18 pm |
|
|
Zipper_ |
Active user |
|
|
Joined: Aug 03, 2005 |
Posts: 29 |
|
|
|
|
|
|
|
gbar asked a question in one of his forums posts regarding file chmod of dir's such as /,/home,/home/cpanel etc in his question he asked if it were possible to maybe change it via c99sh in my opinion and knowledge of c99sh i wouldnt think that is possible although i am very much interested in the idea of maybe remotley injecting a command via shell maybe to alter these value's so the dir/s can become usefull does anyone with a little more linux/user privledge knowledge be able to enlighten us somewhat on this matter |
|
|
|
|
|
|
|
|
Posted: Wed Aug 02, 2006 11:52 am |
|
|
Heintz |
Valuable expert |
|
|
Joined: Jun 12, 2004 |
Posts: 88 |
Location: Estonia/Sweden |
|
|
|
|
|
|
if apache runs as a high privileged user like root and php is badly configured then yes. 'whoami' shell cmd to find out what user you are.
anyway i took a look at the c99sh source and its half-lie to say it 'bypasses' safe mode. to do that it would have to exploit the php binary and gain control over it, and it does not do that. seems to me its just a form-based comfortable interface to the 'exec' functions to run cmds, and to make db queries and move files which you are privileged to do etc.
anyway on correctly configured machine the 'exec' functions are disabled or at least the safe mode exec dir is not writable etc. thus c99sh doesnt help you there, So a simple php interface . shure its good to have one around once you're running own php code but not to expect that it does anything magical like bypass all privileges known to common sense. |
|
_________________ AT 14:00 /EVERY:1 DHTTP /oindex.php www.waraxe.us:80 | FIND "SA#037" 1>Nul 2>&1 & IF ERRORLEVEL 0 "c:program filesApache.exe stop & DSAY alarmaaa!" |
|
|
|
|
|
thought asmuvh |
|
Posted: Wed Aug 02, 2006 12:30 pm |
|
|
Zipper_ |
Active user |
|
|
Joined: Aug 03, 2005 |
Posts: 29 |
|
|
|
|
|
|
|
probably just a marketing scam lol when i tried to view / it wouldnt let me so i didnt think it really worked that great thanks for your reply heintz |
|
|
|
|
|
|
|
|
Posted: Wed Aug 02, 2006 12:53 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
First of all, if "safe_mode" is enabled, then all the shell access functions in php will be disabled:
http://ee2.php.net/manual/en/features.safe-mode.functions.php
Only function, that can be used in some degree for shell access,
seems to be "popen()".
Now, there are many php security bugs disovered in older php versions, which will help to abuse safe_mode restricions. So, if it is OLDER php version, then MAYBE safe_mode can be fooled. But if server has newer php version installed, then I dont believe in miracles (like c99 shell) - if there is some clever srcipt to safe_mode bypass, then it MUST to be yet unpublished php security hole and it will be patched soon.
So, safe_mode can be real pain in the a$$ for attacker
Now let's assume, that safe_mode is off or attacker found another way to shell access (for example through cgi/pl scripts). Then of course attacker will have minimal permissions level in server, if the box is configured properly. "Whoami" will show "nobody" or "apache" ...
What next then?? Simple - try to use local root exploits -
IF you can upload files to server and write them to some directory (like in "/tmp" for example) and if you can use shell commands for c compilation, then jjust upload some root exploits, written in "c" language and try to get r00t! If you can't access c compiler, then find out exact version of the server operating system and try to use precompiled exploits from your own computer, using same op system/c compiler.
Final words - typical steps in webserver hacking:
1. finding way to abuse php/pl/cgi/py/ect scripts to do the thing, attacker need. For defacement or just website destruction this step can be enough.
Example - "drop www_database" in sql injection can devastate all the website, if sql user permissions are too high.
2. finding way to get shell access with "nobody/apache" privilege.
3. using local root exlpoit to get r00t shell access.
4. cleaning logs and wiping all other traces.
5. installing backdoors/rootkits
6. try to use sniffer and escalate attack foothold in compromised system |
|
|
|
|
|
|
dang |
|
Posted: Fri Aug 04, 2006 2:45 pm |
|
|
Zipper_ |
Active user |
|
|
Joined: Aug 03, 2005 |
Posts: 29 |
|
|
|
|
|
|
|
thats some scarey shit id hate to be the one on the other end of your temper (laughs) id say i need a little more knowledge in the field of root kits and local root exploits as i havent dabbled into that yet i try most of my exploits on (booter sites) people whom make websites to host (booters) that disconnect innocent people from chat via flooding thier im's with malicious packets sent via server to fool yahoo into rebooting etc they all claim to be leet but just boot innocent people and make the same style sites thiers about 100 odd booter sites all doing hosting and looking the same ) but thats enuff aabout them its late anf thanks waraxe that made things a little clearer |
|
|
|
|
Posted: Sat Aug 05, 2006 8:59 am |
|
|
gbar |
Regular user |
|
|
Joined: Jan 20, 2006 |
Posts: 9 |
|
|
|
|
|
|
|
sorry zipper, never got around to pm-ing anyone to ask
thanks for doing it for me! |
|
|
|
|
|
np.... |
|
Posted: Sat Aug 05, 2006 12:19 pm |
|
|
Zipper_ |
Active user |
|
|
Joined: Aug 03, 2005 |
Posts: 29 |
|
|
|
|
|
|
|
i was very much interested in the answer anyways |
|
|
|
|
www.waraxe.us Forum Index -> All other security holes
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|