-1

While Installing Man in the Middle Framework (MITMf) i get an ImportError:No Module named capstone..

Although Capstone is already installed in my Kali Machine

I downloaded MITMf from https://github.com/byt3bl33d3r/MITMf

Heres what i get

root@kali:~/Desktop/MITMf# python mitmf.py --help
Traceback (most recent call last):
File "mitmf.py", line 36, in <module>
from plugins import *
  File "/root/Desktop/MITMf/plugins/filepwn.py", line 72, in <module>
    from libs.bdfactory import pebin
  File "/root/Desktop/MITMf/libs/bdfactory/pebin.py", line 49, in <module>
    from intel.intelCore import intelCore
  File "/root/Desktop/MITMf/libs/bdfactory/intel/intelCore.py", line 38, in <module>
    from capstone import *
ImportError: No module named capstone
root@kali:~/Desktop/MITMf# pip install capstone
Requirement already satisfied: capstone in /usr/lib/python3/dist-packages (3.0.5)
root@kali:~/Desktop/MITMf#

1 Answers1

1

You need to install the python2.7 version of capstone. It looks like your python installation is a little weird. On Debian systems such as Kali, pip should be the installer for python2 packages and pip3 should be the installer for python3 packages.

From the pip man page:

On Debian, pip is the command to use when installing packages for Python 2, while pip3 is the command to use when installing packages for Python 3.

You probably should fix your pip installation by linking pip2 to pip. The way we do this is removing the pip binary and creating a symlink from pip2:

[k@box]$ sudo rm /usr/bin/pip
[k@box]$ sudo ln -s /usr/bin/pip2 /usr/bin/pip

Then you should be able to install the python2.7 version with pip

[k@box]$ pip install capstone

Explanation:

You have installed the python3.6 version of capstone. You can see in the output of your pip install command:

root@kali:~/Desktop/MITMf# pip install capstone
Requirement already satisfied: capstone in /usr/lib/python3/dist-packages (3.0.5)

If you look at the script mitmf.py, you will notice that the top line specifies python2.7

[k@box]$ head -n3 mitmf.py
#!/usr/bin/env python2.7

# Copyright (c) 2014-2016 Moxie Marlinspike, Marcello Salvati
kegn
  • 756
  • 6
  • 6