Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sqlmapproject
GitHub Repository: sqlmapproject/sqlmap
Path: blob/master/lib/utils/versioncheck.py
2989 views
1
#!/usr/bin/env python
2
3
"""
4
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org)
5
See the file 'LICENSE' for copying permission
6
"""
7
8
import sys
9
import time
10
11
PYVERSION = sys.version.split()[0]
12
13
if PYVERSION < "2.6":
14
sys.exit("[%s] [CRITICAL] incompatible Python version detected ('%s'). To successfully run sqlmap you'll have to use version 2.6, 2.7 or 3.x (visit 'https://www.python.org/downloads/')" % (time.strftime("%X"), PYVERSION))
15
16
errors = []
17
extensions = ("bz2", "gzip", "pyexpat", "ssl", "sqlite3", "zlib")
18
for _ in extensions:
19
try:
20
__import__(_)
21
except ImportError:
22
errors.append(_)
23
24
if errors:
25
errMsg = "[%s] [CRITICAL] missing one or more core extensions (%s) " % (time.strftime("%X"), ", ".join("'%s'" % _ for _ in errors))
26
errMsg += "most likely because current version of Python has been "
27
errMsg += "built without appropriate dev packages"
28
sys.exit(errMsg)
29
30