mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-05-05 00:03:44 +03:00
Minor update
This commit is contained in:
parent
a33ee69337
commit
0f4d1e79b7
|
@ -10,4 +10,4 @@
|
||||||
# unset SQLMAP_DREI
|
# unset SQLMAP_DREI
|
||||||
# source `dirname "$0"`"/junk.sh"
|
# source `dirname "$0"`"/junk.sh"
|
||||||
|
|
||||||
for i in $(find . -iname "*.py" | grep -v __init__); do pylint --py3k $i; done
|
for i in $(find . -iname "*.py" | grep -v __init__); do timeout 10 pylint --py3k $i; done 2>&1 | grep -v -E 'absolute_import|No config file'
|
||||||
|
|
|
@ -18,7 +18,7 @@ from lib.core.enums import OS
|
||||||
from thirdparty import six
|
from thirdparty import six
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.3.5.7"
|
VERSION = "1.3.5.8"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -21,6 +21,7 @@ from lib.core.common import checkDeprecatedOptions
|
||||||
from lib.core.common import checkSystemEncoding
|
from lib.core.common import checkSystemEncoding
|
||||||
from lib.core.common import dataToStdout
|
from lib.core.common import dataToStdout
|
||||||
from lib.core.common import expandMnemonics
|
from lib.core.common import expandMnemonics
|
||||||
|
from lib.core.common import getSafeExString
|
||||||
from lib.core.common import getUnicode
|
from lib.core.common import getUnicode
|
||||||
from lib.core.compat import xrange
|
from lib.core.compat import xrange
|
||||||
from lib.core.data import cmdLineOptions
|
from lib.core.data import cmdLineOptions
|
||||||
|
@ -836,7 +837,7 @@ def cmdLineParser(argv=None):
|
||||||
for arg in shlex.split(command):
|
for arg in shlex.split(command):
|
||||||
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
argv.append(getUnicode(arg, encoding=sys.stdin.encoding))
|
||||||
except ValueError as ex:
|
except ValueError as ex:
|
||||||
raise SqlmapSyntaxException("something went wrong during command line parsing ('%s')" % ex.message)
|
raise SqlmapSyntaxException("something went wrong during command line parsing ('%s')" % getSafeExString(ex))
|
||||||
|
|
||||||
for i in xrange(len(argv)):
|
for i in xrange(len(argv)):
|
||||||
if argv[i] == "-hh":
|
if argv[i] == "-hh":
|
||||||
|
|
9
thirdparty/multipart/multipartpost.py
vendored
9
thirdparty/multipart/multipartpost.py
vendored
|
@ -26,6 +26,7 @@ import os
|
||||||
import stat
|
import stat
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from lib.core.common import getBytes
|
||||||
from lib.core.compat import choose_boundary
|
from lib.core.compat import choose_boundary
|
||||||
from lib.core.exception import SqlmapDataException
|
from lib.core.exception import SqlmapDataException
|
||||||
from thirdparty.six.moves import urllib as _urllib
|
from thirdparty.six.moves import urllib as _urllib
|
||||||
|
@ -51,7 +52,7 @@ class MultipartPostHandler(_urllib.request.BaseHandler):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for(key, value) in data.items():
|
for(key, value) in data.items():
|
||||||
if isinstance(value, file) or hasattr(value, "file") or isinstance(value, io.IOBase):
|
if hasattr(value, "fileno") or hasattr(value, "file") or isinstance(value, io.IOBase):
|
||||||
v_files.append((key, value))
|
v_files.append((key, value))
|
||||||
else:
|
else:
|
||||||
v_vars.append((key, value))
|
v_vars.append((key, value))
|
||||||
|
@ -85,7 +86,7 @@ class MultipartPostHandler(_urllib.request.BaseHandler):
|
||||||
buf += "\r\n\r\n" + value + "\r\n"
|
buf += "\r\n\r\n" + value + "\r\n"
|
||||||
|
|
||||||
for (key, fd) in files:
|
for (key, fd) in files:
|
||||||
file_size = os.fstat(fd.fileno())[stat.ST_SIZE] if isinstance(fd, file) else fd.len
|
file_size = os.fstat(fd.fileno())[stat.ST_SIZE] if hasattr(fd, "fileno") else fd.len
|
||||||
filename = fd.name.split("/")[-1] if "/" in fd.name else fd.name.split("\\")[-1]
|
filename = fd.name.split("/")[-1] if "/" in fd.name else fd.name.split("\\")[-1]
|
||||||
try:
|
try:
|
||||||
contenttype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
|
contenttype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
|
||||||
|
@ -98,8 +99,8 @@ class MultipartPostHandler(_urllib.request.BaseHandler):
|
||||||
# buf += "Content-Length: %s\r\n" % file_size
|
# buf += "Content-Length: %s\r\n" % file_size
|
||||||
fd.seek(0)
|
fd.seek(0)
|
||||||
|
|
||||||
buf = str(buf) if not isinstance(buf, unicode) else buf.encode("utf8")
|
buf = getBytes(buf)
|
||||||
buf += "\r\n%s\r\n" % fd.read()
|
buf += b"\r\n%s\r\n" % fd.read()
|
||||||
|
|
||||||
buf += "--%s--\r\n\r\n" % boundary
|
buf += "--%s--\r\n\r\n" % boundary
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user