This repository contains scripts to create an access points using Python and Scapy, and to configure a hostapd access point to bypass Snappy verification.
This script takes a .pcap file containing at least one beacon frame as input. From that beacon frame, it generates a hostapd configuration file that bypasses the Snappy verification.
sudo apt install hostapd
sudo apt install dnsmasq
pip install scapysudo python3 hostapdCreation.py pcap/legitimate.pcap wlan0- To give internet access to the cients, configure dnsmasq.conf file:
nano dnsmasq.confAdd the following content:
interface=wlan0
dhcp-range=10.0.0.100,10.0.0.250,255.255.255.0,12h
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1
server=8.8.8.8
log-queries
log-dhcp
listen-address=127.0.0.1- Set up the network interface and enable forwarding:
sudo ifconfig wlan0 10.0.0.1/24
sudo sysctl -w net.ipv4.ip_forward=1- Configure iptables to forward traffic to get internet access for the clients:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE- Start dnsmasq:
sudo dnsmasq -C dnsmasq.conf -dThis script create an access point in python using the library Scapy.
Install the required library:
sudo apt install hostapd
sudo apt install dnsmasq
pip install scapy- Preapre the network interface (Channel and MAC address need to be changed to your configuration):
sudo airmon-ng check kill
sudo ip link set wlan0 down
sudo iw dev wlan0 set type monitor
sudo ip link set dev wlan0 address 28:87:ba:c0:43:38
sudo ip link set wlan0 up
sudo iw dev wlan0 set channel 11- Run the script:
sudo python3 ap.py pcap/legitimate.pcap wlan0- To give internet access to the cients, configure dnsmasq.conf file:
Create a dnsmasq.conf file:
nano dnsmasq.confAdd the following content:
interface=wlan0
dhcp-range=10.0.0.100,10.0.0.250,255.255.255.0,12h
dhcp-option=3,10.0.0.1
dhcp-option=6,10.0.0.1
server=8.8.8.8
log-queries
log-dhcp
listen-address=127.0.0.1
- Enable IP forwarding and configure iptables:
sudo sysctl -w net.ipv4.ip_forward=1
sudo route add -net 10.0.0.0 netmask 255.255.255.0 gw 10.0.0.1
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i at0 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o at0 -m state --state RELATED,ESTABLISHED -j ACCEPT- Start dnsmasq:
sudo dnsmasq -C dnsmasq.conf -d