sqlmap/tamper/concat2concatws.py

37 lines
766 B
Python
Raw Normal View History

2013-11-09 03:23:34 +04:00
#!/usr/bin/env python
"""
2015-01-06 17:02:16 +03:00
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
2013-11-09 03:23:34 +04:00
See the file 'doc/COPYING' for copying permission
"""
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.HIGHEST
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Replaces instances like 'CONCAT(A, B)' with 'CONCAT_WS(MID(CHAR(0), 0, 0), A, B)'
Requirement:
* MySQL
Tested against:
* MySQL 5.0
Notes:
* Useful to bypass very weak and bespoke web application firewalls
that filter the CONCAT() function
>>> tamper('CONCAT(1,2)')
'CONCAT_WS(MID(CHAR(0),0,0),1,2)'
"""
if payload:
payload = payload.replace("CONCAT(", "CONCAT_WS(MID(CHAR(0),0,0),")
return payload