Skip to content

Commit a0b4ff2

Browse files
committed
UI: new Terminal UI, available with '--tui' switch
1 parent a9be446 commit a0b4ff2

29 files changed

Lines changed: 5551 additions & 26 deletions

docs/TUI_README.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Wifite2 Interactive TUI
2+
3+
Wifite2 now includes an optional Interactive Text User Interface (TUI) that provides real-time updates and a modern terminal experience.
4+
5+
## Features
6+
7+
### Scanner View
8+
- **Live target updates** - See networks appear in real-time as they're discovered
9+
- **Color-coded information** - Signal strength (green/yellow/red) and encryption types
10+
- **Scan statistics** - Track targets by encryption type, client count, and elapsed time
11+
- **No scrolling** - All information updates in place
12+
13+
### Selector View
14+
- **Interactive selection** - Navigate and select targets with keyboard
15+
- **Visual feedback** - See your selections highlighted
16+
- **Keyboard shortcuts** - Quick selection with single keys
17+
- **Scrolling support** - Handle large target lists efficiently
18+
19+
### Attack View
20+
- **Real-time progress** - Watch attack progress with live updates
21+
- **Attack-specific metrics** - See relevant stats for each attack type
22+
- WEP: IVs collected, crack attempts, replay status
23+
- WPA: Handshake status, clients, deauth packets
24+
- WPS: PIN attempts, pixie dust status, lockout detection
25+
- PMKID: Capture attempts and status
26+
- **Scrollable logs** - Review detailed attack logs
27+
- **Progress bars** - Visual progress indicators
28+
29+
## Usage
30+
31+
### Enable TUI Mode
32+
33+
```bash
34+
# Auto-detect (uses TUI if terminal supports it)
35+
sudo wifite
36+
37+
# Force TUI mode
38+
sudo wifite --tui
39+
40+
# Force classic text mode
41+
sudo wifite --no-tui
42+
```
43+
44+
### Keyboard Shortcuts
45+
46+
#### Scanner View
47+
- `Ctrl+C` - Stop scanning and select targets
48+
- `?` - Show help
49+
50+
#### Selector View
51+
- `↑/↓` - Navigate up/down (Note: May be unreliable, use alternatives)
52+
- `Space` - Toggle target selection
53+
- `Enter` - Confirm selection and start attack
54+
- `a` - Select all targets
55+
- `n` - Deselect all targets
56+
- `q` - Quit
57+
- `?` - Show help
58+
59+
#### Attack View
60+
- `Ctrl+C` - Skip current target
61+
- `?` - Show help
62+
63+
## Requirements
64+
65+
- Python 3.6+
66+
- `rich` library (automatically installed with wifite2)
67+
- Terminal with minimum size: 80x24
68+
- Color support (optional but recommended)
69+
70+
## Configuration
71+
72+
TUI settings can be configured in `wifite/config.py`:
73+
74+
```python
75+
use_tui = None # None=auto, True=force TUI, False=force classic
76+
tui_refresh_rate = 0.5 # Seconds between updates
77+
tui_log_buffer_size = 1000 # Max log entries
78+
tui_debug = False # Enable debug logging
79+
```
80+
81+
## Troubleshooting
82+
83+
### TUI Won't Start
84+
85+
**Problem:** TUI mode requested but falls back to classic mode
86+
87+
**Solutions:**
88+
- Check terminal size: `echo $COLUMNS x $LINES` (minimum 80x24)
89+
- Verify rich library: `python3 -c "import rich; print(rich.__version__)"`
90+
- Check TERM variable: `echo $TERM` (should not be 'dumb')
91+
- Try forcing TUI: `sudo wifite --tui`
92+
93+
### Terminal Too Small
94+
95+
**Problem:** Error about terminal size
96+
97+
**Solution:** Resize your terminal window to at least 80 columns by 24 rows
98+
99+
### Arrow Keys Not Working
100+
101+
**Known Issue:** Arrow key navigation in selector may be unreliable
102+
103+
**Workarounds:**
104+
- Use `a` to select all targets
105+
- Use `n` to deselect all
106+
- Use `Space` to toggle individual targets
107+
- Use classic mode: `sudo wifite --no-tui`
108+
109+
### Display Issues
110+
111+
**Problem:** Garbled or incorrect display
112+
113+
**Solutions:**
114+
- Clear terminal: `reset`
115+
- Check for conflicting processes
116+
- Try classic mode: `sudo wifite --no-tui`
117+
- Update rich library: `pip3 install --upgrade rich`
118+
119+
## Debug Mode
120+
121+
Enable TUI debug logging to troubleshoot issues:
122+
123+
```bash
124+
# Set debug flag in config or via environment
125+
sudo wifite --tui
126+
127+
# Check logs
128+
tail -f /tmp/wifite_tui.log
129+
```
130+
131+
Debug logs include:
132+
- TUI initialization events
133+
- Key press events
134+
- Rendering performance metrics
135+
- Error messages and exceptions
136+
137+
## Fallback Behavior
138+
139+
The TUI automatically falls back to classic mode if:
140+
- Terminal doesn't support required features
141+
- Terminal size is too small
142+
- Rich library is not available
143+
- TUI initialization fails
144+
- User specifies `--no-tui`
145+
146+
## Performance
147+
148+
The TUI is optimized for performance:
149+
- Update throttling (50ms minimum between updates)
150+
- Memory cleanup (limits log buffer to 1000 entries)
151+
- Efficient rendering (only updates changed content)
152+
- Minimal CPU usage during idle periods
153+
154+
## Known Limitations
155+
156+
1. **Arrow key navigation** - May require holding keys or multiple presses
157+
2. **SSH sessions** - May have reduced functionality over SSH
158+
3. **Screen/tmux** - Some features may not work in multiplexers
159+
4. **Minimum terminal size** - Requires 80x24 minimum
160+
161+
## Classic Mode
162+
163+
Classic mode remains fully supported and is the default for:
164+
- Terminals that don't support TUI
165+
- Piped output or non-interactive sessions
166+
- User preference (`--no-tui`)
167+
168+
All features work identically in both modes, only the presentation differs.
169+
170+
## Contributing
171+
172+
To improve the TUI:
173+
1. Report issues with terminal type, size, and error messages
174+
2. Test on different terminal emulators
175+
3. Suggest UI improvements
176+
4. Submit pull requests
177+
178+
## Credits
179+
180+
- TUI implementation uses the [rich](https://github.com/Textualize/rich) library
181+
- Original wifite2 by derv82
182+
- Maintained by kimocoder

0 commit comments

Comments
 (0)