mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-20 18:54:02 +00:00
Converted from DOS format (\n\r to \n only)
This commit is contained in:
parent
7dcfcca87f
commit
6a71629575
15 changed files with 1135 additions and 1135 deletions
|
|
@ -1,46 +1,46 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.enums import PRIORITY
|
||||
|
||||
__priority__ = PRIORITY.LOW
|
||||
|
||||
def tamper(value):
|
||||
"""
|
||||
Replaces ' ' with '/**/'
|
||||
Example: 'SELECT id FROM users' becomes 'SELECT/**/id/**/FROM/**/users'
|
||||
"""
|
||||
|
||||
retVal = value
|
||||
|
||||
if value:
|
||||
retVal = ""
|
||||
quote, doublequote, firstspace = False, False, False
|
||||
|
||||
for i in xrange(len(value)):
|
||||
if not firstspace:
|
||||
if value[i].isspace():
|
||||
firstspace = True
|
||||
retVal += "/**/"
|
||||
continue
|
||||
|
||||
elif value[i] == '\'':
|
||||
quote = not quote
|
||||
|
||||
elif value[i] == '"':
|
||||
doublequote = not doublequote
|
||||
|
||||
elif value[i]==" " and not doublequote and not quote:
|
||||
retVal += "/**/"
|
||||
continue
|
||||
|
||||
retVal += value[i]
|
||||
|
||||
return retVal
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
$Id$
|
||||
|
||||
Copyright (c) 2006-2010 sqlmap developers (http://sqlmap.sourceforge.net/)
|
||||
See the file 'doc/COPYING' for copying permission
|
||||
"""
|
||||
|
||||
from lib.core.enums import PRIORITY
|
||||
|
||||
__priority__ = PRIORITY.LOW
|
||||
|
||||
def tamper(value):
|
||||
"""
|
||||
Replaces ' ' with '/**/'
|
||||
Example: 'SELECT id FROM users' becomes 'SELECT/**/id/**/FROM/**/users'
|
||||
"""
|
||||
|
||||
retVal = value
|
||||
|
||||
if value:
|
||||
retVal = ""
|
||||
quote, doublequote, firstspace = False, False, False
|
||||
|
||||
for i in xrange(len(value)):
|
||||
if not firstspace:
|
||||
if value[i].isspace():
|
||||
firstspace = True
|
||||
retVal += "/**/"
|
||||
continue
|
||||
|
||||
elif value[i] == '\'':
|
||||
quote = not quote
|
||||
|
||||
elif value[i] == '"':
|
||||
doublequote = not doublequote
|
||||
|
||||
elif value[i]==" " and not doublequote and not quote:
|
||||
retVal += "/**/"
|
||||
continue
|
||||
|
||||
retVal += value[i]
|
||||
|
||||
return retVal
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue