Skip to content

Fufuches/RogueAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RogueAP

This repository contains scripts to create an access points using Python and Scapy, and to configure a hostapd access point to bypass Snappy verification.

Table of Contents


hostapdCreation.py

Description

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.

Requirements

sudo apt install hostapd
sudo apt install dnsmasq

pip install scapy

Example Usage

sudo python3 hostapdCreation.py pcap/legitimate.pcap wlan0
  1. To give internet access to the cients, configure dnsmasq.conf file:
nano dnsmasq.conf

Add 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
  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
  1. Configure iptables to forward traffic to get internet access for the clients:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  1. Start dnsmasq:
sudo dnsmasq -C dnsmasq.conf -d

ap.py

Description

This script create an access point in python using the library Scapy.

Requirements

Install the required library:

sudo apt install hostapd
sudo apt install dnsmasq

pip install scapy

Example usage

  1. 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
  1. Run the script:
sudo python3 ap.py pcap/legitimate.pcap wlan0
  1. To give internet access to the cients, configure dnsmasq.conf file:

Create a dnsmasq.conf file:

nano dnsmasq.conf

Add 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
  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
  1. Start dnsmasq:
sudo dnsmasq -C dnsmasq.conf -d

About

Rogue Wi-Fi AP detection with Snappy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages