Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ All notable changes to `claude-red` are documented here. The library follows a p

### Changed

- Expanded `offensive-z-wave` with the S0 downgrade attack (Z-Shave), a Detection / Defender View table, a Mitigations / Hardening section, MITRE ATT&CK for ICS mappings, and cited references (Fouladi & Ghanoun, Black Hat USA 2013; Pen Test Partners Z-Shave, 2018).
- Expanded `offensive-deauth-disassoc` with a Mitigations / Defender Hardening section (PMF-Required / WPA3 enforcement, WIPS tuning, MFPR verification) and MITRE ATT&CK mappings (T1498, T1557, T1040).
- Expanded `offensive-krack-fragattacks` with a Detection / Defender View, a Mitigations / Defender Hardening section (patch, segment unpatchable IoT, PMF/WPA3, TLS-everywhere), and MITRE ATT&CK mappings (T1557, T1040, T1498).
- Added a Blue Team / Defender View section to `offensive-advanced-redteam` mapping each technique (domain aging, redirectors, malleable C2, DNS exfil, AMSI/ETW patching, unhooking, LOLBins, log clearing) to its detection signal and control, for purple-team debriefs.
- Added Detection / Defender View, Mitigations / Hardening, MITRE ATT&CK mappings (T1056.001, T1056.004, T1041), and a cited Key References section to `offensive-keylogger-arch`.
- Replaced an inactive EXIF viewer reference in `offensive-osint` with a browser-local metadata viewer and added evidence-corroboration guidance.

### Fixed

- Corrected non-existent commands in `offensive-z-wave`: replaced the fabricated `ezwave-sniff` / `ezwave-test` invocations with the real EZ-Wave tools (`ezstumbler.py`, `ezrecon.py`), fixed the EZ-Wave repo link to the canonical `scriptingxss/EZ-Wave`, clarified that the 32-bit HomeID space makes brute-force infeasible, and flagged the Scapy-Radio zwave class/field names as version-dependent.
- Corrected mislabeled `mdk4` modes in `offensive-deauth-disassoc`: mode `m` is Michael/TKIP countermeasures (not a "CTS/virtual-carrier" attack) and mode `w` is WIDS confusion (not an "SAE/WPA-Enterprise flood"); replaced those lines with accurate mode `a`/`e`/`m` usage and fixed the version-dependent deauth filter flag.
- Corrected the FragAttacks invocation in `offensive-krack-fragattacks` and `offensive-wifi`: the real script is `fragattack.py <iface> <test-name>`, not the non-existent `test-fragattacks.py`; noted the harness requires the target network credentials.
- Fixed fabricated / misattributed tool repos in `offensive-lorawan-sub-ghz`: replaced the non-existent `IoTsec/loraserver-attack-tools` with IOActive's LoRaWAN Auditing Framework (`IOActive/laf`) + Loracrack, and the invalid `AndrewMohawk/RollingPwn` with the correctly-attributed Rolling-PWN advisory (Kevin2600 & Wesley Li, Star-V Lab; CVE-2021-46145).
- Fixed the BLE MITM example in `offensive-bluetooth-ble`: `btproxy` is Bluetooth Classic/SPP only (canonical repo `conorpp/btproxy`, not the `Charmve` mirror) and cannot do BLE — replaced with Mirage `ble_mitm` and noted GATTacker / BtleJuice as BLE alternatives.
- Fixed the Dragonblood tooling in `offensive-wpa3-sae`: `dragondrain` / `dragontime` are not Python scripts and do not live in `vanhoefm/dragonblood` (website only) — they are compiled C tools in `vanhoefm/dragondrain-and-time` (built with `make`); corrected the clone, invocations, and references (added dragonslayer).
- Fixed the Z3sec commands in `offensive-zigbee-thread-matter`: the real CLI is `z3sec_touchlink --sdr -c <ch> reset/update --target <ext-addr>` (requiring the ZLL master key in `~/.config/z3sec/touchlink_crypt.ini`), not the non-existent `z3sec_inter_pan.py --command ...`.
- Corrected FreeMarker resolver prerequisites, Velocity constructor lookup, the PHP 8.0 PHAR boundary, and Apollo Sandbox's introspection requirement.
- Corrected the Touchlink master key and key derivation terminology in the IoT and wireless skills, and distinguished PLC identity documents from operation logs.
- Clarified JWT critical-header validation and signing prerequisites; corrected SQL/JSON WAF examples and their attribution to Team82's 2022 research.
Expand Down
19 changes: 19 additions & 0 deletions Skills/infrastructure/offensive-advanced-redteam/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,25 @@ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe payload.xml

---

## Blue Team / Defender View

The whole point of adversary simulation is to make the defense better. For every technique in this skill, here is what a mature defender can see and the control that blunts it — hand this table to the blue team during the purple-team debrief.

| Offensive technique (this skill) | Detection signal | Control that stops / raises cost |
|---|---|---|
| Domain categorization / aging | Newly-categorized domain with near-zero history contacted by an internal host | DNS/proxy reputation + newly-seen-domain alerting; block uncategorized + freshly-registered domains |
| Redirectors / traffic filtering | Beacon-like periodicity to a CDN or "business" domain; JA3/JA3S mismatch | TLS fingerprint (JA3) baselining; egress proxy with inspection; alert on long-lived periodic flows |
| Malleable C2 profile blending | HTTP(S) that mimics M365 but to the wrong tenant/endpoint; consistent byte sizes | Known-good SaaS endpoint allow-listing; NetFlow beacon analysis (RITA-style) |
| Sleep / jitter / fallback channels | Low-and-slow periodic callbacks; sudden channel switch (HTTP→DNS) | Long-window beacon detection; alert when a host starts high-volume DNS TXT |
| DNS exfiltration (TXT chunking) | High entropy, high-volume TXT queries to one domain | DNS query-length/volume thresholds; block or sinkhole; DNS logging to SIEM |
| AMSI patching | `amsi.dll` in-memory modification; AMSI bypass behavioral signatures | AMSI + EDR behavioral detection; alert on self-patching of security DLLs |
| ETW patching | ETW provider going silent on an active process; `ntdll` ETW stubs modified | EDR tamper-protection; monitor for ETW blinding |
| Unhooking / direct syscalls | Syscall instructions from non-`ntdll` memory; missing userland hooks | Kernel-telemetry EDR (not just userland hooks); call-stack validation |
| LOLBins (certutil, mshta, MSBuild) | Signed binary spawning network/child-process it never normally does | LOLBAS-informed detection rules; application control (WDAC/AppLocker); block unused LOLBins |
| Indicator cleanup / log clearing | Event-log gaps; `1102` (log cleared); deleted-artifact timeline holes | Ship logs off-host in real time; alert on log clears; immutable log store |

Purple-team framing: the deliverable is not "we got in" — it is **which of these rows alerted, which didn't, and what the blue team will change**. Track each row as detected / partial / missed in the debrief.

## Reporting

The report is the primary deliverable of a red team engagement. It must communicate
Expand Down
42 changes: 42 additions & 0 deletions Skills/infrastructure/offensive-keylogger-arch/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,48 @@ its a syscall so you can use your favorite \*gate technique on it

---

## Detection / Defender View

Each technique above lists per-method IOCs; this consolidates them into what a defender actually monitors.

| Capture technique | Primary detection signal | Telemetry source |
|---|---|---|
| `SetWindowsHookEx` (WH_KEYBOARD_LL) | Process calling `SetWindowsHookEx` with a global hook; DLL injected into many processes | EDR API telemetry; Sysmon image-load (Event ID 7) into unexpected processes |
| `NtUserSetWindowsHookEx` (direct syscall) | Syscall to the hook routine bypassing the documented `user32` path | Kernel-telemetry EDR; call-stack origin outside `user32.dll` |
| `RegisterRawInputDevices` / raw input | Process registering for raw keyboard input that has no UI reason to | API-hook telemetry; behavioral baselining of input-registration |
| Foreground-window polling (`GetWindowText`, `NtUserInternalGetWindowText`) | Tight polling of foreground window title by a background process | Process behavior; high-frequency window-query pattern |
| Local staging before exfil | Growing hidden file / registry blob of captured text | File/registry write monitoring; DLP on keystroke-shaped data |

Defender takeaway: user-mode keyloggers are **loud to a behavioral EDR** even when they evade static signatures — the tell is *a background process subscribing to global input*. Hunt for the subscription, not the payload.

## Mitigations / Hardening

| Technique | Mitigation |
|---|---|
| Global hook / API-hook keylogging | EDR with tamper-protected API telemetry; alert on global `SetWindowsHookEx` from non-UI processes |
| Direct-syscall hook installation | Kernel-mode telemetry (not userland-hook-only EDR); call-stack validation |
| Raw input capture | Behavioral detection of input-device registration; least-privilege so untrusted code can't run |
| Credential theft via keylogging | Enforce MFA / FIDO2 hardware keys so captured passwords alone are insufficient; use OS credential vaults and autofill instead of typing secrets |
| Persistence of the keylogger | Application control (WDAC/AppLocker); block unsigned user-mode drivers; Protected Process Light for sensitive apps |

Defender one-liner: **behavioral EDR + application control + phishing-resistant MFA** turns a working keylogger into low-value noise — the keystrokes it steals no longer unlock anything.

## MITRE ATT&CK Mapping

| Technique | ID |
|---|---|
| Input Capture: Keylogging | T1056.001 |
| Input Capture: Credential API Hooking | T1056.004 |
| Exfiltration Over C2 Channel | T1041 |

## Key References

- MITRE ATT&CK — Input Capture: Keylogging (T1056.001): https://attack.mitre.org/techniques/T1056/001/
- MITRE ATT&CK — Credential API Hooking (T1056.004): https://attack.mitre.org/techniques/T1056/004/
- Microsoft Learn — `SetWindowsHookEx` / low-level keyboard hooks: https://learn.microsoft.com/windows/win32/winmsg/about-hooks
- Microsoft Learn — Raw Input (`RegisterRawInputDevices`): https://learn.microsoft.com/windows/win32/inputdev/raw-input
- Sysmon configuration for image-load / API monitoring: https://github.com/SwiftOnSecurity/sysmon-config

# Novel research

Now... that's all stuff that can be figured out by anyone determined
Expand Down
11 changes: 6 additions & 5 deletions Skills/wireless/offensive-bluetooth-ble/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ For LE Legacy Pairing with Just Works, crackle recovers the LTK in seconds. For
## Active MITM During Pairing

```bash
# btproxy / mirage-action-with-mitm — relay between device and victim's phone
mirage-action-with-mitm
# Or:
git clone https://github.com/Charmve/btproxy
sudo python btproxy.py
# BLE MITM relay between the device and the victim's phone.
# Use a BLE-capable framework — Mirage (RCayre) is the modern choice:
sudo mirage "ble_mitm|INTERFACE1=hci0|INTERFACE2=hci1" # see Mirage docs for parameters
# Alternatives: GATTacker, BtleJuice.
# NOTE: conorpp/btproxy is Bluetooth *Classic/SPP* only and does NOT support BLE —
# the "Charmve/btproxy" repo is just a mirror; do not use it for BLE.
```

If pairing is Just Works, you become the legitimate peer for both sides — read/modify GATT operations in real time.
Expand Down
61 changes: 50 additions & 11 deletions Skills/wireless/offensive-deauth-disassoc/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ sudo aireplay-ng --deauth 5 \
sudo aireplay-ng --deauth 0 -a AA:BB:CC:DD:EE:FF wlan0mon
# --deauth 0 = continuous

# Multiple APs from a list
sudo mdk4 wlan0mon d -B target_bssids.txt -c 1,6,11
# Multiple APs across channels (mode d = deauth/disassoc amok).
# Flag for a MAC filter file is version-dependent: -w (whitelist) / -b (blacklist).
# Confirm with `mdk4 --help d` before use; -c takes the channel hop list.
sudo mdk4 wlan0mon d -b target_macs.txt -c 1,6,11
```

Only with explicit authorization. Continuous broadcast deauth is a clear DoS signal and trips most WIPS within seconds.
Expand All @@ -62,14 +64,24 @@ sudo airodump-ng wlan0mon -c <ch> --bssid <BSSID>

PMF protects deauth/disassoc but doesn't always protect all action frames. Specific action types remain exploitable:

PMF protects deauth/disassoc, but other mdk4 modes still cause disconnects without spoofing a protected management frame. Verify mode letters against `mdk4 --help <mode>` on your installed version — they have been mislabeled in many copied cheatsheets.

```bash
# mdk4 multi-tool attacks
sudo mdk4 wlan0mon a -a <BSSID> # auth attack: floods auth frames, AP eventually disconnects clients
sudo mdk4 wlan0mon m -t <BSSID> # CTS frame attack — abuse virtual carrier sense
sudo mdk4 wlan0mon w -t <BSSID> # WPA-Enterprise: SAE auth flood
# mode a — authentication DoS: floods the AP with auth frames, exhausting its
# client/association table so legitimate clients can't connect. Works regardless of PMF.
sudo mdk4 wlan0mon a -a <BSSID>

# mode e — EAPOL start/logoff flood: can kick clients off; not a spoofed deauth frame.
sudo mdk4 wlan0mon e -t <BSSID>

# mode m — Michael (TKIP) countermeasures: forces a ~60s AP shutdown.
# ONLY applies to legacy TKIP networks, not CCMP/WPA2-AES or WPA3.
sudo mdk4 wlan0mon m -t <BSSID>
```

Action frames the IEEE 802.11 spec marks as "may be unprotected" include some block-ack and channel-switch announcements — implementation-specific exploitation paths exist but require chipset-specific testing.
> Correction vs. common cheatsheets: mdk4 mode `m` is **Michael/TKIP countermeasures**, not a "CTS/virtual-carrier" attack, and mode `w` is **WIDS confusion**, not an "SAE/WPA-Enterprise flood" (SAE is WPA3). Don't rely on those mislabeled one-liners.

Separately, the IEEE 802.11 spec marks some action frames (certain block-ack and channel-switch announcements) as "may be unprotected" — implementation-specific paths exist but require chipset-specific testing.

## Beacon Flooding

Expand All @@ -96,6 +108,23 @@ Use cases:

Randomize source MAC across burst-and-pause cycles to spread the signal.

## Mitigations / Defender Hardening

This is the counter. Deauth/disassoc abuse is a *solved* problem at the protocol level — the gap is deployment, not defense:

| Technique | Mitigation |
|---|---|
| Classic deauth/disassoc spoofing | **Set PMF (802.11w) to Required**, not just Capable. Required cryptographically authenticates management frames and makes classic deauth inert |
| PMF left Capable/optional | Audit every SSID; Capable still lets non-PMF clients be deauthed. Move to Required once the client fleet supports it |
| Legacy clients blocking PMF-Required | Segment legacy devices onto a separate SSID/VLAN so the main network can enforce Required |
| Protocol gap entirely | **Deploy WPA3** — PMF is mandatory in WPA3, closing the deauth vector by default |
| Action-frame / auth-flood attacks | Enable WIPS containment + rate-limit auth/assoc; patch AP firmware for known management-frame floods |
| Beacon flood hiding an evil twin | WIPS rogue-AP detection tuned to alert (not just dashboard); 802.11r/k/v for sane roaming so a rogue SSID is less attractive |

Defender one-liner: **PMF-Required (or WPA3) + a tuned WIPS** removes the classic deauth vector outright and turns the remaining action-frame paths into loud, chipset-specific noise.

Verification step a blue team can run: confirm the RSN capabilities bit advertises **MFPR (Management Frame Protection Required)**, not just MFPC (Capable), in the beacon of every production SSID.

## Engagement Cheatsheet

```bash
Expand Down Expand Up @@ -123,10 +152,20 @@ Document for each test:

---

## MITRE ATT&CK Mapping

| Technique | ID | Where it appears here |
|---|---|---|
| Network Denial of Service | T1498 | Broadcast / continuous deauth; auth and beacon floods |
| Adversary-in-the-Middle | T1557 | Deauth to drive clients onto an evil twin |
| Network Sniffing | T1040 | Forcing reconnection to capture the WPA handshake |

## Key References

- aireplay-ng documentation
- mdk4: github.com/aircrack-ng/mdk4
- IEEE 802.11w-2009 (PMF spec, now folded into 802.11-2020)
- "Why MAC Address Randomization Doesn't Work" — research on action-frame leakage
- aireplay-ng documentation: https://www.aircrack-ng.org/doku.php?id=aireplay-ng
- mdk4: https://github.com/aircrack-ng/mdk4
- IEEE 802.11w-2009 — Protected Management Frames (now folded into IEEE 802.11-2020)
- Wi-Fi Alliance — WPA3 specification (PMF mandatory): https://www.wi-fi.org/discover-wi-fi/security
- "Why MAC Address Randomization Doesn't Work" — research on action-frame / probe leakage
- MITRE ATT&CK: https://attack.mitre.org/techniques/T1498/
- Source: https://github.com/SnailSploit/offensive-checklist/blob/main/wireless.md
43 changes: 36 additions & 7 deletions Skills/wireless/offensive-krack-fragattacks/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ FragAttacks abuse 802.11 fragmentation and aggregation to inject frames that mix

```bash
git clone https://github.com/vanhoefm/fragattacks
cd fragattacks
sudo ./test-fragattacks.py wlan0 --interface wlan0
# Suite of ~12 tests covering each variant
cd fragattacks && make # builds the modified hostap/wpa_supplicant

# Run one test at a time: ./fragattack.py <iface> <test-name>
# Test names (ping, ping-frag-sep, amsdu-inject, linux-plain, ...) are in the README.
sudo ./fragattack.py wlan0 ping-frag-sep
```

> The script is `fragattack.py` (singular), invoked as `fragattack.py <iface> <test-name>` — **not** `test-fragattacks.py --interface …` (a name that only appears in copied cheatsheets). The harness needs the target network's credentials, so it tests a client/AP you control rather than attacking a blind target.

| CVE | Mechanism |
|---|---|
| CVE-2020-24588 | A-MSDU spoofing — inject crafted A-MSDU subframes |
Expand Down Expand Up @@ -88,11 +92,28 @@ sudo aireplay-ng --deauth 5 -a <real-BSSID> -c <client-MAC> wlan0mon
sudo ./krack-test-client.py --interface wlan0
```

## Detection
## Detection / Defender View

- WIPS may flag the **deauth-driven roam** to the attacker AP — this is the loudest, most reliable signal, since exploitation itself is near-silent.
- Vanhoef's test scripts generate distinctive frame patterns; modern WIPS signatures recognize the tooling.
- Successful exploitation is essentially silent at the protocol level — so detection leans on the *setup* (rogue AP, forced roam), not the exploit.
- An unexpected A-MSDU / fragmented-frame mix from a client that normally doesn't fragment is an anomaly worth hunting if you have frame-level capture.

- WIPS may flag deauth-driven roams to attacker AP
- Test scripts generate distinctive frame patterns; modern WIPS recognizes Vanhoef's tooling
- Successful exploitation is essentially silent at protocol level
Blue-team takeaway: you will rarely catch the exploit; you catch the **rogue AP + forced association** that precedes it. Monitor for both.

## Mitigations / Defender Hardening

The counter — and for these families it is decisive, because both are patched upstream:

| Technique | Mitigation |
|---|---|
| KRACK key reinstallation | **Patch the supplicant** — every major OS has shipped fixes since 2017–2018. This closes it outright |
| FragAttacks splicing/aggregation | Patch client and AP firmware (2021–2022 fixes); ensure the stack drops plaintext frames inside a protected network (CVE-2020-26140/26139 are acceptance bugs) |
| Unpatchable embedded / IoT long tail | Inventory them; **segment onto an isolated VLAN/SSID** carrying no sensitive traffic; deny inter-VLAN routing |
| Forced-roam precondition | Enforce **PMF-Required / WPA3** so the attacker cannot deauth the client onto a rogue AP in the first place (see `offensive-deauth-disassoc`) |
| Residual injection impact (DNS poison, HTTP redirect) | Defense-in-depth: enforce HTTPS/HSTS and encrypted DNS so a spliced frame can't downgrade traffic to plaintext |

Defender one-liner: **patch + segment the unpatchable + PMF/WPA3 + TLS-everywhere** reduces KRACK/FragAttacks from a decryption-and-inject primitive to a dead end on anything that matters.

## Reporting

Expand All @@ -105,6 +126,14 @@ For each vulnerable CVE:

---

## MITRE ATT&CK Mapping

| Technique | ID | Where it appears here |
|---|---|---|
| Adversary-in-the-Middle | T1557 | Rogue AP + frame injection (HTTP redirect, DNS poison) |
| Network Sniffing | T1040 | Decryption of WPA2 frames via key reinstallation |
| Network Denial of Service | T1498 | Deauth used to force the client onto the attacker AP |

## Key References

- KRACK: krackattacks.com (Vanhoef)
Expand Down
Loading