Skip to content

Commit d7ea021

Browse files
author
HackTricks News Bot
committed
Add content from: Hijacker on the Samsung Galaxy S10 with wireless injection
1 parent 1403e5b commit d7ea021

File tree

6 files changed

+147
-7
lines changed

6 files changed

+147
-7
lines changed

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [Spoofing LLMNR, NBT-NS, mDNS/DNS and WPAD and Relay Attacks](generic-methodologies-and-resources/pentesting-network/spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md)
2626
- [Spoofing SSDP and UPnP Devices with EvilSSDP](generic-methodologies-and-resources/pentesting-network/spoofing-ssdp-and-upnp-devices.md)
2727
- [Pentesting Wifi](generic-methodologies-and-resources/pentesting-wifi/README.md)
28+
- [Enable Nexmon Monitor And Injection On Android](generic-methodologies-and-resources/pentesting-wifi/enable-nexmon-monitor-and-injection-on-android.md)
2829
- [Evil Twin EAP-TLS](generic-methodologies-and-resources/pentesting-wifi/evil-twin-eap-tls.md)
2930
- [Phishing Methodology](generic-methodologies-and-resources/phishing-methodology/README.md)
3031
- [Clone a Website](generic-methodologies-and-resources/phishing-methodology/clone-a-website.md)

src/generic-methodologies-and-resources/pentesting-wifi/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ iwlist wlan0 scan #Scan available wifis
2121

2222
## Tools
2323

24+
### Hijacker & NexMon (Android internal Wi-Fi)
25+
26+
{{#ref}}
27+
enable-nexmon-monitor-and-injection-on-android.md
28+
{{#endref}}
29+
2430
### EAPHammer
2531

2632
```
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Enable NexMon Monitor Mode & Packet Injection on Android (Broadcom chips)
2+
3+
{{#include ../../banners/hacktricks-training.md}}
4+
5+
## Overview
6+
Most modern Android phones embed a Broadcom/Cypress Wi-Fi chipset that ships without 802.11 monitor mode or frame-injection capabilities. The open-source NexMon framework patches the proprietary firmware to add those features and exposes them through a shared library (`libnexmon.so`) and a CLI helper (`nexutil`). By pre-loading that library into the stock Wi-Fi driver, a rooted device can capture raw 802.11 traffic and inject arbitrary frames – eliminating the need for an external USB adapter.
7+
8+
This page documents a fast workflow that takes a fully-patched Samsung Galaxy S10 (BCM4375B1) as an example, using:
9+
10+
* NexMon Magisk module containing the patched firmware + `libnexmon.so`
11+
* Hijacker Android application to automate monitor-mode toggling
12+
* Optional Kali NetHunter chroot to run classic wireless tools (aircrack-ng, wifite, mdk4 …) directly against the internal interface
13+
14+
The same technique applies to any handset that has a publicly available NexMon patch (Pixel 1, Nexus 6P, Galaxy S7/S8, etc.).
15+
16+
---
17+
18+
## Prerequisites
19+
* Android handset with a supported Broadcom/Cypress chipset (e.g. BCM4358/59/43596/4375B1)
20+
* Root with Magisk ≥ 24
21+
* BusyBox (most ROMs/NetHunter already include it)
22+
* NexMon Magisk ZIP or self-compiled patch providing:
23+
* `/system/lib*/libnexmon.so`
24+
* `/system/xbin/nexutil`
25+
* Hijacker ≥ 1.7 (arm/arm64) – https://github.com/chrisk44/Hijacker
26+
* (Optional) Kali NetHunter or any Linux chroot where you intend to run wireless tools
27+
28+
---
29+
30+
## Flashing the NexMon patch (Magisk)
31+
1. Download the ZIP for your exact device/firmware (example: `nexmon-s10.zip`).
32+
2. Open Magisk -> Modules -> Install from storage -> select the ZIP and reboot.
33+
The module copies `libnexmon.so` into `/data/adb/modules/<module>/lib*/` and ensures SELinux labels are correct.
34+
3. Verify installation:
35+
```bash
36+
ls -lZ $(find / -name libnexmon.so 2>/dev/null)
37+
sha1sum $(which nexutil)
38+
```
39+
40+
---
41+
42+
## Configuring Hijacker
43+
Hijacker can toggle monitor mode automatically before running `airodump`, `wifite`, etc. In **Settings -> Advanced** add the following entries (edit the library path if your module differs):
44+
45+
```
46+
Prefix:
47+
LD_PRELOAD=/data/user/0/com.hijacker/files/lib/libnexmon.so
48+
49+
Enable monitor mode:
50+
svc wifi disable; ifconfig wlan0 up; nexutil -s0x613 -i -v2
51+
52+
Disable monitor mode:
53+
nexutil -m0; svc wifi enable
54+
```
55+
56+
Enable “Start monitor mode on airodump start” so every Hijacker scan happens in native monitor mode (`wlan0` instead of `wlan0mon`).
57+
58+
If Hijacker shows errors at launch, create the required directory on shared storage and reopen the app:
59+
```bash
60+
mkdir -p /storage/emulated/0/Hijacker
61+
```
62+
63+
### What do those `nexutil` flags mean?
64+
* **`-s0x613`** Write firmware variable 0x613 (FCAP_FRAME_INJECTION) → `1` (enable TX of arbitrary frames).
65+
* **`-i`** Put interface in monitor mode (radiotap header will be prepended).
66+
* **`-v2`** Set verbose level; `2` prints confirmation and firmware version.
67+
* **`-m0`** Restore managed mode (used in the *disable* command).
68+
69+
After running *Enable monitor mode* you should see the interface in monitor state and be able to capture raw frames with:
70+
```bash
71+
airodump-ng --band abg wlan0
72+
```
73+
74+
---
75+
76+
## Manual one-liner (without Hijacker)
77+
```bash
78+
# Enable monitor + injection
79+
svc wifi disable && ifconfig wlan0 up && nexutil -s0x613 -i -v2
80+
81+
# Disable and return to normal Wi-Fi
82+
nexutil -m0 && svc wifi enable
83+
```
84+
85+
If you only need passive sniffing, omit the `-s0x613` flag.
86+
87+
---
88+
89+
## Using `libnexmon` inside Kali NetHunter / chroot
90+
Stock user-space tools in Kali do not know about NexMon, but you can force them to use it via `LD_PRELOAD`:
91+
92+
1. Copy the pre-built shared object into the chroot:
93+
```bash
94+
cp /sdcard/Download/kalilibnexmon.so <chroot>/lib/
95+
```
96+
2. Enable monitor mode from the **Android host** (command above or through Hijacker).
97+
3. Launch any wireless tool inside Kali with the preload:
98+
```bash
99+
sudo su
100+
export LD_PRELOAD=/lib/kalilibnexmon.so
101+
wifite -i wlan0 # or aircrack-ng, mdk4 …
102+
```
103+
4. When finished, disable monitor mode as usual on Android.
104+
105+
Because the firmware already handles radiotap injection, user-space tools behave just like on an external Atheros adapter.
106+
107+
---
108+
109+
## Typical Attacks Possible
110+
Once monitor + TX is active you can:
111+
* Capture WPA(2/3-SAE) handshakes or PMKID with `wifite`, `hcxdumptool`, `airodump-ng`.
112+
* Inject deauthentication / disassociation frames to force clients to reconnect.
113+
* Craft arbitrary management/data frames with `mdk4`, `aireplay-ng`, Scapy, etc.
114+
* Build rogue APs or perform KARMA/MANA attacks directly from the phone.
115+
116+
Performance on the Galaxy S10 is comparable to external USB NICs (~20 dBm TX, 2-3 M pps RX).
117+
118+
---
119+
120+
## Troubleshooting
121+
* `Device or resource busy` – make sure **Android Wi-Fi service is disabled** (`svc wifi disable`) before enabling monitor mode.
122+
* `nexutil: ioctl(PRIV_MAGIC) failed` – the library is not pre-loaded; double-check `LD_PRELOAD` path.
123+
* Frame injection works but no packets captured – some ROMs hard-block channels; try `nexutil -c <channel>` or `iwconfig wlan0 channel <n>`.
124+
* SELinux blocking library – set device to *Permissive* or fix module context: `chcon u:object_r:system_lib_file:s0 libnexmon.so`.
125+
126+
---
127+
128+
## References
129+
* [Hijacker on the Samsung Galaxy S10 with wireless injection](https://forums.kali.org/t/hijacker-on-the-samsung-galaxy-s10-with-wireless-injection/10305)
130+
* [NexMon – firmware patching framework](https://github.com/seemoo-lab/nexmon)
131+
* [Hijacker (aircrack-ng GUI for Android)](https://github.com/chrisk44/Hijacker)
132+
133+
{{#include ../../banners/hacktricks-training.md}}

src/mobile-pentesting/android-app-pentesting/reversing-native-libraries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ Java.perform(function () {
6161
});
6262
});
6363
```
64-
Frida will work out of the box on PAC/BTI-enabled devices (Pixel 8/Android 14+) as long as you use frida-server 16.2 or later – earlier versions failed to locate padding for inline hooks. citeturn5search2turn5search0
64+
Frida will work out of the box on PAC/BTI-enabled devices (Pixel 8/Android 14+) as long as you use frida-server 16.2 or later – earlier versions failed to locate padding for inline hooks.
6565

6666
---
6767

6868
### Recent vulnerabilities worth hunting for in APKs
6969

7070
| Year | CVE | Affected library | Notes |
7171
|------|-----|------------------|-------|
72-
|2023|CVE-2023-4863|`libwebp` ≤ 1.3.1|Heap buffer overflow reachable from native code that decodes WebP images. Several Android apps bundle vulnerable versions. When you see a `libwebp.so` inside an APK, check its version and attempt exploitation or patching.| citeturn2search0|
72+
|2023|CVE-2023-4863|`libwebp` ≤ 1.3.1|Heap buffer overflow reachable from native code that decodes WebP images. Several Android apps bundle vulnerable versions. When you see a `libwebp.so` inside an APK, check its version and attempt exploitation or patching.| |
7373
|2024|Multiple|OpenSSL 3.x series|Several memory-safety and padding-oracle issues. Many Flutter & ReactNative bundles ship their own `libcrypto.so`.|
7474

7575
When you spot *third-party* `.so` files inside an APK, always cross-check their hash against upstream advisories. SCA (Software Composition Analysis) is uncommon on mobile, so outdated vulnerable builds are rampant.
@@ -92,7 +92,7 @@ When you spot *third-party* `.so` files inside an APK, always cross-check their
9292

9393
### References
9494

95-
- Frida 16.x change-log (Android hooking, tiny-function relocation) – [frida.re/news](https://frida.re/news/) citeturn5search0
96-
- NVD advisory for `libwebp` overflow CVE-2023-4863 – [nvd.nist.gov](https://nvd.nist.gov/vuln/detail/CVE-2023-4863) citeturn2search0
95+
- Frida 16.x change-log (Android hooking, tiny-function relocation) – [frida.re/news](https://frida.re/news/)
96+
- NVD advisory for `libwebp` overflow CVE-2023-4863 – [nvd.nist.gov](https://nvd.nist.gov/vuln/detail/CVE-2023-4863)
9797

9898
{{#include ../../banners/hacktricks-training.md}}

src/mobile-pentesting/ios-pentesting/ios-pentesting-without-jailbreak.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Recent Frida releases (>=16) automatically handle pointer authentication and oth
106106

107107
### Automated dynamic analysis with MobSF (no jailbreak)
108108

109-
[MobSF](https://mobsf.github.io/Mobile-Security-Framework-MobSF/) can instrument a dev-signed IPA on a real device using the same technique (`get_task_allow`) and provides a web UI with filesystem browser, traffic capture and Frida console【turn6view0†L2-L3】. The quickest way is to run MobSF in Docker and then plug your iPhone via USB:
109+
[MobSF](https://mobsf.github.io/Mobile-Security-Framework-MobSF/) can instrument a dev-signed IPA on a real device using the same technique (`get_task_allow`) and provides a web UI with filesystem browser, traffic capture and Frida console【†L2-L3】. The quickest way is to run MobSF in Docker and then plug your iPhone via USB:
110110

111111
```bash
112112
docker pull opensecurity/mobile-security-framework-mobsf:latest

src/pentesting-web/sql-injection/ms-access-sql-injection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Point the UNC path to:
141141
* a host that drops the TCP handshake after `SYN-ACK`
142142
* a firewall sinkhole
143143

144-
The extra seconds introduced by the remote lookup can be used as an **out-of-band timing oracle** for boolean conditions (e.g. pick a slow path only when the injected predicate is true). Microsoft documents the remote database behaviour and the associated registry kill-switch in KB5002984. citeturn1search0
144+
The extra seconds introduced by the remote lookup can be used as an **out-of-band timing oracle** for boolean conditions (e.g. pick a slow path only when the injected predicate is true). Microsoft documents the remote database behaviour and the associated registry kill-switch in KB5002984.
145145

146146
### Other Interesting functions
147147

@@ -229,7 +229,7 @@ Mitigations (recommended even for legacy Classic ASP apps):
229229
* Block outbound SMB/WebDAV at the network boundary.
230230
* Sanitize / parameterise any part of a query that may end up inside an `IN` clause.
231231
232-
The forced-authentication vector was revisited by Check Point Research in 2023, proving it is still exploitable on fully patched Windows Server when the registry key is absent. citeturn0search0
232+
The forced-authentication vector was revisited by Check Point Research in 2023, proving it is still exploitable on fully patched Windows Server when the registry key is absent.
233233
234234
### .mdb Password Cracker
235235

0 commit comments

Comments
 (0)