0

Does anyone know how to hack dvwa(http://www.dvwa.co.uk) via submitting a form input like ../../../../../etc/passwd to expose the /etc/passwd of a given server?

Is there a endpoint to hit for this?

Thanks

JShee
  • 1

1 Answers1

1
<?php

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
     $file=$_POST['filename'];
include($file);
}?>
    <html>
    <title>test</title>
    <head>
    </head>
    <body>
    <form method="post" action="index.php">
    <p>filename<input type="text" name="filename"><p>
    </form>
    </body>
    </html>

This is usually the vulnerable back end code for Local file inclusion.If you intercept the request and change the filename parameter you can read data from the victim server.This code can also result in remote file inclusion if allow_url_include is turned on.

yeah_well
  • 3,699
  • 1
  • 13
  • 30