Closed slava-nikulin closed 7 years ago
Hi @slava-nikulin Thanks for filling a bug report, we will get to this as soon as we can. Also I did some experiments with docker images but I had trouble connecting my usb
adapters to the docker image when running. Were you able to do this successfully?
@anakin1028 It seems that dbus.exceptions.DBusException
is not getting captured properly.
hmm, it seems that the dbus
module is missing.
@slava-nikulin, can you post the output of the following command?
ldconfig -p |grep dbus
Also can you try to import dbus
on the interactive Python interpreter and see if there is any error?
Hi, thanks for your responses, guys.
@blackHatMonkey If you start container with --privileged
option you'll be able to use your usb devices(i.e. wifi adapters).
@anakin1028 dbus seems to be installed already:
root@eaae0a21ffed:/wifiphisher# ldconfig -p |grep dbus
libdbus-1.so.3 (libc6,x86-64) => /lib/x86_64-linux-gnu/libdbus-1.so.3
libdbus-glib-1.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2
root@eaae0a21ffed:/wifiphisher# python
Python 2.7.13 (default, Jan 19 2017, 14:48:08)
[GCC 6.3.0 20170118] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import dbus
>>>
ok, if I run /etc/init.d/dbus restart
in container, it fixes that error, but here is another one:
root@21851c5630bb:/wifiphisher# python bin/wifiphisher
WARNING: Failed to execute tcpdump. Check it is installed and in the PATH
[*] Starting Wifiphisher 1.3GIT at 2017-07-08 21:11
Traceback (most recent call last):
File "bin/wifiphisher", line 12, in <module>
run()
File "/wifiphisher/wifiphisher/pywifiphisher.py", line 776, in run
engine.start()
File "/wifiphisher/wifiphisher/pywifiphisher.py", line 528, in start
self.network_manager.start()
File "/wifiphisher/wifiphisher/common/interfaces.py", line 606, in start
raise error
pyric.error: [Errno 2] No such file or directory
network-manager is installed in container
Is tcpdump
installed? This is a scapy requirement AFAIK.
It seems, that error is in PyRIC module. Maybe you know why PyRIC can't get card under docker? https://github.com/wraith-wireless/PyRIC/issues/39
I'm running Wifiphisher, on Kali, inside of a Docker container (ran in --privileged
mode and with --net host
).
Had the exact same problem, but after restarting dbus
and installing tcpdump
, it works.
@nicovillanueva Can you post your relevant configuration files?
Not much of config files, but I just started a new, clean container, installed a few things, and tried running wifiphisher and it ran fine. Exactly the commands I ran:
# In my host:
docker run -it --net host --privileged kalilinux/kali-linux-docker:latest
# Once inside the container:
apt update && apt -y dist-upgrade
apt install -y pciutils tcpdump python-pip git libnl-genl-3-dev hostapd dnsmasq
pip install scapy
/etc/init.d/dbus restart
cd ~
git clone https://github.com/wifiphisher/wifiphisher
cd wifiphisher
python setup.py install
wifiphisher
# Wifiphisher's stdout:
root@lithium:~/wifiphisher# wifiphisher
[*] Starting Wifiphisher 1.3GIT ( https://wifiphisher.org ) at 2017-09-18 15:13
[+] Selecting wlp2s0 interface for the deauthentication attack
[+] Selecting wlan1 interface for creating the rogue Access Point
[+] Changing wlan1 MAC addr (BSSID) to 00:00:00:98:87:8e
[*] Cleared leases, started DHCP, set up iptables
[+] Show your support!
[+] Follow us: https://twitter.com/wifiphisher
[+] Like us: https://www.facebook.com/Wifiphisher
[+] Captured credentials:
[!] Closing
However, I didn't get it to actually do it's thing. I just verified that it starts running (the UI comes up and the above logs are shown). Restarting dbus and installing tcpdump are required steps, it seems.
@istais may want to have a look at that as he's maintaining https://hub.docker.com/r/istais/wifiphisher/
Sadly it seems kinda outdated, right? And I don't see the source of the Dockerfile. Maybe I can pick up the project and maintain a proper hub image. And I'll see to send a pull request, cause scapy and tcpdump seem to be required, but are not installed by the setup.py. Or am I doing something wrong?
@sophron Maybe we can build it ourselves using travis. We can automatically build it with every new commit on the master
.
Yes, it is outdated indeed.
@blackHatMonkey That's a good idea. @nicovillanueva maybe you can help us with that.
Gladly! I think that instead of Travis, the image build should be made using automated builds in Docker Hub. I can look into it, sure.
EDIT: Yeah, doable via Docker Hub directly: https://docs.docker.com/docker-hub/builds/#add-and-run-a-new-build
@nicovillanueva Sounds great. While we are at it can you look into finding a smaller base file as Kali
is huge and we don't need all of that. Maybe ubuntu
or another linux
base will be smaller and does what we need.
Yeah. I'm usually an Alpine fan, so I'll try to stick it in there. Otherwise I'll probably fall back to Debian/Ubuntu. I'll get to it once I get this damn meetup talk off my back.
About the original report, @slava-nikulin , did my setup "solve" your issue?
@nicovillanueva Thank you, it would be cool if you will make updated image! I tried to restart dbus, but that didn't help, I think that is because I run Docker on Windows 10, that uses Hyper-V containers. So, Docker containers are not fully crossplatform yet. Thank you, guys for the help!
I will! However, neither Windows nor Mac containers will properly work. I set up everything in my Macbook running docker, but Pyric fails. However, I did get it to run (using a USB Wifi card) in a Kali VM, running Docker inside it. Contrived, yeah, but as Docker containers are not native in these platforms, these kind of issues come up.
I'm trying to run wifiphisher on Kali linux under Docker.
Here is my
Dockerfile
:Build image:
docker build . -t "kali:1"
Start container:
docker run -it --privileged kali:1 /bin/bash
And the Error:
Here is output of
dhclient
command:Version: 8a31876423f1a6a51c4a4b4b5009ae882c691c77
Any ideas?