Metadata-Version: 2.4
Name: atwa-nh
Version: 0.1.2
Summary: ATWA-NG for NetHunter: lightweight CLI-only WiFi test suite for Kali NetHunter
Author: KiMiGuel
License-Expression: MIT
Keywords: nethunter,wifi,80211,atwa-ng
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: scapy>=2.5
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/KiMiGuel/ATWA-NH/main/docs/assets/kali-nethunter-logo.svg" alt="Kali NetHunter" width="150">
  <img src="https://raw.githubusercontent.com/KiMiGuel/ATWA-NH/main/docs/assets/atwa-ng-logo.png" alt="ATWA-NG" width="110">
</p>

# ATWA-NH — ATWA-NG for NetHunter

[![PyPI](https://img.shields.io/pypi/v/atwa-nh.svg)](https://pypi.org/project/atwa-nh/)
[![Python](https://img.shields.io/pypi/pyversions/atwa-nh.svg)](https://pypi.org/project/atwa-nh/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![CI](https://github.com/KiMiGuel/ATWA-NH/actions/workflows/workflow.yml/badge.svg)](https://github.com/KiMiGuel/ATWA-NH/actions/workflows/workflow.yml)

A lightweight, CLI-only port of [ATWA-NG](https://github.com/KiMiGuel/ATWA-NG)
for Kali NetHunter. It runs inside the ARM64 Kali chroot from NetHunter
Terminal, uses a detected monitor-capable USB adapter, and leaves Android Wi-Fi
(`wlan0`) and its vendor supplicant untouched.

No GUI. No password cracking. No vendored x86 binaries.

> [!WARNING]
> By default ATWA-NH refuses the conventional Android STA interface (`wlan0`)
> and does not run `airmon-ng check kill`, `svc wifi disable`, or change the
> global regulatory domain. `--allow-sta` overrides that protection, but the
> interface must still support monitor mode.

## Quick start

**1. Install inside the Kali chroot**

```sh
python3 -m pip install atwa-nh
```

This installs `scapy` automatically and creates the `atwa-nh` command. To
install from source instead:

```sh
git clone https://github.com/KiMiGuel/ATWA-NH.git
cd ATWA-NH
sh install.sh
```

The source installer copies `atwa_nh` into the chroot's site-packages. It needs
`scapy` already installed and writes nothing to `/system` or `/sdcard`.

**2. Check it works**

```sh
atwa-nh --help
```

**3. Run it**

```sh
atwa-nh              # numbered menu (needs a terminal)
atwa-nh scan --iface wlan1
```

The menu lists the seven commands plus `0) Exit`, prompts only for the values
each command needs, and uses ATWA-NG's electric-blue palette. Set `NO_COLOR` or
pipe the output to get plain text.

## NetHunter Custom Command

In the NetHunter app, add a **Custom Command** with the absolute module path —
the app does not inherit the chroot's `PATH`:

```sh
/usr/bin/python3 -m atwa_nh scan --iface wlan1
```

Replace `wlan1` with the adapter reported by the capability probe. See
[docs/nethunter.md](docs/nethunter.md) for the full steps.

## Commands

| Command | What it does | Main options |
|---|---|---|
| `scan` | Discover access points | `--iface`, `--duration`, `--managed` |
| `wps-recon` | Filter APs advertising WPS | `--iface`, `--duration`, `--managed` |
| `eapol-hunt` | Collect EAPOL frames in monitor mode | `--iface`, `--duration` |
| `handshake` | Capture a 4-way handshake | `--iface`, `--duration` |
| `pmkid` | Capture PMKIDs | `--iface`, `--duration` |
| `deauth` | Inject deauthentication frames | `--iface`, `--bssid`, `--client`, `--count` |
| `verify-capture` | Check a capture for EAPOL traffic | `--iface`, `--file` |

Every on-air command accepts `--iface` and `--allow-sta`. Interface names vary
between devices, so selection is based on the PHY's monitor capability, not a
hardcoded name. The conventional STA name is protected by default;
`--allow-sta` opts out deliberately. `scan` and `wps-recon` use
`iw dev <iface> scan` automatically when the adapter is in managed mode, and
`--managed` forces it.

> [!NOTE]
> `deauth` reports `verified=False` until delivery is confirmed by ACK counters,
> TX status, or a second sniffer. `sendp()` accepting a frame is not proof of
> injection. Treat it as unproven on-air until verified.

## Adapters

| Adapter | Status |
|---|---|
| AR9271 (`ath9k_htc`) | Reference adapter — managed scan, monitor, `frame` TX status |
| MT7610U (`mt76`) | Validated dual-band — managed scan, monitor, `frame` |
| RTL8814AU | Experimental — capability-probed at runtime |
| RTL8811AU | Retired — managed scan reboots the kernel |

Injection is gated on the adapter's `frame` nl80211 command. Captures land in
`/sdcard/nh_files/atwa-ng` when available, otherwise `$HOME/.atwa-nh` in the
chroot.

## Tests

```sh
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest tests/ -q
```

The environment variable avoids a broken host-level `logfire` pytest plugin;
it is not needed inside the clean chroot.

## Provenance

ATWA-NH is a separate, reduced port of ATWA-NG — no GUI, no cracker, no desktop
dependencies. `scan_managed` was adapted from ATWA-NG @
`31acd35b4269bdb08c3bf7e463a54c2be438a0f5`; the beacon/EAPOL parsing here is a
deliberately minimal local implementation, vendored as a pinned snapshot. No
shared-library refactor with ATWA-NG is planned yet.

NetHunter is a Kali Linux project; the NetHunter logo is used to identify the
platform. The ATWA-NG mark comes from the ATWA-NG project.

## License

MIT — see [LICENSE](LICENSE).
