codingo / VHostScan

A virtual host scanner that performs reverse lookups, can be used with pivot tools, detect catch-all scenarios, work around wildcards, aliases and dynamic default pages.
GNU General Public License v3.0
1.19k stars 231 forks source link

ImportError: cannot import name parse_http_list #90

Closed ehsandeep closed 6 years ago

ehsandeep commented 6 years ago

What's the problem (or question)?

After git clone and successful installation of all the requirements getting following error.

What are the running context details?

root@vps:~/VHostScan/# VHostScan
Traceback (most recent call last):
  File "/usr/local/bin/VHostScan", line 11, in <module>
    load_entry_point('VHostScan==1.21', 'console_scripts', 'VHostScan')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2324, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python2.7/dist-packages/VHostScan-1.21-py2.7.egg/VHostScan/VHostScan.py", line 8, in <module>
    from .lib.core.virtual_host_scanner import *
  File "/usr/local/lib/python2.7/dist-packages/VHostScan-1.21-py2.7.egg/VHostScan/lib/core/virtual_host_scanner.py", line 4, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests-2.10.0-py2.7.egg/requests/__init__.py", line 64, in <module>
    from . import utils
  File "/usr/local/lib/python2.7/dist-packages/requests-2.10.0-py2.7.egg/requests/utils.py", line 24, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/usr/local/lib/python2.7/dist-packages/requests-2.10.0-py2.7.egg/requests/compat.py", line 38, in <module>
    from urllib2 import parse_http_list
codingo commented 6 years ago

Hi @madaratech, I'm assuming you haven't run:

$ python setup.py install

This has properly managed dependencies so you can't run it out of the folder as shown above.

codingo commented 6 years ago

Closing this as I believe it's a known issue with packages of this nature. Feel free to re-open if setup.py doesn't properly add everything to your path.

ehsandeep commented 6 years ago

Hey @codingo,

No, As I said I'm facing this error after installing the dependencies, using python setup.py install and here is the output of that.

root@vps:~/VHostScan# python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to VHostScan.egg-info/requires.txt
writing VHostScan.egg-info/PKG-INFO
writing top-level names to VHostScan.egg-info/top_level.txt
writing dependency_links to VHostScan.egg-info/dependency_links.txt
writing entry points to VHostScan.egg-info/entry_points.txt
reading manifest file 'VHostScan.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'VHostScan.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/tests
creating build/bdist.linux-x86_64/egg/tests/helpers
copying build/lib.linux-x86_64-2.7/tests/helpers/__init__.py -> build/bdist.linux-x86_64/egg/tests/helpers
copying build/lib.linux-x86_64-2.7/tests/helpers/test_file_helper.py -> build/bdist.linux-x86_64/egg/tests/helpers
copying build/lib.linux-x86_64-2.7/tests/helpers/test_wordlist_helper.py -> build/bdist.linux-x86_64/egg/tests/helpers
copying build/lib.linux-x86_64-2.7/tests/__init__.py -> build/bdist.linux-x86_64/egg/tests
copying build/lib.linux-x86_64-2.7/tests/test_input.py -> build/bdist.linux-x86_64/egg/tests
copying build/lib.linux-x86_64-2.7/tests/conftest.py -> build/bdist.linux-x86_64/egg/tests
creating build/bdist.linux-x86_64/egg/VHostScan
copying build/lib.linux-x86_64-2.7/VHostScan/__init__.py -> build/bdist.linux-x86_64/egg/VHostScan
creating build/bdist.linux-x86_64/egg/VHostScan/wordlists
copying build/lib.linux-x86_64-2.7/VHostScan/wordlists/hackthebox.txt -> build/bdist.linux-x86_64/egg/VHostScan/wordlists
copying build/lib.linux-x86_64-2.7/VHostScan/wordlists/simple.txt -> build/bdist.linux-x86_64/egg/VHostScan/wordlists
copying build/lib.linux-x86_64-2.7/VHostScan/wordlists/virtual-host-scanning.txt -> build/bdist.linux-x86_64/egg/VHostScan/wordlists
copying build/lib.linux-x86_64-2.7/VHostScan/wordlists/testing.txt -> build/bdist.linux-x86_64/egg/VHostScan/wordlists
copying build/lib.linux-x86_64-2.7/VHostScan/VHostScan.py -> build/bdist.linux-x86_64/egg/VHostScan
creating build/bdist.linux-x86_64/egg/VHostScan/lib
creating build/bdist.linux-x86_64/egg/VHostScan/lib/helpers
copying build/lib.linux-x86_64-2.7/VHostScan/lib/helpers/__init__.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/helpers
copying build/lib.linux-x86_64-2.7/VHostScan/lib/helpers/file_helper.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/helpers
copying build/lib.linux-x86_64-2.7/VHostScan/lib/helpers/wordlist_helper.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/helpers
copying build/lib.linux-x86_64-2.7/VHostScan/lib/helpers/output_helper.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/helpers
copying build/lib.linux-x86_64-2.7/VHostScan/lib/__init__.py -> build/bdist.linux-x86_64/egg/VHostScan/lib
copying build/lib.linux-x86_64-2.7/VHostScan/lib/ua-random-list.txt -> build/bdist.linux-x86_64/egg/VHostScan/lib
creating build/bdist.linux-x86_64/egg/VHostScan/lib/core
copying build/lib.linux-x86_64-2.7/VHostScan/lib/core/__init__.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/core
copying build/lib.linux-x86_64-2.7/VHostScan/lib/core/virtual_host_scanner.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/core
copying build/lib.linux-x86_64-2.7/VHostScan/lib/core/__version__.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/core
copying build/lib.linux-x86_64-2.7/VHostScan/lib/core/discovered_host.py -> build/bdist.linux-x86_64/egg/VHostScan/lib/core
copying build/lib.linux-x86_64-2.7/VHostScan/lib/input.py -> build/bdist.linux-x86_64/egg/VHostScan/lib
byte-compiling build/bdist.linux-x86_64/egg/tests/helpers/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/tests/helpers/test_file_helper.py to test_file_helper.pyc
byte-compiling build/bdist.linux-x86_64/egg/tests/helpers/test_wordlist_helper.py to test_wordlist_helper.pyc
byte-compiling build/bdist.linux-x86_64/egg/tests/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/tests/test_input.py to test_input.pyc
byte-compiling build/bdist.linux-x86_64/egg/tests/conftest.py to conftest.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/VHostScan.py to VHostScan.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/helpers/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/helpers/file_helper.py to file_helper.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/helpers/wordlist_helper.py to wordlist_helper.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/helpers/output_helper.py to output_helper.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/core/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/core/virtual_host_scanner.py to virtual_host_scanner.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/core/__version__.py to __version__.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/core/discovered_host.py to discovered_host.pyc
byte-compiling build/bdist.linux-x86_64/egg/VHostScan/lib/input.py to input.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying VHostScan.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
tests.conftest: module references __file__
creating 'dist/VHostScan-1.21-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing VHostScan-1.21-py2.7.egg
removing '/usr/local/lib/python2.7/dist-packages/VHostScan-1.21-py2.7.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/VHostScan-1.21-py2.7.egg
Extracting VHostScan-1.21-py2.7.egg to /usr/local/lib/python2.7/dist-packages
VHostScan 1.21 is already the active version in easy-install.pth
Installing VHostScan script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/VHostScan-1.21-py2.7.egg
Processing dependencies for VHostScan==1.21
Searching for urllib3==1.20
Best match: urllib3 1.20
Processing urllib3-1.20-py2.7.egg
urllib3 1.20 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/urllib3-1.20-py2.7.egg
Searching for simplejson==3.8.2
Best match: simplejson 3.8.2
Processing simplejson-3.8.2-py2.7-linux-x86_64.egg
simplejson 3.8.2 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/simplejson-3.8.2-py2.7-linux-x86_64.egg
Searching for requests==2.10.0
Best match: requests 2.10.0
Processing requests-2.10.0-py2.7.egg
requests 2.10.0 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/requests-2.10.0-py2.7.egg
Searching for pandas==0.19.2
Best match: pandas 0.19.2
Processing pandas-0.19.2-py2.7-linux-x86_64.egg
pandas 0.19.2 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/pandas-0.19.2-py2.7-linux-x86_64.egg
Searching for numpy==1.12.0
Best match: numpy 1.12.0
Processing numpy-1.12.0-py2.7-linux-x86_64.egg
numpy 1.12.0 is already the active version in easy-install.pth
Installing f2py script to /usr/local/bin

Using /usr/local/lib/python2.7/dist-packages/numpy-1.12.0-py2.7-linux-x86_64.egg
Searching for fuzzywuzzy==0.15.1
Best match: fuzzywuzzy 0.15.1
Processing fuzzywuzzy-0.15.1-py2.7.egg
fuzzywuzzy 0.15.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/fuzzywuzzy-0.15.1-py2.7.egg
Searching for dnspython==1.15.0
Best match: dnspython 1.15.0
Adding dnspython 1.15.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for pytz==2017.2
Best match: pytz 2017.2
Adding pytz 2017.2 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Searching for python-dateutil==2.7.2
Best match: python-dateutil 2.7.2
Processing python_dateutil-2.7.2-py2.7.egg
python-dateutil 2.7.2 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/dist-packages/python_dateutil-2.7.2-py2.7.egg
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for VHostScan==1.21
codingo commented 6 years ago

Ah, my apologies - your issue stated that you installed using git clone so I had assumed you missed running setup..

It looks like this is trying to use urllib2 instead of urllib3. A bit unsure to the cause - trying to replicate. Can you let me know how your environment is configured so I can reproduce the error?

ehsandeep commented 6 years ago

I tried few solutions from the internet, none of them worked.

pip install --force-reinstall requests==2.1.0
pip install --upgrade requests
pip install urllib3 --upgrade

and yes, I'm running this on Ubuntu machine.

codingo commented 6 years ago

Ok great - if you can bear with me I'll build an Ubuntu VM tomorrow to test this.

codingo commented 6 years ago

@timkent tagging in case you have something to test this in also. I only have kali/arch builds available atm.

ehsandeep commented 6 years ago

No problem, please take your time and maybe reopen the issue for the better tracking and thanks for your support and work!

codingo commented 6 years ago

@madaratech sorry that this has yet to be looked into. Hoping to get some time later this week to properly investigate.

codingo commented 6 years ago

This looks to be solved with #93. Could you use the following install and let me know if you get any build errors?

$ python3 setup.py install