Closed grav3m1nd-byte closed 1 year ago
Looks like the certifi package recently added type hints which won't work on python2 (they haven't advertised 2 support for a few years now). Requests 2.20.0 is pulling it in as a sub-dependency.
Stale issue message
What's the problem (or question)?
Given that the normal install fails as this project is still on Python2, docker was a good option but the image build completes with errors and does not run.
Do you have an idea for a solution?
Probably the issue would be resolved by switching all the dependencies to use Python3 and the needed components listed in the setup.py, which relying on their latest versions.
How can we reproduce the issue?
Specific to the docker build:
sudo docker build -t nosqlmap .
running install_scripts running build_scripts creating build/scripts-2.7 copying and adjusting nosqlmap.py -> build/scripts-2.7 copying and adjusting nsmmongo.py -> build/scripts-2.7 copying and adjusting nsmcouch.py -> build/scripts-2.7 copying and adjusting nsmscan.py -> build/scripts-2.7 copying and adjusting nsmweb.py -> build/scripts-2.7 copying and adjusting exception.py -> build/scripts-2.7 changing mode of build/scripts-2.7/nosqlmap.py from 644 to 755 changing mode of build/scripts-2.7/nsmmongo.py from 644 to 755 changing mode of build/scripts-2.7/nsmcouch.py from 644 to 755 changing mode of build/scripts-2.7/nsmscan.py from 644 to 755 changing mode of build/scripts-2.7/nsmweb.py from 644 to 755 changing mode of build/scripts-2.7/exception.py from 644 to 755 creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/nsmmongo.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/nosqlmap.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/nsmcouch.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/exception.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/nsmscan.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts copying build/scripts-2.7/nsmweb.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/nsmmongo.py to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/nosqlmap.py to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/nsmcouch.py to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/exception.py to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/nsmscan.py to 755 changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/nsmweb.py to 755 copying NoSQLMap.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying NoSQLMap.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying NoSQLMap.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying NoSQLMap.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying NoSQLMap.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying NoSQLMap.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO creating dist creating 'dist/NoSQLMap-0.7-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it zip_safe flag not set; analyzing archive contents... removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing NoSQLMap-0.7-py2.7.egg Copying NoSQLMap-0.7-py2.7.egg to /usr/local/lib/python2.7/site-packages Adding NoSQLMap 0.7 to easy-install.pth file Installing nsmscan.py script to /usr/local/bin Installing exception.py script to /usr/local/bin Installing nosqlmap.py script to /usr/local/bin Installing nsmweb.py script to /usr/local/bin Installing nsmcouch.py script to /usr/local/bin Installing nsmmongo.py script to /usr/local/bin Installing NoSQLMap script to /usr/local/bin
Installed /usr/local/lib/python2.7/site-packages/NoSQLMap-0.7-py2.7.egg Processing dependencies for NoSQLMap==0.7 Searching for requests==2.20.0 Reading https://pypi.org/simple/requests/ Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl#sha256=a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279 Best match: requests 2.20.0 Processing requests-2.20.0-py2.py3-none-any.whl Installing requests-2.20.0-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding requests 2.20.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg Searching for pymongo==2.7.2 Reading https://pypi.org/simple/pymongo/ Downloading https://files.pythonhosted.org/packages/8e/34/4b3cd4bfe5f3bfbd89873c8e24e091a6a6510c57fedea76161530be18a61/pymongo-2.7.2.tar.gz#sha256=8fb45e3edec006f4b11580fc579bec7781a8b3201ce0abf31593f086070e51f6 Best match: pymongo 2.7.2 Processing pymongo-2.7.2.tar.gz Writing /tmp/easy_install-HehhLL/pymongo-2.7.2/setup.cfg Running pymongo-2.7.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-HehhLL/pymongo-2.7.2/egg-dist-tmp-DhWx_W unable to execute 'gcc': No such file or directory /tmp/easy_install-HehhLL/pymongo-2.7.2/setup.py:217: UserWarning:
WARNING: The bson._cbson extension module could not be compiled. No C extensions are essential for PyMongo to run, although they do result in significant speed improvements. The output above this warning shows how the compilation failed.
Please see the installation docs for solutions to build issues:
http://api.mongodb.org/python/current/installation.html
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to install GCC and/or the Python development package for your version of Python.
Debian and Ubuntu users should issue the following command:
Users of Red Hat based distributions (RHEL, CentOS, Amazon Linux, Oracle Linux, Fedora, etc.) should issue the following command:
If you are seeing this message on Microsoft Windows please install PyMongo using the MS Windows installer for your version of Python, available on pypi here:
http://pypi.python.org/pypi/pymongo/#downloads
If you are seeing this message on OSX please read the documentation here:
http://api.mongodb.org/python/current/installation.html#osx
"The output above " unable to execute 'gcc': No such file or directory /tmp/easy_install-HehhLL/pymongo-2.7.2/setup.py:217: UserWarning:
WARNING: The pymongo._cmessage extension module could not be compiled. No C extensions are essential for PyMongo to run, although they do result in significant speed improvements. The output above this warning shows how the compilation failed.
Please see the installation docs for solutions to build issues:
http://api.mongodb.org/python/current/installation.html
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to install GCC and/or the Python development package for your version of Python.
Debian and Ubuntu users should issue the following command:
Users of Red Hat based distributions (RHEL, CentOS, Amazon Linux, Oracle Linux, Fedora, etc.) should issue the following command:
If you are seeing this message on Microsoft Windows please install PyMongo using the MS Windows installer for your version of Python, available on pypi here:
http://pypi.python.org/pypi/pymongo/#downloads
If you are seeing this message on OSX please read the documentation here:
http://api.mongodb.org/python/current/installation.html#osx
"The output above " zip_safe flag not set; analyzing archive contents... command 'gcc' failed with exit status 1 command 'gcc' failed with exit status 1 Moving pymongo-2.7.2-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/site-packages Adding pymongo 2.7.2 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/pymongo-2.7.2-py2.7-linux-x86_64.egg Searching for pbkdf2==1.3 Reading https://pypi.org/simple/pbkdf2/ Downloading https://files.pythonhosted.org/packages/02/c0/6a2376ae81beb82eda645a091684c0b0becb86b972def7849ea9066e3d5e/pbkdf2-1.3.tar.gz#sha256=ac6397369f128212c43064a2b4878038dab78dab41875364554aaf2a684e6979 Best match: pbkdf2 1.3 Processing pbkdf2-1.3.tar.gz Writing /tmp/easy_install-QybOTW/pbkdf2-1.3/setup.cfg Running pbkdf2-1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QybOTW/pbkdf2-1.3/egg-dist-tmp-G3RkBQ zip_safe flag not set; analyzing archive contents... Moving pbkdf2-1.3-py2.7.egg to /usr/local/lib/python2.7/site-packages Adding pbkdf2 1.3 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/pbkdf2-1.3-py2.7.egg Searching for ipcalc==1.1.3 Reading https://pypi.org/simple/ipcalc/ Downloading https://files.pythonhosted.org/packages/15/d7/7d60a28c34d84206f3cd5730405adb57246288e5616100b217d6fe2fef66/ipcalc-1.1.3.tar.gz#sha256=3bfc52cafaa39e9c4e8478a38b21b2d62b2145d3d21a1722f1340e897656ac34 Best match: ipcalc 1.1.3 Processing ipcalc-1.1.3.tar.gz Writing /tmp/easy_install-MSk36w/ipcalc-1.1.3/setup.cfg Running ipcalc-1.1.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-MSk36w/ipcalc-1.1.3/egg-dist-tmp-zGRmzQ zip_safe flag not set; analyzing archive contents... Moving ipcalc-1.1.3-py2.7.egg to /usr/local/lib/python2.7/site-packages Adding ipcalc 1.1.3 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/ipcalc-1.1.3-py2.7.egg Searching for httplib2==0.19.0 Reading https://pypi.org/simple/httplib2/ Downloading https://files.pythonhosted.org/packages/ed/ef/f0e05d5886a9c25dea4b18be06cd7bcaddbae0168cc576f3568f9bd6a35a/httplib2-0.19.0.tar.gz#sha256=e0d428dad43c72dbce7d163b7753ffc7a39c097e6788ef10f4198db69b92f08e Best match: httplib2 0.19.0 Processing httplib2-0.19.0.tar.gz Writing /tmp/easy_install-5W_bgQ/httplib2-0.19.0/setup.cfg Running httplib2-0.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5W_bgQ/httplib2-0.19.0/egg-dist-tmp-kDNwrj warning: no previously-included files matching 'pycache' found anywhere in distribution warning: no previously-included files matching '*.py[cod]' found anywhere in distribution zip_safe flag not set; analyzing archive contents... httplib2.certs: module references file creating /usr/local/lib/python2.7/site-packages/httplib2-0.19.0-py2.7.egg Extracting httplib2-0.19.0-py2.7.egg to /usr/local/lib/python2.7/site-packages Adding httplib2 0.19.0 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/httplib2-0.19.0-py2.7.egg Searching for CouchDB==1.0 Reading https://pypi.org/simple/CouchDB/ Downloading https://files.pythonhosted.org/packages/58/8f/acef7670a97b05200f664982a33a2ae4d78e065b0201d21cd93fc844f21f/CouchDB-1.0-py2.py3-none-any.whl#sha256=a1fe6cab76be7137025785cc5dd7bd37e086c87130d8024783cb59da8aefd9a9 Best match: CouchDB 1.0 Processing CouchDB-1.0-py2.py3-none-any.whl Installing CouchDB-1.0-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding CouchDB 1.0 to easy-install.pth file Installing couchdb-dump script to /usr/local/bin Installing couchpy script to /usr/local/bin Installing couchdb-load script to /usr/local/bin Installing couchdb-replicate script to /usr/local/bin
Installed /usr/local/lib/python2.7/site-packages/CouchDB-1.0-py2.7.egg Searching for urllib3<1.25,>=1.21.1 Reading https://pypi.org/simple/urllib3/ Downloading https://files.pythonhosted.org/packages/01/11/525b02e4acc0c747de8b6ccdab376331597c569c42ea66ab0a1dbd36eca2/urllib3-1.24.3-py2.py3-none-any.whl#sha256=a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb Best match: urllib3 1.24.3 Processing urllib3-1.24.3-py2.py3-none-any.whl Installing urllib3-1.24.3-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding urllib3 1.24.3 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/urllib3-1.24.3-py2.7.egg Searching for idna<2.8,>=2.5 Reading https://pypi.org/simple/idna/ Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl#sha256=156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e Best match: idna 2.7 Processing idna-2.7-py2.py3-none-any.whl Installing idna-2.7-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding idna 2.7 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/idna-2.7-py2.7.egg Searching for chardet<3.1.0,>=3.0.2 Reading https://pypi.org/simple/chardet/ Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl#sha256=fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691 Best match: chardet 3.0.4 Processing chardet-3.0.4-py2.py3-none-any.whl Installing chardet-3.0.4-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding chardet 3.0.4 to easy-install.pth file Installing chardetect script to /usr/local/bin
Installed /usr/local/lib/python2.7/site-packages/chardet-3.0.4-py2.7.egg Searching for certifi>=2017.4.17 Reading https://pypi.org/simple/certifi/ Downloading https://files.pythonhosted.org/packages/37/f7/2b1b0ec44fdc30a3d31dfebe52226be9ddc40cd6c0f34ffc8923ba423b69/certifi-2022.12.7.tar.gz#sha256=35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 Best match: certifi 2022.12.7 Processing certifi-2022.12.7.tar.gz Writing /tmp/easy_install-BLUknw/certifi-2022.12.7/setup.cfg Running certifi-2022.12.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BLUknw/certifi-2022.12.7/egg-dist-tmp-Sn98pO /usr/local/lib/python2.7/site-packages/setuptools/dist.py:476: UserWarning: Normalizing '2022.12.07' to '2022.12.7' normalized_version, warning: no previously-included files found matching '.github/' warning: manifest_maker: MANIFEST.in, line 4: 'recursive-exclude' expects
File "build/bdist.linux-x86_64/egg/certifi/core.py", line 17 def where() -> str: ^ SyntaxError: invalid syntax
creating /usr/local/lib/python2.7/site-packages/certifi-2022.12.7-py2.7.egg Extracting certifi-2022.12.7-py2.7.egg to /usr/local/lib/python2.7/site-packages File "/usr/local/lib/python2.7/site-packages/certifi-2022.12.7-py2.7.egg/certifi/core.py", line 17 def where() -> str: ^ SyntaxError: invalid syntax
Adding certifi 2022.12.7 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/certifi-2022.12.7-py2.7.egg Searching for pyparsing<3,>=2.4.2 Reading https://pypi.org/simple/pyparsing/ Downloading https://files.pythonhosted.org/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl#sha256=ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b Best match: pyparsing 2.4.7 Processing pyparsing-2.4.7-py2.py3-none-any.whl Installing pyparsing-2.4.7-py2.py3-none-any.whl to /usr/local/lib/python2.7/site-packages Adding pyparsing 2.4.7 to easy-install.pth file
Installed /usr/local/lib/python2.7/site-packages/pyparsing-2.4.7-py2.7.egg Finished processing dependencies for NoSQLMap==0.7 Removing intermediate container c2a5e08e5211 ---> 9358086271e5 Step 8/10 : COPY entrypoint.sh /tmp/entrypoint.sh ---> 3c8456bb005a Step 9/10 : RUN chmod +x /tmp/entrypoint.sh ---> Running in 4544c95f9ad4 Removing intermediate container 4544c95f9ad4 ---> 8594dd073ad5 Step 10/10 : ENTRYPOINT ["/tmp/entrypoint.sh"] ---> Running in 9b3bc41d9027 Removing intermediate container 9b3bc41d9027 ---> 688f27e64888 Successfully built 688f27e64888 Successfully tagged nosqlmap:latest
βββ(kali πΏ kali)-[/opt/β¦/docker] ββ$ sudo docker run -t nosqlmap:latest (master|β) Traceback (most recent call last): File "nosqlmap.py", line 8, in
import nsmcouch
File "/root/NoSqlMap/nsmcouch.py", line 8, in
import requests
File "/usr/local/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg/requests/init.py", line 112, in
from . import utils
File "/usr/local/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg/requests/utils.py", line 24, in
from . import certs
File "/usr/local/lib/python2.7/site-packages/requests-2.20.0-py2.7.egg/requests/certs.py", line 15, in
from certifi import where
File "/usr/local/lib/python2.7/site-packages/certifi-2022.12.7-py2.7.egg/certifi/init.py", line 1, in
from .core import contents, where
File "/usr/local/lib/python2.7/site-packages/certifi-2022.12.7-py2.7.egg/certifi/core.py", line 17
def where() -> str:
^
SyntaxError: invalid syntax