mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-04-25 11:23:44 +03:00
minor cosmetics
This commit is contained in:
parent
bd3a791f23
commit
2b476e078c
|
@ -15,6 +15,7 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import urllib2
|
import urllib2
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
|
@ -534,14 +535,17 @@ def __setTamperingFunctions():
|
||||||
"""
|
"""
|
||||||
if conf.tamper:
|
if conf.tamper:
|
||||||
kb.tamperFunctions = []
|
kb.tamperFunctions = []
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
|
||||||
for file in conf.tamper.split(';'):
|
for file in conf.tamper.split(';'):
|
||||||
if not file:
|
if not file:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
elif not os.path.exists(file):
|
elif not os.path.exists(file):
|
||||||
errMsg = "missing tampering module file '%s'" % file
|
errMsg = "missing tampering module file '%s'" % file
|
||||||
raise sqlmapFilePathException, errMsg
|
raise sqlmapFilePathException, errMsg
|
||||||
|
|
||||||
elif os.path.splitext(file)[1] != '.py':
|
elif os.path.splitext(file)[1] != '.py':
|
||||||
errMsg = "tampering module file should have an extension '.py'"
|
errMsg = "tampering module file should have an extension '.py'"
|
||||||
raise sqlmapSyntaxException, errMsg
|
raise sqlmapSyntaxException, errMsg
|
||||||
|
@ -559,17 +563,19 @@ def __setTamperingFunctions():
|
||||||
|
|
||||||
if dirname not in sys.path:
|
if dirname not in sys.path:
|
||||||
sys.path.insert(0, dirname)
|
sys.path.insert(0, dirname)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
module = __import__(filename[:-3])
|
module = __import__(filename[:-3])
|
||||||
except ImportError, msg:
|
except ImportError, msg:
|
||||||
raise sqlmapSyntaxException, "can't import module file '%s' (%s)" % (file, msg)
|
raise sqlmapSyntaxException, "can't import module file '%s' (%s)" % (file, msg)
|
||||||
|
|
||||||
found = False
|
found = False
|
||||||
for name, function in inspect.getmembers(module, inspect.isfunction):
|
for name, function in inspect.getmembers(module, inspect.isfunction):
|
||||||
if name=="tamper" and function.func_code.co_argcount == 2:
|
if name=="tamper" and function.func_code.co_argcount == 2:
|
||||||
kb.tamperFunctions.append(function)
|
kb.tamperFunctions.append(function)
|
||||||
found = True
|
found = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
raise sqlmapGenericException, "missing function 'tamper(place, value)' in tampering module '%s'" % filename
|
raise sqlmapGenericException, "missing function 'tamper(place, value)' in tampering module '%s'" % filename
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user