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

Skip to content

Commit 14186d3

Browse files
committed
Dumping checksum.md5 (The king is dead, long live the king)
1 parent 8de2700 commit 14186d3

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

lib/core/common.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,7 @@ def setPaths(rootPath):
12771277
paths.SQLMAP_EXTRAS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "extra")
12781278
paths.SQLMAP_PROCS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "procs")
12791279
paths.SQLMAP_SHELL_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "shell")
1280+
paths.SQLMAP_SETTINGS_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "lib", "core", "settings.py")
12801281
paths.SQLMAP_TAMPER_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "tamper")
12811282
paths.SQLMAP_WAF_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "waf")
12821283
paths.SQLMAP_TXT_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "txt")
@@ -1308,7 +1309,6 @@ def setPaths(rootPath):
13081309
paths.GITHUB_HISTORY = os.path.join(paths.SQLMAP_HISTORY_PATH, "github.hst")
13091310

13101311
# sqlmap files
1311-
paths.CHECKSUM_MD5 = os.path.join(paths.SQLMAP_TXT_PATH, "checksum.md5")
13121312
paths.COMMON_COLUMNS = os.path.join(paths.SQLMAP_TXT_PATH, "common-columns.txt")
13131313
paths.COMMON_TABLES = os.path.join(paths.SQLMAP_TXT_PATH, "common-tables.txt")
13141314
paths.COMMON_OUTPUTS = os.path.join(paths.SQLMAP_TXT_PATH, 'common-outputs.txt')
@@ -1327,7 +1327,7 @@ def setPaths(rootPath):
13271327
paths.PGSQL_XML = os.path.join(paths.SQLMAP_XML_BANNER_PATH, "postgresql.xml")
13281328

13291329
for path in paths.values():
1330-
if any(path.endswith(_) for _ in (".md5", ".txt", ".xml", ".zip")):
1330+
if any(path.endswith(_) for _ in (".txt", ".xml", ".zip")):
13311331
checkFile(path)
13321332

13331333
def weAreFrozen():
@@ -3394,15 +3394,14 @@ def checkIntegrity():
33943394

33953395
retVal = True
33963396

3397-
if os.path.isfile(paths.CHECKSUM_MD5):
3398-
for checksum, _ in (re.split(r'\s+', _) for _ in getFileItems(paths.CHECKSUM_MD5)):
3399-
path = os.path.normpath(os.path.join(paths.SQLMAP_ROOT_PATH, _))
3400-
if not os.path.isfile(path):
3401-
logger.error("missing file detected '%s'" % path)
3402-
retVal = False
3403-
elif md5File(path) != checksum:
3404-
logger.error("wrong checksum of file '%s' detected" % path)
3405-
retVal = False
3397+
baseTime = os.path.getmtime(paths.SQLMAP_SETTINGS_PATH)
3398+
for root, dirnames, filenames in os.walk(paths.SQLMAP_ROOT_PATH):
3399+
for filename in filenames:
3400+
if re.search(r"(\.py|\.xml|_)\Z", filename):
3401+
filepath = os.path.join(root, filename)
3402+
if os.path.getmtime(filepath) > baseTime:
3403+
logger.error("wrong modification time of '%s'" % filepath)
3404+
retVal = False
34063405

34073406
return retVal
34083407

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
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.3.3.38"
22+
VERSION = "1.3.3.39"
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)

txt/checksum.md5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ c1da277517c7ec4c23e953a51b51e203 lib/controller/handler.py
3030
fb6be55d21a70765e35549af2484f762 lib/controller/__init__.py
3131
ed7874be0d2d3802f3d20184f2b280d5 lib/core/agent.py
3232
a932126e7d80e545c5d44af178d0bc0c lib/core/bigarray.py
33-
223a6eb9dab49bbc3f322235b0f76eeb lib/core/common.py
33+
b9ba702c5af857c0188104c9fbd5d56b lib/core/common.py
3434
de8d27ae6241163ff9e97aa9e7c51a18 lib/core/convert.py
3535
abcb1121eb56d3401839d14e8ed06b6e lib/core/data.py
3636
f89512ef3ebea85611c5dde6c891b657 lib/core/datatype.py
@@ -50,7 +50,7 @@ d5ef43fe3cdd6c2602d7db45651f9ceb lib/core/readlineng.py
5050
7d8a22c582ad201f65b73225e4456170 lib/core/replication.py
5151
3179d34f371e0295dd4604568fb30bcd lib/core/revision.py
5252
d6269c55789f78cf707e09a0f5b45443 lib/core/session.py
53-
c62a4d131f4a69549b277ab49e712075 lib/core/settings.py
53+
e785996e0f9edd8e309094048dc40d05 lib/core/settings.py
5454
4483b4a5b601d8f1c4281071dff21ecc lib/core/shell.py
5555
10fd19b0716ed261e6d04f311f6f527c lib/core/subprocessng.py
5656
10d7e4f7ba2502cce5cf69223c52eddc lib/core/target.py

0 commit comments

Comments
 (0)