From 6907e15a0e31c51924446b148df6c3259d5c689f Mon Sep 17 00:00:00 2001 From: akun <6awkun@gmail.com> Date: Wed, 7 Mar 2018 18:27:32 +0800 Subject: [PATCH] Refactoring for Python 3 `ws_comma` * 2to3 `ls | grep -v thirdparty` -f ws_comma --- lib/utils/hash.py | 4 ++-- plugins/dbms/access/fingerprint.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/utils/hash.py b/lib/utils/hash.py index a49866c9a..527eb1451 100644 --- a/lib/utils/hash.py +++ b/lib/utils/hash.py @@ -381,7 +381,7 @@ def unix_md5_passwd(password, salt, magic="$1$", **kwargs): ctx = password + magic + salt final = md5(password + salt + password).digest() - for pl in xrange(len(password),0,-16): + for pl in xrange(len(password), 0, -16): if pl > 16: ctx = ctx + final[:16] else: @@ -418,7 +418,7 @@ def unix_md5_passwd(password, salt, magic="$1$", **kwargs): final = md5(ctx1).digest() - hash_ = _encode64((int(ord(final[0])) << 16) | (int(ord(final[6])) << 8) | (int(ord(final[12]))),4) + hash_ = _encode64((int(ord(final[0])) << 16) | (int(ord(final[6])) << 8) | (int(ord(final[12]))), 4) hash_ = hash_ + _encode64((int(ord(final[1])) << 16) | (int(ord(final[7])) << 8) | (int(ord(final[13]))), 4) hash_ = hash_ + _encode64((int(ord(final[2])) << 16) | (int(ord(final[8])) << 8) | (int(ord(final[14]))), 4) hash_ = hash_ + _encode64((int(ord(final[3])) << 16) | (int(ord(final[9])) << 8) | (int(ord(final[15]))), 4) diff --git a/plugins/dbms/access/fingerprint.py b/plugins/dbms/access/fingerprint.py index 4b01d076d..c46247059 100644 --- a/plugins/dbms/access/fingerprint.py +++ b/plugins/dbms/access/fingerprint.py @@ -49,9 +49,9 @@ class Fingerprint(GenericFingerprint): # Microsoft Access table reference updated on 01/2010 sysTables = { "97": ("MSysModules2", "MSysAccessObjects"), - "2000" : ("!MSysModules2", "MSysAccessObjects"), - "2002-2003" : ("MSysAccessStorage", "!MSysNavPaneObjectIDs"), - "2007" : ("MSysAccessStorage", "MSysNavPaneObjectIDs"), + "2000": ("!MSysModules2", "MSysAccessObjects"), + "2002-2003": ("MSysAccessStorage", "!MSysNavPaneObjectIDs"), + "2007": ("MSysAccessStorage", "MSysNavPaneObjectIDs"), } # MSysAccessXML is not a reliable system table because it doesn't always exist # ("Access through Access", p6, should be "normally doesn't exist" instead of "is normally empty")