Skip to content

Commit

Permalink
Implements sqlmapproject#1207
Browse files Browse the repository at this point in the history
  • Loading branch information
stamparm committed Mar 26, 2015
1 parent 7587528 commit e3130c1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tamper/informationschemacomment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python

"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""

import re

from lib.core.enums import PRIORITY

__priority__ = PRIORITY.LOW

def tamper(payload, **kwargs):
"""
Add a comment to the end of all occurrences of (blacklisted) "information_schema" identifier
>>> tamper('SELECT table_name FROM INFORMATION_SCHEMA.TABLES')
'SELECT table_name FROM INFORMATION_SCHEMA/**/.TABLES'
"""

retVal = payload

if payload:
retVal = re.sub(r"(?i)(information_schema)\.", "\g<1>/**/.", payload)

return retVal

0 comments on commit e3130c1

Please sign in to comment.