Skip to content

Commit d346192

Browse files
committed
Implements sqlmapproject#3940
1 parent 5168daf commit d346192

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.3.9.20"
21+
VERSION = "1.3.9.21"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

tamper/xforwardedfor.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,29 @@ def dependencies():
1616
pass
1717

1818
def randomIP():
19-
numbers = []
19+
octets = []
2020

21-
while not numbers or numbers[0] in (10, 172, 192):
22-
numbers = random.sample(xrange(1, 255), 4)
21+
while not octets or octets[0] in (10, 172, 192):
22+
octets = random.sample(xrange(1, 255), 4)
2323

24-
return '.'.join(str(_) for _ in numbers)
24+
return '.'.join(str(_) for _ in octets)
2525

2626
def tamper(payload, **kwargs):
2727
"""
28-
Append a fake HTTP header 'X-Forwarded-For'
28+
Append a fake HTTP header 'X-Forwarded-For' (and alike)
2929
"""
3030

3131
headers = kwargs.get("headers", {})
3232
headers["X-Forwarded-For"] = randomIP()
3333
headers["X-Client-Ip"] = randomIP()
3434
headers["X-Real-Ip"] = randomIP()
35+
headers["CF-Connecting-IP"] = randomIP()
36+
headers["True-Client-IP"] = randomIP()
37+
38+
# Reference: https://developer.chrome.com/multidevice/data-compression-for-isps#proxy-connection
39+
headers["Via"] = "1.1 Chrome-Compression-Proxy"
40+
41+
# Reference: https://wordpress.org/support/topic/blocked-country-gaining-access-via-cloudflare/#post-9812007
42+
headers["CF-IPCountry"] = random.sample(('GB', 'US', 'FR', 'AU', 'CA', 'NZ', 'BE', 'DK', 'FI', 'IE', 'AT', 'IT', 'LU', 'NL', 'NO', 'PT', 'SE', 'ES', 'CH'), 1)[0]
43+
3544
return payload

0 commit comments

Comments
 (0)