Skip to content

Add --detect-honeypots option and harden tool/attack robustness across the board#478

Closed
Copilot wants to merge 2 commits intomasterfrom
copilot/add-detect-honeypots-option
Closed

Add --detect-honeypots option and harden tool/attack robustness across the board#478
Copilot wants to merge 2 commits intomasterfrom
copilot/add-detect-honeypots-option

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 28, 2026

Applies the patch.patch changes: introduces a --detect-honeypots scanner feature and fixes a spread of robustness/cleanup issues across attack modules, tools, and the portal server.

--detect-honeypots feature

  • CLI/config: --detect-honeypots arg → Configuration.detect_honeypots wired through args.py, config/__init__.py, defaults.py, and parsers/settings.py
  • Heuristic analysis (util/scanner.py): new _analyze_honeypots() called each scan cycle (airodump and native paths); sets is_honeypot, honeypot_score, honeypot_reasons on each Target; detects:
    • duplicate SSID with different vendor OUI
    • unusually strong signal
    • open network sharing an SSID with a secured peer
    • strong signal with no associated clients
  • Display: optional HP column in both classic and TUI (ui/scanner_view.py) views; Target.to_str() gains show_honeypot parameter

Model normalization

  • model/client.py: power and packets field parsing wrapped in try/except (ValueError, IndexError) — previously would raise on malformed CSV rows
  • model/target.py: honeypot metadata fields initialized in __init__; propagated via transfer_info()

Evil twin / portal improvements

  • attack/eviltwin.py: adds _portal_credential_callback() and _validate_credentials() (8–63 char WPA length check); wires callback to PortalServer.set_credential_callback() — previously the portal captured credentials but never called back into the attack
  • attack/portal/server.py: do_POST now enforces MAX_POST_SIZE = 8192 with a 413 response; content_length clamped to ≥ 0; decode uses errors='replace'

PMKID

  • attack/pmkid.py: t.join(timeout=5) added after keep_capturing = False so the capture thread is reaped before returning

Process/tool hardening

  • attack/wpa.py: added missing import subprocess (referenced but not imported in _error_recovery_context)
  • tools/aircrack.py: __del__ wrapped in try/except OSError; stdout decode uses errors='replace'
  • tools/aireplay.py: __del__ wraps both file close and stop() in separate try/except
  • tools/airmon.py: os.kill() in terminate_conflicting_processes catches ProcessLookupError/PermissionError
  • tools/airodump.py: pid.interrupt() in __exit__ wrapped in try/except
  • tools/hashcat.py: HcxDumpTool.__init__ file removal wrapped in try/except OSError
  • tools/reaver.py: __del__ and pre-run file removal hardened with try/except

Formatting

  • requirements.txt: moved urllib3 inline comment to its own line
Original prompt

Apply the attached patch.patch changes to the repository kimocoder/wifite2 and open a pull request with the implementation.

Use the provided patch content as the source of truth and reproduce its changes in the repository. The patch updates multiple areas including:

  • adding the --detect-honeypots CLI/config option and wiring it through config parsing and UI/scanner display
  • evil twin attack setup/cleanup/service startup adjustments and portal credential callback integration
  • PMKID validation/join cleanup improvements
  • portal POST size limiting and destructor cleanup hardening
  • WEP/WPA process handling fixes
  • target/client parsing normalization and honeypot metadata support
  • process/tool robustness improvements across aircrack, aireplay, airmon, reaver, process manager, etc.
  • scanner/native scanner honeypot analysis hooks
  • a small requirements.txt formatting change

Files affected by the patch include:

  • requirements.txt
  • wifite/args.py
  • wifite/attack/eviltwin.py
  • wifite/attack/pmkid.py
  • wifite/attack/portal/server.py
  • wifite/attack/wep.py
  • wifite/attack/wpa.py
  • wifite/config/__init__.py
  • wifite/config/defaults.py
  • wifite/config/parsers/settings.py
  • wifite/model/client.py
  • wifite/model/target.py
  • wifite/tools/aircrack.py
  • wifite/tools/aireplay.py
  • wifite/tools/airmon.py
  • wifite/tools/airodump.py
  • wifite/tools/hashcat.py
  • wifite/tools/reaver.py
  • wifite/ui/scanner_view.py
  • wifite/util/process.py
  • wifite/util/scanner.py

Important: create the PR against the repository explicitly provided by the user: kimocoder/wifite2.

The attached patch content to apply is exactly the one provided in chat as patch.patch.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Apply the attached patch.patch to wifite2. Make it a PR.

Assistant: We’re waiting for your response to the GitHub confirmation dialog before I can continue creating the PR.

This pull request was created from Copilot chat.


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

import time
import os
import re
import subprocess

Check notice

Code scanning / Bandit

Consider possible security implications associated with the subprocess module. Note

Consider possible security implications associated with the subprocess module.
try:
if hasattr(self, 'output_fh') and self.output_fh and not self.output_fh.closed:
self.output_fh.close()
except Exception:

Check notice

Code scanning / Bandit

Try, Except, Pass detected. Note

Try, Except, Pass detected.
pass
try:
self.stop()
except Exception:

Check notice

Code scanning / Bandit

Try, Except, Pass detected. Note

Try, Except, Pass detected.
self.pid.interrupt()
try:
self.pid.interrupt()
except Exception:

Check notice

Code scanning / Bandit

Try, Except, Pass detected. Note

Try, Except, Pass detected.
try:
if hasattr(self, 'output_write') and self.output_write and not self.output_write.closed:
self.output_write.close()
except Exception:

Check notice

Code scanning / Bandit

Try, Except, Pass detected. Note

Try, Except, Pass detected.
Copilot AI changed the title [WIP] Add --detect-honeypots CLI option and improve multiple areas Add --detect-honeypots option and harden tool/attack robustness across the board Mar 28, 2026
Copilot AI requested a review from kimocoder March 28, 2026 09:10
@kimocoder kimocoder closed this Mar 28, 2026
@kimocoder kimocoder deleted the copilot/add-detect-honeypots-option branch March 28, 2026 09:17
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.

3 participants