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

Skip to content

Commit 10097dd

Browse files
committed
Fixes #2253
1 parent f4e36fc commit 10097dd

4 files changed

Lines changed: 19 additions & 14 deletions

File tree

lib/core/convert.py

100644100755
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
"""
77

88
try:
9-
import cPickle as pickle
9+
import cPickle as pickle
1010
except:
11-
import pickle
11+
import pickle
12+
finally:
13+
import pickle as picklePy
1214

1315
import base64
1416
import json
@@ -45,7 +47,7 @@ def base64pickle(value):
4547
Serializes (with pickle) and encodes to Base64 format supplied (binary) value
4648
4749
>>> base64pickle('foobar')
48-
'gAJVBmZvb2JhcnEALg=='
50+
'gAJVBmZvb2JhcnEBLg=='
4951
"""
5052

5153
retVal = None
@@ -64,11 +66,11 @@ def base64pickle(value):
6466

6567
return retVal
6668

67-
def base64unpickle(value):
69+
def base64unpickle(value, unsafe=False):
6870
"""
6971
Decodes value from Base64 to plain format and deserializes (with pickle) its content
7072
71-
>>> base64unpickle('gAJVBmZvb2JhcnEALg==')
73+
>>> base64unpickle('gAJVBmZvb2JhcnEBLg==')
7274
'foobar'
7375
"""
7476

@@ -82,9 +84,12 @@ def _(self):
8284
self.load_reduce()
8385

8486
def loads(str):
85-
file = StringIO.StringIO(str)
86-
unpickler = pickle.Unpickler(file)
87-
unpickler.dispatch[pickle.REDUCE] = _
87+
f = StringIO.StringIO(str)
88+
if unsafe:
89+
unpickler = picklePy.Unpickler(f)
90+
unpickler.dispatch[pickle.REDUCE] = _
91+
else:
92+
unpickler = pickle.Unpickler(f)
8893
return unpickler.load()
8994

9095
try:

lib/core/option.py

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,7 @@ def _mergeOptions(inputOptions, overrideOptions):
22222222

22232223
if inputOptions.pickledOptions:
22242224
try:
2225-
inputOptions = base64unpickle(inputOptions.pickledOptions)
2225+
inputOptions = base64unpickle(inputOptions.pickledOptions, unsafe=True)
22262226
if type(inputOptions) == dict:
22272227
inputOptions = AttribDict(inputOptions)
22282228
_normalizeOptions(inputOptions)

lib/core/settings.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.enums import OS
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.10.59"
22+
VERSION = "1.0.10.60"
2323
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2424
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2525
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
@@ -551,7 +551,7 @@
551551
HASHDB_END_TRANSACTION_RETRIES = 3
552552

553553
# Unique milestone value used for forced deprecation of old HashDB values (e.g. when changing hash/pickle mechanism)
554-
HASHDB_MILESTONE_VALUE = "BkfRWrtCYK" # python -c 'import random, string; print "".join(random.sample(string.ascii_letters, 10))'
554+
HASHDB_MILESTONE_VALUE = "dPHoJRQYvs" # python -c 'import random, string; print "".join(random.sample(string.ascii_letters, 10))'
555555

556556
# Warn user of possible delay due to large page dump in full UNION query injections
557557
LARGE_OUTPUT_THRESHOLD = 1024 ** 2

txt/checksum.md5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ cc9c82cfffd8ee9b25ba3af6284f057e lib/controller/__init__.py
2727
04f16204c899438dc7599a9a8426bfee lib/core/agent.py
2828
eb0bd28b0bd9fbf67dcc3119116df377 lib/core/bigarray.py
2929
136246c879e7a15309ed892ea4c1c3eb lib/core/common.py
30-
7793cad97d18e482345bdc0b12315d96 lib/core/convert.py
30+
7a23d2365f7de1a7d20d065a31c04d49 lib/core/convert.py
3131
e77cca1cb063016f71f6e6bdebf4ec73 lib/core/data.py
3232
1d042f0bc0557d3fd564ea5a46deb77e lib/core/datatype.py
3333
e4ca0fd47f20cf7ba6a5f5cbf980073c lib/core/decorators.py
@@ -39,13 +39,13 @@ e4aec2b11c1ad6039d0c3dbbfbc5eb1a lib/core/exception.py
3939
cc9c82cfffd8ee9b25ba3af6284f057e lib/core/__init__.py
4040
91c514013daa796e2cdd940389354eac lib/core/log.py
4141
d027df65e7cbb99758daf77aaa6ab61c lib/core/optiondict.py
42-
a9daee091e2e7ed05085603741fe8af4 lib/core/option.py
42+
6a67d7d1e09c0630df77e55d78cbff13 lib/core/option.py
4343
7af487340c138f7b5dbd443161cbb428 lib/core/profiling.py
4444
e60456db5380840a586654344003d4e6 lib/core/readlineng.py
4545
5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py
4646
99a2b496b9d5b546b335653ca801153f lib/core/revision.py
4747
7c15dd2777af4dac2c89cab6df17462e lib/core/session.py
48-
8f72331b896fb1c0fe3760b85ab0e9af lib/core/settings.py
48+
a69157619025ede338abb16f5e519519 lib/core/settings.py
4949
7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py
5050
23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py
5151
c3ace7874a536d801f308cf1fd03df99 lib/core/target.py

0 commit comments

Comments
 (0)