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

Skip to content

Commit d8c62e0

Browse files
committed
Minor update
1 parent 0f4d1e7 commit d8c62e0

8 files changed

Lines changed: 23 additions & 15 deletions

File tree

extra/safe2bin/safe2bin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
SAFE_ENCODE_SLASH_REPLACEMENTS = "\t\n\r\x0b\x0c"
3535

3636
# Characters that don't need to be safe encoded
37-
SAFE_CHARS = "".join(filter(lambda _: _ not in SAFE_ENCODE_SLASH_REPLACEMENTS, string.printable.replace('\\', '')))
37+
SAFE_CHARS = "".join([_ for _ in string.printable.replace('\\', '') if _ not in SAFE_ENCODE_SLASH_REPLACEMENTS])
3838

3939
# Prefix used for hex encoded values
4040
HEX_ENCODED_PREFIX = r"\x"

extra/shutils/drei.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
# Stress test against Python3
77

8-
# export SQLMAP_DREI=1
9-
# for i in $(find . -iname "*.py" | grep -v __init__); do python3 -c 'import '`echo $i | cut -d '.' -f 2 | cut -d '/' -f 2- | sed 's/\//./g'`''; done
10-
# unset SQLMAP_DREI
11-
# source `dirname "$0"`"/junk.sh"
8+
export SQLMAP_DREI=1
9+
for i in $(find . -iname "*.py" | grep -v __init__); do python3 -c 'import '`echo $i | cut -d '.' -f 2 | cut -d '/' -f 2- | sed 's/\//./g'`''; done
10+
unset SQLMAP_DREI
11+
source `dirname "$0"`"/junk.sh"
1212

13-
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'
13+
# 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'

extra/shutils/modernize.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2006-2019 sqlmap developers (http://sqlmap.org/)
4+
# See the file 'LICENSE' for copying permission
5+
6+
# sudo pip install modernize
7+
8+
for i in $(find . -iname "*.py" | grep -v __init__); do python-modernize $i 2>&1 | grep -E '^[+-]' | grep -v range | grep -v absolute_import; done

lib/core/option.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def _(key, value):
533533
retVal = None
534534

535535
try:
536-
from _winreg import ConnectRegistry, OpenKey, QueryValueEx, HKEY_LOCAL_MACHINE
536+
from six.moves.winreg import ConnectRegistry, OpenKey, QueryValueEx, HKEY_LOCAL_MACHINE
537537
_ = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
538538
_ = OpenKey(_, key)
539539
retVal = QueryValueEx(_, value)[0]
@@ -2063,7 +2063,7 @@ def _useWizardInterface():
20632063
message = "%s data (--data) [Enter for None]: " % ((conf.method if conf.method != HTTPMETHOD.GET else conf.method) or HTTPMETHOD.POST)
20642064
conf.data = readInput(message, default=None)
20652065

2066-
if not (filter(lambda _: '=' in unicode(_), (conf.url, conf.data)) or '*' in conf.url):
2066+
if not (any('=' in _ for _ in (conf.url, conf.data)) or '*' in conf.url):
20672067
warnMsg = "no GET and/or %s parameter(s) found for testing " % ((conf.method if conf.method != HTTPMETHOD.GET else conf.method) or HTTPMETHOD.POST)
20682068
warnMsg += "(e.g. GET parameter 'id' in 'http://www.site.com/vuln.php?id=1'). "
20692069
if not conf.crawlDepth and not conf.forms:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty import six
1919

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

lib/request/httpshandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def create_sock():
5151
# Reference(s): https://docs.python.org/2/library/ssl.html#ssl.SSLContext
5252
# https://www.mnot.net/blog/2014/12/27/python_2_and_tls_sni
5353
if re.search(r"\A[\d.]+\Z", self.host) is None and kb.tlsSNI.get(self.host) is not False and not any((conf.proxy, conf.tor)) and hasattr(ssl, "SSLContext"):
54-
for protocol in filter(lambda _: _ >= ssl.PROTOCOL_TLSv1, _protocols):
54+
for protocol in [_ for _ in _protocols if _ >= ssl.PROTOCOL_TLSv1]:
5555
try:
5656
sock = create_sock()
5757
context = ssl.SSLContext(protocol)

lib/utils/hash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ def dictionaryAttack(attack_dict):
10991099

11001100
while not retVal.empty():
11011101
user, hash_, word = item = retVal.get(block=False)
1102-
attack_info = filter(lambda _: _[0][0] != user or _[0][1] != hash_, attack_info)
1102+
attack_info = [_ for _ in attack_info if _[0][0] != user or _[0][1] != hash_]
11031103
hashDBWrite(hash_, word)
11041104
results.append(item)
11051105

thirdparty/odict/ordereddict.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def popitem(self, last=True):
7373
if not self:
7474
raise KeyError('dictionary is empty')
7575
if last:
76-
key = reversed(self).next()
76+
key = next(reversed(self))
7777
else:
78-
key = iter(self).next()
78+
key = next(iter(self))
7979
value = self.pop(key)
8080
return key, value
8181

@@ -104,7 +104,7 @@ def keys(self):
104104
def __repr__(self):
105105
if not self:
106106
return '%s()' % (self.__class__.__name__,)
107-
return '%s(%r)' % (self.__class__.__name__, self.items())
107+
return '%s(%r)' % (self.__class__.__name__, list(self.items()))
108108

109109
def copy(self):
110110
return self.__class__(self)
@@ -127,4 +127,4 @@ def __eq__(self, other):
127127
return dict.__eq__(self, other)
128128

129129
def __ne__(self, other):
130-
return not self == other
130+
return not self == other

0 commit comments

Comments
 (0)