Skip to content

Improve handshake analysis, fix packaging, and harden silent exceptio…#525

Merged
kimocoder merged 1 commit into
masterfrom
audit-handshake-and-packaging-fixes
Jun 3, 2026
Merged

Improve handshake analysis, fix packaging, and harden silent exceptio…#525
kimocoder merged 1 commit into
masterfrom
audit-handshake-and-packaging-fixes

Conversation

@kimocoder

Copy link
Copy Markdown
Owner

No description provided.

…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>
Copilot AI review requested due to automatic review settings June 3, 2026 16:20
@kimocoder kimocoder merged commit 8e22303 into master Jun 3, 2026
1 check was pending
@kimocoder kimocoder deleted the audit-handshake-and-packaging-fixes branch June 3, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 except blocks 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 thread setup.py
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 thread wifite/tools/tshark.py
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 thread wifite/model/handshake.py
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 thread wifite/tools/tshark.py
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
Comment thread wifite/ui/tui.py
try:
self.live.update(renderable, refresh=True)
except Exception as e:
except Exception:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants