1

Setting up Dnsmasq on Kali Linux. I'm attempting to configure a MITM attack on my home network. I have a USB Wireless Adapter (Alfa) that I'm using to host the AP through hostapd. When a device connects to the SSID being broadcasted via Hostapd, they need to be assigned an IP address via Dnsmasq's DHCP server. At the moment, the AP is up and running, but devices aren't being assigned an IP address as they should.

Wlan0 is the interface that I use to connect to the internet via my Home WiFi network.

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 10.0.0.22  netmask 255.255.0.0  broadcast 10.0.255.255
    inet6 2601:1c2:1101:6dc:9665:9cff:fe1a:2282  prefixlen 64  scopeid 0x0<global>
    inet6 fe80::9665:9cff:fe1a:2282  prefixlen 64  scopeid 0x20<link>
    ether 94:65:9c:1a:22:82  txqueuelen 1000  (Ethernet)
    RX packets 11280  bytes 5273931 (5.0 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 8929  bytes 1481821 (1.4 MiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Wlan1 is the interface that my Alfa is connected to, and I've assigned it the following IP address.

wlan1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
    inet 192.168.1.1  netmask 255.255.255.0  broadcast 192.168.1.255
    ether 00:c0:ca:84:74:ff  txqueuelen 1000  (Ethernet)
    RX packets 184  bytes 30160 (29.4 KiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 207  bytes 35343 (34.5 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Here is my dnsmasq.conf file configurations.

interface=wlan1
dhcp-range=192.168.1.10,192.168.1.250,12h
dhcp-option=1,255.255.255.0
dhcp-option=3,192.168.1.1
dhcp-option=6,192.168.1.1
server=8.8.8.8
log-queries
log-dhcp

And finally, my hostapd.conf file.

interface=wlan1
driver=nl80211
ssid=SerendipityFake
channel=1

The wireless AP is working as it should, but something isn't working correctly to assign the IP addresses via DHCP. The following is the output that I receive when I start my DHCP server;

dnsmasq -C /etc/dnsmasq.conf -d
dnsmasq: started, version 2.75 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6     no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
dnsmasq-dhcp: DHCP, IP range 192.168.1.10 -- 192.168.1.250, lease time 12h
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 75.75.75.75#53
dnsmasq: using nameserver 75.75.76.76#53
dnsmasq: using nameserver 2001:558:feed::1#53
dnsmasq: using nameserver 2001:558:feed::2#53
dnsmasq: read /etc/hosts - 5 addresses

I know that I'm getting the Discover requests when devices connect, because I can see the requests come across in Ettercap. Any suggestions on how to move forward from here would be appreciated.

1

Might be a firewall issue, you need to assign your network interfaces to zones, and enable DNS service where needed. You could try to stop your firewall at all, for example with: systemctl stop firewalld

If this will help, then restart firewall, perform necessary steps (depends on your linux distro) and restart.

  • This was it, for me at least. Past me was trying desperately to screw over present me using ufw. – Brannon Jul 19 '18 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.