Upadte some notes.

This commit is contained in:
Sebastian Lenzlinger 2024-03-18 12:17:05 +01:00
parent 134666ee5c
commit a44719257a
15 changed files with 111 additions and 16 deletions

13
code/hostapd.conf Normal file
View File

@ -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

View File

@ -1,7 +1,22 @@
#! /bin/env bash #! /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.band bg &&
nmcli con modify WIFI_AP_TEST 802-11-wireless.channel 1 && 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.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 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 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`

View File

@ -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.

View File

@ -1,19 +1,11 @@
# Mon, 11. March 2024
[[11032024]]
### Completed: ### Completed:
- All Devices unpacked except [[xiaomi tv stick]]. - All Devices unpacked except [[xiaomi tv stick]].
- [[ledvance led strip]] wont enter pairing mode. - [[ledvance led strip]] wont enter pairing mode.
- [[echodot]] is setup and works. - [[echodot]] is setup and works.
- [[mi 360 home security camera]] needs microsd card. - [[mi 360 home security camera]] needs microsd card.
## Plan for this week: ## Plan for this week:
- Get microsd card - Get microsd card
- MAINLY: Get AP working or find other way to capture traffic. - MAINLY: Get AP working or find other way to capture traffic.
## Misc.: ## Misc.:
Much time lost resetting router. [[ledvance led strip]] will only connect to 2.5GHz networks. 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 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)

View File

@ -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)

View File

@ -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.

0
notes/todos/TODO1.md Normal file
View File

4
notes/todos/todo.md Normal file
View File

@ -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.

View File

@ -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]].

View File

@ -1,5 +1,9 @@
# WiFi # Wifi Tools
## Wifi Adapter not found anymore - [[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. - __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". - `sudo nmcli dev` showed that `wlp44s0` interface was "unmanaged".
- __Fix__: `sudo nmcli set wlp44s0 managed yes` - __Fix__: `sudo nmcli set wlp44s0 managed yes`

View File

0
notes/wiki/hostapd.md Normal file
View File

10
notes/wiki/iw.md Normal file
View File

@ -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
```

19
notes/wiki/monitoring.md Normal file
View File

@ -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:

20
notes/wiki/nmcli.md Normal file
View File

@ -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 <name> # disable AP config
```
```bash
nmcli con delete <name> # permanently delete AP configuration
```
```bash
sudo systemctl restart NetworkManager # for config changes to take effect
```
```bash
sudo nmcli device set <interface-name> managed no # make sure itnerface is not managed by NetworkManager. Can use d instead of device.
```