Improve cracking command output and config defaults#510
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a49b4e30a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fakeauth_wait = Configuration.wep_fakeauth_time or AttackWEP.fakeauth_wait | ||
| fakeauth = Aireplay.fakeauth(self.target, timeout=fakeauth_wait) |
There was a problem hiding this comment.
Expose fake-auth timeout through argument parsing
AttackWEP now reads Configuration.wep_fakeauth_time, but this commit never adds a CLI/config parser path that can set that field, so the timeout remains hard-coded at the default 5 in practice. In runs where fake-auth takes longer (especially with --require-fakeauth), users still cannot increase the wait time despite the new “configurable” code path, and attacks fail as before.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in bef667cd5 by adding --wep-fakeauth-time [seconds] and wiring it through the WEP argument parser so Configuration.wep_fakeauth_time is user-configurable.
| try: | ||
| subprocess.run(["rm", "-f", "reaver_output.pcap"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=2) | ||
| reaver_pcap = os.path.abspath('reaver_output.pcap') | ||
| subprocess.run(["rm", "-f", reaver_pcap], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=2) |
| try: | ||
| subprocess.run(["rm", "-f", "reaver_output.pcap"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=2) | ||
| reaver_pcap = os.path.abspath('reaver_output.pcap') | ||
| subprocess.run(["rm", "-f", reaver_pcap], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=2) |
|
Me and me is gonna go through this manually. Let's hold on a bit 👍 |
|
Hi, Sourcery appears to be failing because |
|
@copilot check |
|
@copilot info |
|
@copilot check |
There was a problem hiding this comment.
Pull request overview
This PR focuses on improving usability and configurability around cracking output, WEP behavior, session-resume metadata, and a few cleanup/dependency/documentation updates.
Changes:
- Adds
--print-crack-cmdand adjusts cracking helpers to only print cracking commands when requested (via flag or verbosity). - Makes dual-interface preference opt-in by default and adds a configurable WEP fake-auth wait time.
- Improves handshake BSSID/ESSID selection warnings, session resume timestamps, legacy Reaver
.pcapcleanup, Scapy dependency pin, and addsCONTRIBUTING.md.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| wifite/wifite.py | Uses current timestamps for restored targets; tweaks legacy Reaver .pcap cleanup path handling. |
| wifite/util/crack.py | Introduces command-printing helper and gates command printing behind verbosity/flag. |
| wifite/model/handshake.py | Improves multi-network capture handling with clearer warnings/fallback behavior. |
| wifite/config/parsers/wep.py | Adds parsing for configurable WEP fake-auth wait time. |
| wifite/config/defaults.py | Adjusts defaults (dual-interface preference, WEP fake-auth time, cracking command printing flag). |
| wifite/config/init.py | Adds config fields + CLI arg wiring for cracking command printing and WEP fake-auth time. |
| wifite/attack/wep.py | Uses configurable fake-auth wait time and updates related error message. |
| wifite/args.py | Adds --wep-fakeauth-time and --print-crack-cmd CLI arguments. |
| requirements.txt | Lowers Scapy requirement from RC pin to stable >=2.6.0. |
| CONTRIBUTING.md | Adds contribution/testing/style guidelines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cls.wep_timeout = args.wep_timeout | ||
| Color.pl('{+} {C}option:{W} WEP attack timeout set to {G}%d seconds{W}' % args.wep_timeout) | ||
|
|
||
| if args.wep_fakeauth_time: |
| """ | ||
| Color.p('\r{+} attempting {G}fake-authentication{W} with {C}%s{W}...' % self.target.bssid) | ||
| fakeauth = Aireplay.fakeauth(self.target, timeout=AttackWEP.fakeauth_wait) | ||
| fakeauth_wait = Configuration.wep_fakeauth_time or AttackWEP.fakeauth_wait |
| def print_cracking_command(tool_name, command_parts): | ||
| """ | ||
| Print the exact shell command that would be run for cracking, | ||
| so users can copy-paste it into a terminal. | ||
|
|
||
| Used by cracking helpers that need a consistently formatted command line. | ||
|
|
||
| Args: | ||
| tool_name: Human-readable label for the tool (e.g. 'aircrack-ng'). | ||
| command_parts: List of strings forming the shell command (argv style). | ||
| """ | ||
| import shlex | ||
| from ..util.color import Color | ||
| cmd_str = ' '.join(shlex.quote(str(p)) for p in command_parts) | ||
| Color.pl('{+} {C}[crack-cmd]{W} {G}%s{W}: {W}%s' % (tool_name, cmd_str)) | ||
|
|
||
|
|
| # Delete Reaver .pcap quickly. | ||
| # reaver_output.pcap is the legacy bare filename written by older reaver versions | ||
| # directly into the cwd. The current Reaver tool class writes to Configuration.temp() | ||
| # instead, but we still clean up the legacy name here using an absolute path | ||
| # (os.path.abspath) so the removal works regardless of cwd. |
Summary
This PR makes several small configuration and usability improvements:
--print-crack-cmdto show cracking commands only when requested..pcapcleanup.scapy>=2.6.0.CONTRIBUTING.mdguide.Testing
python3 -m compileall -q wifitepython3 -m unittest tests.test_config_refactor -qgit diff --checkpython3 wifite.py --helpshows--print-crack-cmd