dhondta/python-sploitkit

lib error python3

innerfire3 opened this issue · 10 comments

Hello,
I install requirements, but i get this error:

python3 main.py
Traceback (most recent call last):
File "main.py", line 4, in
from lib import DronesploitConsole
File "/root/work/dronesploit/lib/init.py", line 3, in
from sploitkit import FrameworkConsole
File "/usr/local/lib/python3.7/dist-packages/sploitkit/init.py", line 4, in
from .core import *
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/init.py", line 1, in
from .console import *
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/console.py", line 17, in
from .command import *
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/command.py", line 6, in
from .components.config import Config
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/components/init.py", line 2, in
from .config import *
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/components/config.py", line 5, in
from ...utils.objects import BorderlessTable
File "/usr/local/lib/python3.7/dist-packages/sploitkit/utils/init.py", line 5, in
from .path import Path
File "/usr/local/lib/python3.7/dist-packages/sploitkit/utils/path.py", line 8, in
from pygments.lexers import Python2Lexer
ImportError: cannot import name 'Python2Lexer' from 'pygments.lexers' (/usr/lib/python3/dist-packages/pygments/lexers/init.py)

Hi @innerfirebg
Thank you for mentioning this.
This is an error related to a dependency of Sploitkit.

This comes from the pygments package ; PythonLexer was renamed to Python2Lexer (see the change log). This means that your pygments version is probably beneath 2.5.0. As a quick fix, please upgrade with pip install pygments --upgrade.

Thanks for the fast answer, but when i do this other error occur...

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/sploitkit/core/components/store.py", line 33, in get
db = [_ for _ in self.__pool if _.path == path][0]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/peewee.py", line 2993, in connect
self._state.set_connection(self._connect())
File "/usr/local/lib/python3.7/dist-packages/peewee.py", line 3329, in _connect
isolation_level=None, **self.connect_params)
sqlite3.OperationalError: unable to open database file

nm17 commented

@innerfirebg , pip install --force --user sploitkit

I Try

Successfully installed CairoSVG-2.4.2 Pillow-6.2.1 Pyphen-0.9.5 asciistuff-1.0.5 cairocffi-1.1.0 certifi-2019.11.28 cffi-1.13.2 chardet-3.0.4 colorama-0.4.3 coloredlogs-10.0 colorful-0.5.4 cowpy-1.1.0 cssselect2-0.2.2 defusedxml-0.6.0 html5lib-1.0.1 humanfriendly-4.18 idna-2.8 ipaddress-1.0.23 markdown2-2.3.8 netaddr-0.7.19 netifaces-0.10.9 numpy-1.17.4 pandas-0.25.3 patchy-2.0.0 pathlib-1.0.1 peewee-3.13.1 prompt-toolkit-3.0.2 pycparser-2.19 pyfiglet-0.8.post1 pyminizip-0.2.4 python-dateutil-2.8.1 python-slugify-4.0.0 pytz-2019.3 requests-2.22.0 setuptools-42.0.2 six-1.13.0 sploitkit-0.3.2 termcolor-1.1.0 terminaltables-3.1.0 text-unidecode-1.3 tinycss2-1.0.2 tinyscript-1.15.13 tqdm-4.40.2 urllib3-1.25.7 virtualenv-16.7.8 wcwidth-0.1.7 weasyprint-50 webencodings-0.5.1

But i have the same error...

nm17 commented

Have you tried running sploitkit in virtualenv? https://virtualenv.pypa.io/en/latest/userguide/

@nm17, Yes i try, but the same output...

nm17 commented

@innerfirebg I've figured it out. Run mkdir ~/Notes as normal user. For some reason it likes to put files there.

@nm17, Thank you! WTF was this...

Hi all,
@nm17 thank you so much for identifying this one !
I'll push a fix soon.