forked from m1lw0rm/xWAF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
31 lines (30 loc) · 802 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require('xwaf.php'); // Before all your code starts.
$xWAF = new xWAF();
$xWAF->start();
// Done, Protection enabled.
?>
<title>xWAF Test</title>
<div align="center">
<?php
// This is optional
if (isset($_POST['csrf'])) {
// Aright! Form Requested.
if ($xWAF->verifyCSRF($_POST['csrf'])) {
echo "Form Validation Completed without Errors or Vulns!<br><br><br>";
$Post = print_r($_POST);
echo "<code>". $Post ."</code>";
} else {
echo "Invalid CSRF Token!";
}
}
// This is optional
?>
<form method="POST">
Sample Input: <input type="text" name="someinputname" value="Vuln me">
<br>
CSRF: <input type="text" name="csrf" value="<?php echo $xWAF->getCSRF(); ?>">
<br>
<button type="submit">Submit Form POST</button>
</form>
</div>