Improve handshake analysis, fix packaging, and harden silent exceptio…#525
Merged
Conversation
…n handlers Handshake analysis (wifite/model/handshake.py, wifite/tools/tshark.py): - Replace the buggy hcxpcapngtool_handshakes() (which checked the hash file size before the process finished) with a tshark-based partial 4-way breakdown that reports which EAPOL messages are present/missing. - Add Tshark.eapol_analysis() so a single tshark parse yields both the full-handshake verdict and the per-AP message summary (was parsed twice). - Wrap tshark Process objects in `with` blocks for deterministic cleanup. - Pass an explicit ESSID in the cowpatty handshake test (cowpatty -c requires one). Packaging (setup.py, requirements.txt): - Align requests/urllib3 pins in requirements.txt with pyproject.toml. - Single-source dev/test deps in pyproject.toml (drop duplicates from setup.py and requirements.txt). - Fix distribution name mismatch: setup.py now uses name='wifite2' to match pyproject.toml so importlib.metadata version lookup resolves. - Add python_requires='>=3.10' and derive install_requires from requirements.txt for the legacy setup.py install path. Robustness: - Add debug-log traces to three silent except/pass swallows in long-running loops/threads (native deauth burst, john progress reader, OWE client tracking) so persistent failures are no longer invisible. - Stop hammering a broken Live TUI and fix the stale tui_logger docstring (default log path is ~/.config/wifite, not /tmp). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves handshake/EAPOL analysis output (including partial 4‑way reporting), tightens resource handling around tshark execution, hardens previously silent exception paths, and updates packaging metadata/dependency sourcing to align with the wifite2 project configuration.
Changes:
- Add per-AP EAPOL message summary + combined single-pass tshark analysis used by handshake reporting.
- Replace several silent
exceptblocks with debug logging to aid troubleshooting. - Update packaging/dependency plumbing (setup.py reads requirements.txt; requirements aligned with pyproject).
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| wifite/util/tui_logger.py | Docstring updated to reflect safer default log location/permissions. |
| wifite/ui/tui.py | Adjusts exception handling in Live update path (recovery/stop behavior). |
| wifite/tools/tshark.py | Uses context manager for Process; adds EAPOL summary + combined analysis API. |
| wifite/tools/john.py | Logs exceptions in progress reader thread instead of silently swallowing. |
| wifite/native/deauth.py | Logs deauth burst exceptions instead of silently swallowing. |
| wifite/model/handshake.py | Uses new tshark combined analysis; prints partial 4-way breakdown when no full handshake. |
| wifite/attack/owe.py | Logs client tracking exceptions instead of silently swallowing. |
| tests/test_Handshake.py | Fixes cowpatty test by providing required ESSID. |
| setup.py | Renames package to wifite2; reads install deps from requirements.txt; sets python_requires. |
| requirements.txt | Aligns runtime deps with pyproject and removes dev-only commentary. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+28
| requirements = [] | ||
| with open('requirements.txt', 'r', encoding='utf-8') as fh: | ||
| for line in fh: | ||
| line = line.split('#', 1)[0].strip() | ||
| if line: | ||
| requirements.append(line) | ||
| return requirements |
Comment on lines
+166
to
+169
| command = ['tshark', '-r', capfile, '-n', '-Y', 'eapol'] | ||
| with Process(command, devnull=False) as tshark: | ||
| output = tshark.stdout() | ||
| return cls._build_eapol_summary(output, bssid=bssid) |
Comment on lines
+181
to
+183
| if not summary: | ||
| Color.pl('{!} %s.cap file contains {O}no EAPOL frames{W} ' | ||
| '({R}no handshake to crack{W})' % tool_str) |
Comment on lines
+189
to
+196
| command = ['tshark', '-r', capfile, '-n', '-Y', 'eapol'] | ||
| with Process(command, devnull=False) as tshark: | ||
| output = tshark.stdout() | ||
|
|
||
| handshake_map = cls._build_target_client_handshake_map(output, bssid=bssid) | ||
| bssids = list({key.split(',')[0] for key, num in handshake_map.items() if num == 4}) | ||
| summary = cls._build_eapol_summary(output, bssid=bssid) | ||
| return bssids, summary |
| try: | ||
| self.live.update(renderable, refresh=True) | ||
| except Exception as e: | ||
| except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.