Jump to content

dnsspoof in static network


jiggi

Recommended Posts

Hi all,

 

I'm trying to spoof dns in a static network based on the original script. So far, I've spent hours on it without any results - and I don't know why... From my understanding, I would have to do it as such:

Let's say I have a network in 192.168.1.0/24 with one router in 192.168.1.1 and my host is 192.168.1.50.

1) set a static IP on eth0 which mimics the router (example: 192.168.1.1) --> uci set network.lan.ipaddr="192.168.1.1"

2) set a static IP on eth1 which mimics my host on the network (example: 192.168.1.50) --> uci set network.wan.ipaddr="192.168.1.50"

 

And then let the script do it's own stuff with the dnsmasq address and the iptables. The whole script would look like this:

#!/bin/bash

function setup(){

uci set network.lan.ipaddr="192.168.1.1"

uci set network.wan.ipaddr="192.168.1.50"

sleep 5

cp $(dirname ${BASH_SOURCE[0]})/spoofhost /tmp/dnsmasq.address &> /dev/null

/etc/init.d/dnsmasq restart

}

function run(){

   iptables -A PREROUTING -t nat -i eth0 -p udp --dport 53 -j REDIRECT --to-port 53

}

setup

run

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.

Guest
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...