diff --git a/code/hostapd.conf b/code/hostapd.conf new file mode 100644 index 0000000..912372e --- /dev/null +++ b/code/hostapd.conf @@ -0,0 +1,13 @@ +interface=wlp0s20f0u1 +driver=nl80211 +ssid=t3u +hw_mode=g +channel=1 +macaddr_acl=0 +auth_algs=1 +ignore_broadcast_ssid=0 +wpa=3 +wpa_passphrase=11help22help33 +wpa_key_mgmt=WPA-PSK +wpa_pairwise=TKIP +rsn_pairwise=CCMP diff --git a/code/make_ap.sh b/code/make_ap.sh index 867923a..4b80739 100755 --- a/code/make_ap.sh +++ b/code/make_ap.sh @@ -1,7 +1,22 @@ #! /bin/env bash -nmcli con add type wifi ifname wlp44s0 mode ap con-name WIFI_AP_TEST ssid MY_AP_TEST && + +TYPE="wifi" +IFNAME="wlp0s20f0u1" +CONNAME="T3UminiConn" +SSID="T3Umini" +BAND="bg" +CHAN=1 +KMGMT="wpa-psk" +PSK=11223344 + +nmcli con add type wifi ifname wlp0s20f0u1 mode ap con-name WIFI_AP_TEST ssid MY_AP_TEST && nmcli con modify WIFI_AP_TEST 802-11-wireless.band bg && nmcli con modify WIFI_AP_TEST 802-11-wireless.channel 1 && nmcli con modify WIFI_AP_TEST 802-11-wireless-security.key-mgmt wpa-psk && +nmcli con modify WIFI_AP_TEST 802-11-wireless-security.pairwise ccmp && nmcli con modify WIFI_AP_TEST 802-11-wireless-security.psk 11223344 && nmcli con modify WIFI_AP_TEST ipv4.method shared && nmcli con up WIFI_AP_TEST + +' nmcli con modify WIFI_AP_TEST 802-11-wireless-security.proto rsn && +nmcli con modify WIFI_AP_TEST 802-11-wireless-security.group ccmp && NOT USED FOR APPLE` + diff --git a/notes/journal/Fri, 15. March 2024.md b/notes/journal/Fri, 15. March 2024.md new file mode 100644 index 0000000..b95dc32 --- /dev/null +++ b/notes/journal/Fri, 15. March 2024.md @@ -0,0 +1,12 @@ +Plan: Setup wifi adapter to capture Amazon echodot. +Flow for setting up Access Point: +1. Setup Access Point +2. Configure Routing/Bridge or similar so IoT device can access internet. + +Tried [linux-wifi-hotspot](https://github.com/lakinduakash/linux-wifi-hotspot) repo. Running it makes AP visible to iPhone, but issue is IP Address. Need to configure dhcp server or manually assign address. + +Problem: Wifi Adapter In monitor mode sees nothing. +Neither Adapter has driver for modern macos +Archer T3U is using rtw_8822bu driver from kernel, this supports mac + +Decide to go down hostapd route. diff --git a/notes/journal.md b/notes/journal/Mon, 11. March 2024.md similarity index 62% rename from notes/journal.md rename to notes/journal/Mon, 11. March 2024.md index cc0ffd6..2578a45 100644 --- a/notes/journal.md +++ b/notes/journal/Mon, 11. March 2024.md @@ -1,19 +1,11 @@ -# Mon, 11. March 2024 -[[11032024]] ### Completed: - All Devices unpacked except [[xiaomi tv stick]]. - [[ledvance led strip]] wont enter pairing mode. - [[echodot]] is setup and works. - [[mi 360 home security camera]] needs microsd card. - ## Plan for this week: - Get microsd card - MAINLY: Get AP working or find other way to capture traffic. ## Misc.: Much time lost resetting router. [[ledvance led strip]] will only connect to 2.5GHz networks. -If laptop is connected to internet via ethernet, then I can make a AP, but iPhone wont connect to it. But IoT devices connect - -# Tue, 12. March -- Bought two USB Wifi Adapters: - - tp-link AC1300 Archer T3U (Mini Wireless MU-MIMO USB Adapter) - - tp-link AC1300 Archer T3U Plus (High Gain Wireless Dual Band USB Adapter) \ No newline at end of file +If laptop is connected to internet via ethernet, then I can make a AP, but iPhone wont connect to it. But IoT devices connect \ No newline at end of file diff --git a/notes/journal/Tue, 12. March.md b/notes/journal/Tue, 12. March.md new file mode 100644 index 0000000..150b03b --- /dev/null +++ b/notes/journal/Tue, 12. March.md @@ -0,0 +1,4 @@ + +- Bought two USB Wifi Adapters (Completes [[TODO1]]): + - tp-link AC1300 Archer T3U (Mini Wireless MU-MIMO USB Adapter). + - tp-link AC1300 Archer T3U Plus (High Gain Wireless Dual Band USB Adapter) \ No newline at end of file diff --git a/notes/todo.md b/notes/todo.md deleted file mode 100644 index 0397703..0000000 --- a/notes/todo.md +++ /dev/null @@ -1,4 +0,0 @@ -1. Need microsd card for Mi 360 home camera -2. Cannot get Ledvance LED strip into discovery mode s.t. connection could be established -3. Have not managed to setup AP/Hotspot: Amazon echodot needs iOS app but iPhone will not connect to AP on fedora Laptop -4. ~~Ask Valentyna/Nima for other approach to capture traffic~~ Preliminary Fix: USB Plugable Wifi Adapters. \ No newline at end of file diff --git a/notes/todos/TODO1.md b/notes/todos/TODO1.md new file mode 100644 index 0000000..e69de29 diff --git a/notes/todos/todo.md b/notes/todos/todo.md new file mode 100644 index 0000000..67e2770 --- /dev/null +++ b/notes/todos/todo.md @@ -0,0 +1,4 @@ +- [ ] [[TODO1]] Need microsd card for Mi 360 home camera +- [ ] Cannot get Ledvance LED strip into discovery mode s.t. connection could be established +- [ ] Have not managed to setup AP/Hotspot: Amazon echodot needs iOS app but iPhone will not connect to AP on fedora Laptop +- [x] ~~Ask Valentyna/Nima for other approach to capture traffic~~ Preliminary Fix: USB Plugable Wifi Adapters. diff --git a/notes/wiki/AP configuration.md b/notes/wiki/AP configuration.md new file mode 100644 index 0000000..0707423 --- /dev/null +++ b/notes/wiki/AP configuration.md @@ -0,0 +1,6 @@ +# Using NetworkManager +See [here](https://variwiki.com/index.php?title=Wifi_NetworkManager#Configuring_WiFi_Access_Point_with_NetworkManager). Can use the command line tool [[nmcli]]. + +# Using [[hostapd]] +Must first make sure that the interface is not managed by nmcli, see [[nmcli]]. + diff --git a/notes/wiki.md b/notes/wiki/Tools.md similarity index 65% rename from notes/wiki.md rename to notes/wiki/Tools.md index 0d309c9..5c416de 100644 --- a/notes/wiki.md +++ b/notes/wiki/Tools.md @@ -1,5 +1,9 @@ -# WiFi -## Wifi Adapter not found anymore +# Wifi Tools +- [[aircrack-ng]]can easily enable monitor mode +- [[nmcli]] NetworkManager cli +- [[hostapd]] +- [[iw]] +# Wifi Adapter not found anymore - __Issue__: After using `airmon-ng` to put my wifi adapter into monitor mode and then supposedly back into normal mode: network manager couldn't find wifi adapter anymore. - `sudo nmcli dev` showed that `wlp44s0` interface was "unmanaged". - __Fix__: `sudo nmcli set wlp44s0 managed yes` \ No newline at end of file diff --git a/notes/wiki/aircrack-ng.md b/notes/wiki/aircrack-ng.md new file mode 100644 index 0000000..e69de29 diff --git a/notes/wiki/hostapd.md b/notes/wiki/hostapd.md new file mode 100644 index 0000000..e69de29 diff --git a/notes/wiki/iw.md b/notes/wiki/iw.md new file mode 100644 index 0000000..3ef3dad --- /dev/null +++ b/notes/wiki/iw.md @@ -0,0 +1,10 @@ +***TLDR***: show / manipulate wirless devices and their configs. + +# Commands used: +- `iw list` shows extensive info about all wirless devices. +- To check if any devices is AP ready: +```bash +iw list | grep -i ap -A 5 -B 5 +``` + + diff --git a/notes/wiki/monitoring.md b/notes/wiki/monitoring.md new file mode 100644 index 0000000..fc99af5 --- /dev/null +++ b/notes/wiki/monitoring.md @@ -0,0 +1,19 @@ +***TLDR:*** How to monitor/sniff wifi network traffic of IoT Devices. Two strategies: +Use a wifi adapter to setup an #AP and have the devices connect to via that or use wifi card in monitor mode. + +# Funnel traffic via AP +**Issues**: iPhone has problems connecting to the provided APs. But need iPhone to configure network connection of devices. +# Monitor Mode +--- +## HowTo +Insert wifi adapter and make sure it shows up as a interface with e.g. `nmcli dev`. +### Manually activate: +1. Find out which interfaces already exist with names like`mon_N_`: `ifconfig -a`. +2. `iw dev _interface_ interface add _mon_num_ type monitor` +3. `ifconfig _mon_num up` +### Using [[aircrack-ng]] : +Activate monitor mode on interface `wlp0s20f0u1`: +```bash +sudo airmon-ng start wlp0s20f0u1 +``` +Output: diff --git a/notes/wiki/nmcli.md b/notes/wiki/nmcli.md new file mode 100644 index 0000000..c2d40a8 --- /dev/null +++ b/notes/wiki/nmcli.md @@ -0,0 +1,20 @@ +***TLDR:*** Command line utility of NetworkManager +Benefit: Automates setting up WiFi, DHCP server and NAT config, according to [here](https://variwiki.com/index.php?title=Wifi_NetworkManager#Configuring_WiFi_Access_Point_with_NetworkManager) . + +# Commands +```bash +nmcli dev #list network devices +``` +```bash +nmcli con down # disable AP config +``` +```bash +nmcli con delete # permanently delete AP configuration +``` +```bash +sudo systemctl restart NetworkManager # for config changes to take effect +``` +```bash +sudo nmcli device set managed no # make sure itnerface is not managed by NetworkManager. Can use d instead of device. +``` +