Esser50K / EvilTwinFramework

A framework for pentesters that facilitates evil twin attacks as well as exploiting other wifi vulnerabilities
GNU General Public License v2.0
257 stars 53 forks source link

scapy installation error #1

Closed wice222 closed 7 years ago

wice222 commented 7 years ago

Hi, using Latest Kali 2 fresh install in the end of the installation, I'm getting some like :

[+] Running scapy-com setup installation
running install
running build
running build_py
error: package directory 'scapy' does not exist
[+] Cleaning up the cloned folder after installation

is there anything particular I shall do to fix this ?

Regards

Esser50K commented 7 years ago

Yes I've noticed this, you could install scapy community version manually. But it's definitely my fault, I'll fix the setup script as soon as possible.

I think the problem is that python-scapy is not in the fresh install of Kali, try running "apt-get install python-scapy" and run the setup script again like this: ./setup.py -c

The -c flag for complete install.

wice222 commented 7 years ago

Hi , thanks for your answer,

With parameter -c it gives:

error: option -c not recognised

And Python-scrapy is preinstalled here, : python-scapy is already the nevest version (2.3.2-0.1).

wice222 commented 7 years ago

I've notice your scrip downloads scapy-com but when I run a search to find it can't find anything, I think it feals to install it...

Esser50K commented 7 years ago

You see the commands in the installation script? Try running them manually.

I see the error is in the line: python scapy-com/setup.py install

Run it manuall but inside the scapy-com folder: cd scapy-com python setup.py install

Esser50K commented 7 years ago

Anyway I think I fixed it, try cloning the project again and run: ./setup.py -c

Thanks for bringing this to my attention, I'll leave the issue open for now.

wice222 commented 7 years ago

Hi, Thanks for your answer

I did clone it again and did run with "c" parameter:

root@kali:~/Desktop/EvilTwinFramework-master# ./setup.py -c
[+] Adding kali-linux repositories to /etc/apt/sources.list
[+] Adding packages to install to list.
[+] Adding complete package set to install to list.
[+] Updating apt... (This may take a while)
[+] Apt successfully updated, preparing to install packages
[+] Preparing to install 'scapy'
"The cache has no package named 'scapy'"
[-] Installation of package 'scapy' failed.
[+] Preparing to install 'dnsmasq'
[-] 'dnsmasq' already installed, skipping...
[+] Preparing to install 'hostapd-wpe'
[-] 'hostapd-wpe' already installed, skipping...
[+] Preparing to install 'python-pyric'
[-] 'python-pyric' already installed, skipping...
[+] Upgrading Pyric version.
Requirement already up-to-date: PyRic in /usr/local/lib/python2.7/dist-packages
[+] Preparing to install 'mitmproxy'
[-] 'mitmproxy' already installed, skipping...
[+] Preparing to install 'gnome-terminal'
[-] 'gnome-terminal' already installed, skipping...
[+] Preparing to install 'mitmf'

There is no scapy in apt-get repository... unless your script is trying to use some alternate repository...

I did install scapy manually:

cd /tmp
wget http://www.secdev.org/projects/scapy/files/scapy-2.3.1.zip
unzip -qf scapy-2.3.1.zip
cd scapy-2.*
python setup.py install

and it is now installed:

scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0-dev)

Then I did run your script again,,, but no luck ... I understand after the installation it is going to add simplinks and commands config, listargs, set, config airhost

should work from anywhere ?

Regards

Esser50K commented 7 years ago

Was that the entire output? It should have also installed scapy-com. The package name is actually python-scapy and you mentioned it was already installed.

The output looks okay, I think it did install everything correctly although there isn't the output from the scapy-com installation.

You can see that in the script it runs these commands to install it: hg clone https://bitbucket.org/secdev/scapy-com dpkg --ignore-depends=python-scapy -r python-scapy cd scapy-com && python setup.py install

But that should have worked now.

And no those commands work specifically inside the framework. Now you can run etfconsole.py and start interacting with it.

wice222 commented 7 years ago

Hi

Now installed scapy-com too,

# scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0-dev)

and did try to run EvilTwinFramework's setup:

~/Desktop/EvilTwinFramework-master# ./setup.py -c
[+] Adding kali-linux repositories to /etc/apt/sources.list
[+] Adding packages to install to list.
[+] Adding complete package set to install to list.
[+] Updating apt... (This may take a while)
[+] Apt successfully updated, preparing to install packages
[+] Preparing to install 'scapy'
"The cache has no package named 'scapy'"
[-] Installation of package 'scapy' failed.
[+] Preparing to install 'dnsmasq'
[-] 'dnsmasq' already installed, skipping...
[+] Preparing to install 'hostapd-wpe'
[-] 'hostapd-wpe' already installed, skipping...
[+] Preparing to install 'python-pyric'
[-] 'python-pyric' already installed, skipping...
[+] Upgrading Pyric version.
Requirement already up-to-date: PyRic in /usr/local/lib/python2.7/dist-packages
[+] Preparing to install 'mitmproxy'
[-] 'mitmproxy' already installed, skipping...
[+] Preparing to install 'gnome-terminal'
[-] 'gnome-terminal' already installed, skipping...
[+] Preparing to install 'mitmf'
[-] 'mitmf' already installed, skipping...
[+] Preparing to install 'beef-xss'
[-] 'beef-xss' already installed, skipping...
[+] Preparing to install 'ettercap-common'
[-] 'ettercap-common' already installed, skipping...
[+] Preparing to install 'sslstrip'
[-] 'sslstrip' already installed, skipping...
[+] Preparing to install 'netlib'
"The cache has no package named 'netlib'"
[-] Installation of package 'netlib' failed.
[+] Preparing to install community version of scapy
[+] Cloning scapy-com official repository
destination directory: scapy-com
abort: destination 'scapy-com' is not empty
[+] Running scapy-com setup installation
running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/UTscapy to 755
changing mode of /usr/local/bin/scapy to 755
running install_data
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/scapy-2.2.0_dev.egg-info
Writing /usr/local/lib/python2.7/dist-packages/scapy-2.2.0_dev.egg-info
[+] Cleaning up the cloned folder after installation

This is the full output,
from which directory shall I run the script and what is the exact sintaxis ? I understand somehow I shall run the Framework but , there is no instruction how,

I did try using etfconsole.py but no luck:

root@kali:~/Desktop/EvilTwinFramework-master# python etfconsole.py
Traceback (most recent call last):
  File "etfconsole.py", line 7, in <module>
    os.chdir(os.path.dirname(sys.argv[0])) # Change working directory
OSError: [Errno 2] No such file or directory: ''

root@kali:~/Desktop/EvilTwinFramework-master# ./etfconsole.py
Traceback (most recent call last):
  File "./etfconsole.py", line 19, in <module>
    from MITMCore.etfitm import EvilInTheMiddle
  File "./core/MITMCore/etfitm.py", line 7, in <module>
    from MITMPlugins.beefinjector import BeefInjector
  File "./core/MITMCore/MITMPlugins/beefinjector.py", line 10, in <module>
    from mitmproxy import ctx
ImportError: cannot import name ctx

Regards

Esser50K commented 7 years ago

Humm ok just a reminder that this project is not yet finished, I will try to install it on a fresh Kali install, take note of all the problems and come back to you.

Esser50K commented 7 years ago

Ok I'm noticing a very weird bug where apt says that mitmproxy is installed but then it somehow isn't...

I went ahead and changed the setup script again and run it on a live Kali boot and now I think it finally works. Now I also mention that one of the MITM Plugins relies on the peinjector service, this has to be installed seperately for now. You can find a link to the project in the README file.

So now I would suggest cloning it once again and running the setup script followed by etfconsole. ./setup ./etfconsole

Please send me feedback, thanks

wice222 commented 7 years ago

hi , Thanks for fixing it,

yes it runs fine. I think u'd need to clarify in instructions, how to run console :)

Command "set" do not seems to be working:

ETF[etf/aircommunicator/]::> listargs
             airhost =              (dict); (mode)
          airscanner =              (dict); (mode)
         airdeauthor =              (dict); (mode)
          aircracker =              (dict); (mode)
             plugins =              (dict); (mode)
ETF[etf/aircommunicator/]::> set
[-] Exception in command line loop:
list index out of range
Traceback (most recent call last):
  File "./etfconsole.py", line 623, in <module>
    console.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "./etfconsole.py", line 198, in do_set
    var, value = splitted_args[0], splitted_args[1:]
IndexError: list index out of range

Command config airhost , do not gives any outputs, don't see anything to be configured

ETF[etf/aircommunicator/]::> config airhost
ETF[etf/aircommunicator/airhost]::> 

same with airscanner, if no output means everything is ok, I think some output would be nice ...

also if wifi devise is not plugged in, script gives an error, instead of telling, device is not detected:

`ETF[etf/aircommunicator/]::> config airscanner
erF[etf/aircommunicator/airscanner]::> start airscann 
[-] Exception in command line loop:
[Errno 19] No such device
Traceback (most recent call last):
  File "./etfconsole.py", line 623, in <module>
    console.cmdloop()
  File "/usr/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "./etfconsole.py", line 462, in do_start
    self.aircommunicator.service(service, "start", plugins)
  File "./core/AirCommunicator/aircommunicator.py", line 233, in service
    self.start_sniffer(plugins)
  File "./core/AirCommunicator/aircommunicator.py", line 170, in start_sniffer
    self.add_plugins(plugins, self.air_scanner, AirScannerPlugin)
  File "./core/AirCommunicator/aircommunicator.py", line 203, in add_plugins
    airhost_plugin_instance = airhost_plugin()
  File "./core/Plugins/selfishwifi.py", line 17, in __init__
    internet_interface_mac = NetworkCard(self.config["internet_interface"]).get_mac()
  File "/root/Desktop/EvilTwinFramework-master/utils/networkmanager.py", line 18, in __init__
    self.card = pyw.getcard(interface)
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 269, in getcard
    if nlsock is None: return _nlstub_(getcard, dev)
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 2236, in _nlstub_
    return fct(*argv)
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 270, in getcard
    return devinfo(dev, nlsock)['card']
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 1028, in devinfo
    idx = _ifindex_(dev)
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 2165, in _ifindex_
    if iosock is None: return _iostub_(_ifindex_, dev)
  File "/usr/local/lib/python2.7/dist-packages/pyric/pyw.py", line 2219, in _iostub_
    raise pyric.error(e.errno, pyric.strerror(e.errno))
error: [Errno 19] No such device
`

An other issue is that, both , Airscanner and Airhost are looking for Wlan1 interface, and are not working with wlan0 interface...

Also DNS do not seems to be working, AP allows to sign in, meaning DHCP is working fine, but clients are not able to resolve domains when connected to AP...

Esser50K commented 7 years ago

You can only set actual variables, if it says "dict" you can't set a value to it. I'll fix the crashing. If it says dict you can "config" that variable, always try tab auto-completion!

After you try to config something you should "listargs" again to check if everything is configured correctly, then you can set values on variables. You have to configure it, if you dont have an extra adapter then set it to wlan0 although it is programmed to check for the device before any of the processes who need it, the error you showed usually happens when the connection to the device is lost after already starting the airscanner or airhost...

I have experienced my share of issues when working with the internal wireless adapter. To start an access point you should have 2 adapters, 1 for the access point and another one for the internet connection, or you could transfer this through eth0. Please get comfortable with the necessary configurations first. It's all about "config ..." "listargs" and configuring it. Everything is based on the etf.conf file inside, take a look it might clarify how things are working. About not resolving domain names, I noticed I uploaded the project configured as "captive_portal_mode = true" which means it will not resolve domain names, this is not an error, it is a configuration. To fix this in your case you should: config dnsmasqhandler listargs set captive_portal_mode false

I'm planning on making some video tutorials. I'll close this issue now since it was regarding the installation.

Feel free to post more issues as I don't have anyone to test it on their system and this is supposed to be my masters thesis project.