DanMcInerney / icebreaker

Gets plaintext Active Directory credentials if you're on the internal network but outside the AD environment
MIT License
1.18k stars 170 forks source link

Installation on Kali not working #9

Closed anlx-sw closed 6 years ago

anlx-sw commented 6 years ago

I wanted to play around with icebreaker. As I had problems with pipenv on my regluar kali i downloaded the latest rolling release virtualbox ova.

I did a dist upgrade and updated everything to latest (and created a snapshot after that).

Then I cloned the icebreaker repo - and did ./setup.sh and then pipenv shell.

Unfortunately the same error as with my regular kali box:

(icebreaker-pYXGQqZV) root@kali:/opt/icebreaker# ./icebreaker.py 
Traceback (most recent call last):
  File "./icebreaker.py", line 13, in <module>
    import libtmux
ModuleNotFoundError: No module named 'libtmux'
(icebreaker-pYXGQqZV) root@kali:/opt/icebreaker# 

So there seems to be a problem with the pipenv.

If I try to recreate the enviornment I get

(icebreaker-pYXGQqZV) root@kali:/opt/icebreaker# pipenv install --three
Virtualenv already exists!
Remove existing virtualenv? [Y/n]: y
Removing existing virtualenv…
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.6.4) to create virtualenv…
⠋Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /root/.local/share/virtualenvs/icebreaker-pYXGQqZV/bin/python3
Also creating executable in /root/.local/share/virtualenvs/icebreaker-pYXGQqZV/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /root/.local/share/virtualenvs/icebreaker-pYXGQqZV
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
ne 75, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/resolver.py", line 30, in main
    import pipenv.core
  File "/usr/local/lib/python2.7/dist-packages/pipenv/../pipenv/__init__.py", line 21, in <module>
    from .cli import cli
  File "/usr/local/lib/python2.7/dist-packages/pipenv/../pipenv/cli.py", line 9, in <module>
    import delegator
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/delegator.py", line 8, in <module>
    from pexpect.popen_spawn import PopenSpawn
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/pexpect/popen_spawn.py", line 14, in <module>
    from Queue import Queue, Empty  # Python 2
ModuleNotFoundError: No module named 'Queue'

/usr/local/lib/python2.7/dist-packages/pipenv/utils.py:1186: ResourceWarning: Implicitly cleaning up <TemporaryDirectory '/tmp/pipenv-pWdkyP-requirements'>
  warnings.warn(warn_message, ResourceWarning)
(icebreaker-pYXGQqZV) root@kali:/opt/icebreaker# 

I also found a mention in the closed issues that it can help to do pipenv install --two followed by pipenv install --three which isn't fixing the error in case of a fresh, updated kali install.

Do you have any further advise on how to install/fix the python problems on kali linux?

DanMcInerney commented 6 years ago

Try uninstalling pipenv. Then try reinstalling with pip3, like pip3 install pipenv.

anlx-sw commented 6 years ago

Unfortunately this seems also not to work on kali:

root@kali:/opt/icebreaker# pip3 install pipenv
Requirement already satisfied: pipenv in /usr/local/lib/python3.6/dist-packages
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from pipenv)
Requirement already satisfied: virtualenv in /usr/local/lib/python3.6/dist-packages (from pipenv)
Requirement already satisfied: virtualenv-clone>=0.2.5 in /usr/local/lib/python3.6/dist-packages (from pipenv)
Requirement already satisfied: setuptools>=36.2.1 in /usr/local/lib/python3.6/dist-packages (from pipenv)
Requirement already satisfied: pip>=9.0.1 in /usr/local/lib/python3.6/dist-packages (from pipenv)
root@kali:/opt/icebreaker# ./icebreaker.py 
Traceback (most recent call last):
  File "./icebreaker.py", line 13, in <module>
    import libtmux
ModuleNotFoundError: No module named 'libtmux'
root@kali:/opt/icebreaker# pipenv install --three
bash: pipenv: command not found
root@kali:/opt/icebreaker# 
DanMcInerney commented 6 years ago

Well that's real weird. You've got something going on with your pipenv install. But additionally, you need to run pipenv shell prior to running icebreaker. I have no idea how you can install pipenv with pip3 and then not have the command found. You've got something real messed up with your python environ.

anlx-sw commented 6 years ago

As mentioned i tried to install it on a freshly installed kali linux. the only thing ran on this vm were updates and the icebreaker install script. as kali is the most widely used distro for pentesting i try new tools mostly on it.

do you have any tips which linux distro should work out-of-the box with icebreaker?

DanMcInerney commented 6 years ago

When I get time I'll download and install a fresh kali instance to check this out but as a temporary workaround you just need to get pipenv working. I don't know why pip install pipenv wouldn't add it to the path but as soon as you can figure out why your machine isn't adding it to your path you should be good.

DanMcInerney commented 6 years ago

OK I installed it on a fresh system. I got an SSL error from pipenv. All these issues appear to stem from Kali's pipenv repo being out of date. I have removed pipenv from automatically running and installing via the setup.sh file and recommended in the README that the user install pipenv from github prior to running the tool.