Issue with impacket & python

7.9k Views Asked by At

Hi there boys and girls,

I am trying to run a script written in python and the console is telling me this:

Install the following library to make this script work
Impacket : https://github.com/CoreSecurity/impacket.git
PyCrypto : https://pypi.python.org/pypi/pycrypto

The problem is that I have already installed those python packages in python3 so when I make a request via pip for those packages I receive this:

Requirement already satisfied: impacket in /usr/local/lib/python3.8/dist-packages (0.9.17)
Requirement already satisfied: ldap3>=2.5.0 in /usr/lib/python3/dist-packages (from       impacket) (2.7)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from impacket)    (1.15.0)

Hid the rest of the lines but the idea is that. I understand that the package is already installed in my system but I cannot use those with python2.7.

Any idea how to solve this?

1

There are 1 best solutions below

1
On

In this case the error is because you have not installed impacket for python2.7.

  • Before installing impacket we need to install pip2 in python2.7, Download get-pip.py form Link

  • if pip2 is already installed you can verify this by pip --verison, output of that command should be pip 20.3.3 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

  • If pip2 is not installed then install pip2 in python2 package using sudo python2 get-pip.py

  • Next, install impacket for python2 using pip install . (this must be with in the impacket directory link)

  • then try to run your script