├── LICENSE.md
├── README.md
├── test.php
└── xwaf.php
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Alemalakra ✓
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # xWAF - Web Application Firewall
2 | Original Free Web Application Firewall, Open-Source.
3 |
4 | # Features
5 |
6 | - [x] XSS Vulns Fixed.
7 | - [x] SQL Injection Fixed.
8 | - [x] Anti-Cookie-Steal Method.
9 | - [x] HTML Malicious Code's Vulns Fixed.
10 | - [x] CSRF Easy to use, and validation.
11 | - [x] Block HTML Upgraded.
12 | - [x] Lightweight.
13 | - [x] Array Support, All Bypass fixed.
14 | - [x] Advanced Bot validation, Browser Validation.
15 | - [x] Most Poc's SQLi and XSS.
16 | - [x] Security upgraded.
17 | - [x] Errors supression.
18 | - [x] Cloudflare and BlazingFast Support.
19 |
20 | # Sample Usage
21 | ```php
22 | // Before all your code starts.
23 | require('xwaf.php');
24 | $xWAF = new xWAF();
25 | $xWAF->start();
26 | // Your code below.
27 | ```
28 | # Advanced Usage
29 | ```php
30 | // Before of all your CODE.
31 | require('xwaf.php');
32 | $xWAF = new xWAF();
33 | // Cloudflare Mode [Optional]
34 | $xWAF->useCloudflare();
35 | // BlazingFast Mode [Optional]
36 | $xWAF->useBlazingfast();
37 | // Use Own IP Header [Optional]
38 | $xWAF->customIPHeader('IP-Header');
39 | // Anti-Cookie-Steal Method [Optional]
40 | $xWAF->antiCookieSteal('username'); // For trigger if on PHPSESSID is logged.
41 |
42 | // Check separated types.
43 | $xWAF->checkGET();
44 | $xWAF->checkPOST();
45 | $xWAF->checkCOOKIE();
46 | // Your code below.
47 | ```
48 | # CSRF Validation Example
49 | Please read test.php
50 |
51 | # Requirements
52 |
53 | - [x] Min: PHP5.3 (With common functions)
54 |
--------------------------------------------------------------------------------
/test.php:
--------------------------------------------------------------------------------
1 | start();
5 | // Done, Protection enabled.
6 | ?>
7 |
xWAF Test
8 |
9 |
10 | verifyCSRF($_POST['csrf'])) {
15 | echo "Form Validation Completed without Errors or Vulns!
If you think this block is an error please contact firewall developer and make sure to include the block details (displayed in the box below), so we can assist you in troubleshooting the issue.