Skip to content

Improve cracking command output and config defaults#510

Open
Ashcal9669 wants to merge 2 commits into
kimocoder:masterfrom
Ashcal9669:fix-config-cracking-ux
Open

Improve cracking command output and config defaults#510
Ashcal9669 wants to merge 2 commits into
kimocoder:masterfrom
Ashcal9669:fix-config-cracking-ux

Conversation

@Ashcal9669

Copy link
Copy Markdown

Summary

This PR makes several small configuration and usability improvements:

  • Changes dual-interface preference to opt-in by default.
  • Adds configurable WEP fake-auth wait time.
  • Adds --print-crack-cmd to show cracking commands only when requested.
  • Updates cracking helpers to respect normal verbosity instead of always printing commands.
  • Improves multi-BSSID handshake capture handling by warning when fallback selection is needed.
  • Uses current timestamps when reconstructing resumed targets.
  • Uses an absolute path for legacy Reaver .pcap cleanup.
  • Lowers the Scapy dependency from an RC pin to stable scapy>=2.6.0.
  • Adds a CONTRIBUTING.md guide.

Testing

  • Ran python3 -m compileall -q wifite
  • Ran targeted import checks for changed modules
  • Ran python3 -m unittest tests.test_config_refactor -q
  • Ran git diff --check
  • Confirmed python3 wifite.py --help shows --print-crack-cmd

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread wifite/attack/wep.py
Comment on lines +383 to +384
fakeauth_wait = Configuration.wep_fakeauth_time or AttackWEP.fakeauth_wait
fakeauth = Aireplay.fakeauth(self.target, timeout=fakeauth_wait)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Comment thread wifite/wifite.py
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)
Comment thread wifite/wifite.py
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)
@kimocoder

Copy link
Copy Markdown
Owner

Me and me is gonna go through this manually. Let's hold on a bit 👍

@Ashcal9669

Copy link
Copy Markdown
Author

Hi, Sourcery appears to be failing because secrets.WIFITE is not available in the PR workflow. The action runs sourcery login --token without a value, so this looks unrelated to my code changes

@kimocoder

Copy link
Copy Markdown
Owner

@copilot check

@kimocoder

Copy link
Copy Markdown
Owner

@copilot info

@kimocoder

Copy link
Copy Markdown
Owner

@copilot check

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 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-cmd and 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 .pcap cleanup, Scapy dependency pin, and adds CONTRIBUTING.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:
Comment thread wifite/attack/wep.py
"""
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
Comment thread wifite/util/crack.py
Comment on lines +21 to 37
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))


Comment thread wifite/wifite.py
Comment on lines +1370 to +1374
# 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.
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.

4 participants