from urllib.parse import urlparse ImportError: No module named parse
Closed this issue · 2 comments
Hi, I am running the latest Debian Stretch on amd64.
My Python version is:
$ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
My pip version is:
$ pip -V
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
$ dpkg -l |grep python-pip
ii python-pip 9.0.1-2 all Python package installer
ii python-pip-whl 9.0.1-2 all Python package installer
I have the following pip packages installed after
$ sudo pip install -r requirements.txt
$ sudo pip install configparser
$ sudo pip install parse
$ sudo pip list
apsw (3.13.0.post1)
BeautifulSoup (3.2.1)
beautifulsoup4 (4.5.3)
chardet (2.3.0)
CherryPy (3.5.0)
click (6.7)
click-plugins (1.0.3)
colorama (0.3.9)
configparser (3.5.0)
cryptography (1.7.1)
cssselect (1.0.1)
cssutils (1.0)
dnspython (1.15.0)
docopt (0.6.2)
enum34 (1.1.6)
feedparser (5.1.3)
html5lib (0.999999999)
idna (2.2)
ipaddr (2.1.11)
ipaddress (1.0.17)
Jinja2 (2.10)
keyring (10.1)
keyrings.alt (1.3)
libvirt-python (3.0.0)
lxml (3.7.1)
Markdown (2.6.8)
MarkupSafe (1.0)
mechanize (0.2.5)
msgpack-python (0.5.6)
netifaces (0.10.4)
numpy (1.12.1)
pandas (0.22.0)
parse (1.8.4)
Pillow (4.0.0)
pip (9.0.1)
pyasn1 (0.1.9)
pycrypto (2.6.1)
Pygments (2.2.0)
pygobject (3.22.0)
pyOpenSSL (16.2.0)
pyparsing (2.1.10)
python-dateutil (2.5.3)
pytz (2018.5)
pyxdg (0.25)
PyYAML (3.12)
repoze.lru (0.6)
requests (2.12.4)
Routes (2.3.1)
SecretStorage (2.3.1)
setuptools (33.1.1)
shodan (1.7.7)
six (1.10.0)
urllib3 (1.19.1)
uTidylib (0.3)
vboxapi (1.0)
webencodings (0.5)
WebOb (1.6.2)
wheel (0.29.0)
XlsxWriter (1.0.2)
While running the program I am getting this error.
~/Software/GyoiThon$ python gyoithon.py
Traceback (most recent call last):
File "gyoithon.py", line 12, in
from GyoiClassifier import DeepClassifier
File "./classifier4gyoithon/GyoiClassifier.py", line 13, in
from urllib.parse import urlparse
ImportError: No module named parse
~/Software/GyoiThon$ sudo python gyoithon.py
Traceback (most recent call last):
File "gyoithon.py", line 12, in
from GyoiClassifier import DeepClassifier
File "./classifier4gyoithon/GyoiClassifier.py", line 13, in
from urllib.parse import urlparse
ImportError: No module named parse
How do I troubleshoot this?
Thanks
Hi @sgeorge, you will want to use python3 instead of python2.7. Install python3, install pip3 and reinstall the requirements.
OK I tried this
$ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04)
[GCC 6.3.0 20170118] on linux
$ pip3 -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)
$ sudo pip3 install -r requirements.txt
Collecting docopt==0.6.2 (from -r requirements.txt (line 1))
Collecting Jinja2==2.10 (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting msgpack-python==0.5.6 (from -r requirements.txt (line 3))
Collecting pandas==0.22.0 (from -r requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/99/0a/37930bbee7a06bb5ce7e12f7970b29a17a49605d0b08a72dee7ab76135bb/pandas-0.22.0-cp35-cp35m-manylinux1_x86_64.whl
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.5/dist-packages (from Jinja2==2.10->-r requirements.txt (line 2))
Requirement already satisfied: python-dateutil>=2 in /usr/local/lib/python3.5/dist-packages (from pandas==0.22.0->-r requirements.txt (line 4))
Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.5/dist-packages (from pandas==0.22.0->-r requirements.txt (line 4))
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.5/dist-packages (from pandas==0.22.0->-r requirements.txt (line 4))
Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2->pandas==0.22.0->-r requirements.txt (line 4))
Installing collected packages: docopt, Jinja2, msgpack-python, pandas
Successfully installed Jinja2-2.10 docopt-0.6.2 msgpack-python-0.5.6 pandas-0.22.0
$ sudo pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
chardet (2.3.0)
cryptography (1.7.1)
docopt (0.6.2)
httplib2 (0.9.2)
idna (2.2)
Jinja2 (2.10)
keyring (10.1)
keyrings.alt (1.3)
MarkupSafe (1.0)
msgpack-python (0.5.6)
numpy (1.14.5)
pandas (0.22.0)
pexpect (4.2.1)
Pillow (4.0.0)
pip (9.0.1)
ptyprocess (0.5.1)
pyasn1 (0.1.9)
pycrypto (2.6.1)
pycurl (7.43.0)
pygobject (3.22.0)
python-apt (1.4.0b3)
python-dateutil (2.7.3)
python-debian (0.1.30)
python-debianbts (2.6.1)
pytz (2018.5)
pyxdg (0.25)
reportbug (7.1.7)
reportlab (3.3.0)
requests (2.12.4)
SecretStorage (2.3.1)
setuptools (33.1.1)
six (1.10.0)
unattended-upgrades (0.1)
urllib3 (1.19.1)
wheel (0.29.0)
Everything seemed fine but got this error
[+] Get exploit list.
[] Loading exploit list from local file: /home/siju/Software/GyoiThon/classifier4gyoithon/data/exploit_list.csv
[+] Get exploit tree.
[] Loading exploit tree from local file: /home/siju/Software/GyoiThon/classifier4gyoithon/data/exploit_tree.json
Traceback (most recent call last):
File "gyoithon.py", line 202, in
if check_arg_value(ip_list[idx], port_list[idx], path_list[idx]) is False:
IndexError: list index out of range
So I followed
#13
I was testing https://hub.docker.com/r/raesene/bwapp/
It started well
_$ python3 gyoithon.py
[-] category : os
product : ubuntu
reason : [['Server: Apache/2.4.7 (Ubuntu)']]
target url : http://192.168.1.20:80/sqli_drupal.php
[-] category : web
product : apache
reason : [['Server: Apache']]
target url : http://192.168.1.20:80/sqli_drupal.php
[*] Exception: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:720)
Thanks :-)
target : 192.168.1.20(192.168.1.20):80
target log : /home/siju/Software/GyoiThon/classifier4gyoithon/../gyoithon/get_192.168.1.20_80_ip.log
[+] judge :
[-] category : web server
product : unknown
too low maximum probability.
[-] category : framework
product : unknown
too low maximum probability.
[-] category : cms
-----
ranking 1
product : eccube
probability : 6.6667 %
reason : [['Set-Cookie: PHPSESSID=fi4e0jfcan2tk4d5t5lrec0o11', 'Set-Cookie: PHPSESSID=2nvro7s4mg9ebq2e2rabv5eov2']]
-----
ranking 2
product : joomla
probability : 6.6667 %
reason : [['Set-Cookie: PHPSESSID=fi4e0jfcan2tk4d5t5lrec0o11', 'Set-Cookie: PHPSESSID=2nvro7s4mg9ebq2e2rabv5eov2']]
-----
ranking 3
product : oscommerce
probability : 3.4483 %
reason : too few features..
[+] done GyoiClassifier.py_
But got this error
[+] Get exploit list.
[] Loading exploit list from local file: /home/siju/Software/GyoiThon/classifier4gyoithon/data/exploit_list.csv
[+] Get exploit tree.
[] Loading exploit tree from local file: /home/siju/Software/GyoiThon/classifier4gyoithon/data/exploit_tree.json
Invalid file error: No objects to concatenate
Where to go from here?
Thanks :-)