codingo / NoSQLMap

Automated NoSQL database enumeration and web application exploitation tool.
GNU General Public License v3.0
2.82k stars 576 forks source link

Added exception.py to setuptools script #101

Closed ojasookert closed 4 years ago

ojasookert commented 4 years ago

After Added base exception class NoSQLMapException inside exception.py. #99, using NoSQLMap when installed with python setup.py install fails with the following log:

root@kali:~/NoSQLMap# nosqlmap.py --attack 2 --victim target-site.com --webPort 80 --uri /login --httpMethod POST --postData email,user@target-site.com,password,password --injectedParameter 1 --injectSize 0 --injectFormat 2 --savePath output.log
Traceback (most recent call last):
  File "/usr/local/bin/nosqlmap.py", line 4, in <module>
    __import__('pkg_resources').run_script('NoSQLMap==0.7', 'nosqlmap.py')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/NoSQLMap-0.7-py2.7.egg/EGG-INFO/scripts/nosqlmap.py", line 6, in <module>

ImportError: No module named exception

Without installing with python setup.py install, this command completes successfully. After some debugging it looks like the exception.py is not installed with setuptools - adding the filename to the scripts list in setup.py fixes the issue.

bbeale commented 4 years ago

Whoops, that one was me. I forgot to update setup.py before submitting the PR. Thanks for catching.