Skip to main content

Symlink files in my server.

Comments

7 comments

  • quizknows
    0
  • YasIT
    my webserver LiteSpeed. This post for apache!
    0
  • cPanelMichael
    Hello :) Please note the LiteSpeed web server is a third-party application that is not natively supported by cPanel. You may find more information or advice regarding their product's security directly from their support team or forums: [url=http://www.litespeedtech.com/support/forum/]LiteSpeed Support Forums Thank you.
    0
  • Felipe M.
    Hello If you have PHP 5 Handler "suphp" enabled in your server Please make file named .htaccess in your home directory with this content suPHP_ConfigPath /usr/local/lib/php.ini Or put file directly [QUOTE]echo "suPHP_ConfigPath /usr/local/lib/php.ini" > /home/.htaccess
    Hackers can't bypass your php.ini directives with this file Note: If you see abnormally symlinks in your users public_html, you can change permission of /bin/ln to chmod 700 (chmod 700 /bin/ln) Hackers can't make syminks and pass to other users or folders. Thanks
    0
  • quizknows
    Even with /bin/ln restricted they can just upload a .zip with a symlink to / in it. That offers little actual protection. Bypassing php.ini is also not hard with SuPHP. I recommend looking into seeing if cloudlinux and cagefs plays nicely with litespeed or not.
    0
  • Felipe M.
    [quote="quizknows, post: 1659431">Even with /bin/ln restricted they can just upload a .zip with a symlink to / in it. That offers little actual protection. Bypassing php.ini is also not hard with SuPHP. I recommend looking into seeing if cloudlinux and cagefs plays nicely with litespeed or not.
    Not possible bypass symlinks with rar or zip file, because permission are 700 in server. Litespeed is not secured but very fastest with php, the best way is activate cagefs with jailed shell for all users and make hardening to your server. I recommend too use [url=http://applications.cpanel.net/appcat/anti-malware-plugin-for-whm]Anti Malware Plugin for WHM or [url=http://configserver.com/cp/cxs.html]ConfigServer eXploit Scanner (cxs) and search all PHPshells or malware in your server Thanks
    0
  • quizknows
    Yes, it is possible to bypass even with ln set to 700. On your own workstation/server without restriction, make a symlink and tar it: local_computer:~$ ln -s / testlink.txt #create symlink local_computer:~$ tar -cvzpf test.tar.gz testlink.txt #add to .tar testlink.txt local_computer:~$ tar -tvzpf test.tar.gz #list tar content lrwxrwxrwx unpriv/unpriv 0 2014-06-08 00:11 testlink.txt -> / (upload as normal user to server, ftp or whatever) unpriv@server.com [~/public_html]# tar -xvzf test.tar.gz #extract tar unpriv@server.com [~/public_html]# ls -alrt #list dir -rw-r--r-- 1 unpriv unpriv 119 Jun 8 00:13 test.tar.gz lrwxrwxrwx 1 unpriv unpriv 1 Jun 8 00:14 testlink.txt -> //
    There you have it, I never used the ln binary on the server, and my normal user has a symlink to root.
    0

Please sign in to leave a comment.