Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6dbf245

Browse files
committed
More drei stuff
1 parent d465007 commit 6dbf245

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

lib/controller/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def setHandler():
7575
(DBMS.INFORMIX, INFORMIX_ALIASES, InformixMap, InformixConn),
7676
]
7777

78-
_ = max(_ if (conf.get("dbms") or Backend.getIdentifiedDbms() or kb.heuristicExtendedDbms or "").lower() in _[1] else "" for _ in items) or None
78+
_ = max(_ if (conf.get("dbms") or Backend.getIdentifiedDbms() or kb.heuristicExtendedDbms or "").lower() in _[1] else () for _ in items)
7979
if _:
8080
items.remove(_)
8181
items.insert(0, _)

lib/core/bigarray.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def _size_of(object_):
3434
if isinstance(object_, dict):
3535
retval += sum(_size_of(_) for _ in itertools.chain.from_iterable(object_.items()))
3636
elif hasattr(object_, "__iter__"):
37-
retval += sum(_size_of(_) for _ in object_)
37+
retval += sum(_size_of(_) for _ in object_ if _ != object_)
3838

3939
return retval
4040

@@ -55,7 +55,7 @@ class BigArray(list):
5555

5656
def __init__(self, items=[]):
5757
self.chunks = [[]]
58-
self.chunk_length = sys.maxint
58+
self.chunk_length = sys.maxsize
5959
self.cache = None
6060
self.filenames = set()
6161
self._os_remove = os.remove
@@ -67,7 +67,7 @@ def __init__(self, items=[]):
6767
def append(self, value):
6868
self.chunks[-1].append(value)
6969

70-
if self.chunk_length == sys.maxint:
70+
if self.chunk_length == sys.maxsize:
7171
self._size_counter += _size_of(value)
7272
if self._size_counter >= BIGARRAY_CHUNK_SIZE:
7373
self.chunk_length = len(self.chunks[-1])

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from lib.core.enums import OS
1818

1919
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
20-
VERSION = "1.3.5.0"
20+
VERSION = "1.3.5.1"
2121
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2222
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2323
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/request/connect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,9 @@ def _(value):
13491349
kb.permissionFlag = True
13501350
singleTimeWarnMessage("potential permission problems detected ('%s')" % message)
13511351

1352+
if not hasattr(headers, "headers"):
1353+
headers.headers = ["%s: %s\r\n" % (header, headers[header]) for header in headers]
1354+
13521355
if content or response:
13531356
return page, headers, code
13541357

lib/techniques/union/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def _unionPosition(comment, place, parameter, prefix, suffix, count, where=PAYLO
168168
validPayload = None
169169
vector = None
170170

171-
positions = range(0, count)
171+
positions = [_ for _ in xrange(0, count)]
172172

173173
# Unbiased approach for searching appropriate usable column
174174
random.shuffle(positions)

plugins/dbms/mssqlserver/takeover.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import binascii
99

1010
from lib.core.common import Backend
11+
from lib.core.common import getBytes
1112
from lib.core.compat import xrange
1213
from lib.core.data import logger
1314
from lib.core.exception import SqlmapUnsupportedFeatureException
@@ -67,7 +68,7 @@ def spHeapOverflow(self):
6768
raise SqlmapUnsupportedFeatureException(errMsg)
6869

6970
shellcodeChar = ""
70-
hexStr = binascii.hexlify(self.shellcodeString[:-1])
71+
hexStr = binascii.hexlify(getBytes(self.shellcodeString[:-1]))
7172

7273
for hexPair in xrange(0, len(hexStr), 2):
7374
shellcodeChar += "CHAR(0x%s)+" % hexStr[hexPair:hexPair + 2]

plugins/dbms/mysql/syntax.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
import binascii
99

10-
from lib.core.convert import utf8encode
10+
from lib.core.common import getBytes
11+
from lib.core.common import getUnicode
1112
from plugins.generic.syntax import Syntax as GenericSyntax
1213

1314
class Syntax(GenericSyntax):
@@ -19,11 +20,6 @@ def escape(expression, quote=True):
1920
"""
2021

2122
def escaper(value):
22-
retVal = None
23-
try:
24-
retVal = "0x%s" % binascii.hexlify(value)
25-
except UnicodeEncodeError:
26-
retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
27-
return retVal
23+
return "0x%s" % getUnicode(binascii.hexlify(getBytes(value)))
2824

2925
return Syntax._escape(expression, quote, escaper)

thirdparty/clientform/clientform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def isstringlike(x):
292292
def choose_boundary():
293293
"""Return a string usable as a multipart boundary."""
294294
# follow IE and firefox
295-
nonce = "".join([str(random.randint(0, sys.maxint-1)) for i in (0,1,2)])
295+
nonce = "".join([str(random.randint(0, sys.maxsize-1)) for i in (0,1,2)])
296296
return "-"*27 + nonce
297297

298298
# This cut-n-pasted MimeWriter from standard library is here so can add

0 commit comments

Comments
 (0)