Home > Software design >  I am unable to install packages for python2 specifically, pip and pip3 point to the same version
I am unable to install packages for python2 specifically, pip and pip3 point to the same version

Time:10-19

Context: Running an exploit vs a vulnerable VM as a part of my OSCP studies. I know this VM is vulnerable to this exploit because I ran the exploit inside MSF(pentesting framework) and it worked, but doing it manually I am having dependency issues.

Setup: I am on kali, latest quarterly release

Exploit: https://github.com/andyacer/ms08_067

Pip versions output

Trying to install dependencies

Keep in mind on kali "python" points to python2.7.18, and python3 points to python3.xwhatever because of backwards compatibility (funny huh) because tons of exploits are written in python2

the script uses #!/usr/bin/env python thus points to python2.7.18

I have already tried various solutions from various SO threads as well as articles on google.

CodePudding user response:

Can you please check under /usr/local/lib that you have some version of python2 installed?

You should also be able to run python2 -V to verify that you do have python2 installed.

To install pip for python2, download get-pip.py from here and then run this command:

sudo python2 get-pip.py

This should create a pip2 symlink on your system. It might replace the existing pip symlink too. Either way, it should solve your issue.

CodePudding user response:

Per the Kali forums: https://forums.kali.org/showthread.php?48570-New-Kali-build-cannot-install-pip-for-python2-7

    curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
    python get-pip.py

Note that I had to modify the link to pip2.7 as the old link in the forum pointed to 3.6

That should get you going.

  • Related