Skip to content

Consolidate Evil Twin iface config into interface_primary/interface_secondary#503

Merged
kimocoder merged 2 commits into
masterfrom
copilot/apply-patch-eviltwin-iface-consolidation
Apr 30, 2026
Merged

Consolidate Evil Twin iface config into interface_primary/interface_secondary#503
kimocoder merged 2 commits into
masterfrom
copilot/apply-patch-eviltwin-iface-consolidation

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 30, 2026

Applies eviltwin-iface-consolidation.patch and removes the patch file. The patch eliminates the redundant eviltwin_fakeap_iface / eviltwin_deauth_iface config fields in favour of the generic interface_primary / interface_secondary fields already used elsewhere.

Changes

  • wifite/attack/eviltwin.py

    • __init__: resolves interface_ap / interface_deauth with precedence: constructor arg → interface_primary/interface_secondaryinterface
    • _get_interface_assignment: adds partial-spec handling — warns + falls back to single-interface mode when only interface_secondary is set; logs info when only interface_primary is set
  • wifite/config/__init__.py / defaults.py: removes eviltwin_deauth_iface and eviltwin_fakeap_iface class attributes and their default initialisations

  • wifite/config/parsers/eviltwin.py: --eviltwin-fakeap-iface and --eviltwin-deauth-iface become aliases that write into interface_primary / interface_secondary and set dual_interface_enabled = True; raises ValueError on conflicting values with the canonical flags

  • wifite/config/validators.py: validate_eviltwin_config checks interface_primary instead of the removed eviltwin_fakeap_iface

Original prompt

Apply the patch file eviltwin-iface-consolidation.patch (located at the repository root) to the source code, then delete the patch file from the repository.

Steps

  1. Apply the patch to the working tree. The patch modifies four files:

    • wifite/attack/eviltwin.py
    • wifite/config/__init__.py
    • wifite/config/defaults.py
    • wifite/config/parsers/eviltwin.py
    • wifite/config/validators.py

    You can use git apply eviltwin-iface-consolidation.patch to apply it. If git apply fails due to context drift, fall back to git apply --3way or apply the hunks manually, preserving the intent of each hunk exactly as written.

  2. After successfully applying the patch, delete the file eviltwin-iface-consolidation.patch from the repository root (git rm eviltwin-iface-consolidation.patch).

  3. Verify the resulting Python files are syntactically valid (e.g., python -m py_compile on each modified file).

Summary of patch contents

The patch consolidates Evil Twin interface configuration with the generic interface_primary / interface_secondary configuration:

  • wifite/attack/eviltwin.py:

    • In __init__, resolve self.interface_ap from interface_ap arg → Configuration.interface_primaryConfiguration.interface, and self.interface_deauth from interface_deauth arg → Configuration.interface_secondaryConfiguration.interface.
    • In _get_interface_assignment, add handling for partial specification: warn and return None if only interface_secondary is set without interface_primary; treat both set as dual-interface mode (existing branch); add a new branch where only interface_primary is set → log info and fall through to single-interface mode (after the manual-assignment block).
  • wifite/config/__init__.py: Remove the class attributes eviltwin_deauth_iface and eviltwin_fakeap_iface from the Configuration class.

  • wifite/config/defaults.py: Remove the corresponding default initializations cls.eviltwin_deauth_iface = None and cls.eviltwin_fakeap_iface = None from initialize_defaults.

  • wifite/config/parsers/eviltwin.py: Replace handling of --eviltwin-deauth-iface / --eviltwin-fakeap-iface so they become aliases that populate cls.interface_secondary / cls.interface_primary respectively, set cls.dual_interface_enabled = True, and raise a ValueError if conflicting values are passed via --interface-primary / --interface-secondary at the same time.

  • wifite/config/validators.py: In validate_eviltwin_config, change the check from cls.eviltwin_fakeap_iface to cls.interface_primary (since both CLI flags now populate the same field).

The full patch content is committed at the repo root as eviltwin-iface-consolidation.patch for reference; refer to it for exact line-by-line changes. Make sure to delete it as the final step.

Acceptance criteria

  • All hunks of eviltwin-iface-consolidation.patch are applied to the corresponding source files.
  • eviltwin-iface-consolidation.patch no longer exists in the repository.
  • All modified Python files pass python -m py_compile.
  • No other files are changed.

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

User: Add the "eviltwin-iface-consolidation.patch" from repo to source and delete the file afterwards

Assistant: I've handed this off to the coding agent — waiting on your confirmation of the dialog so it can open the PR that applies the patch and deletes the patch file.

This pull request was created from Copilot chat.

@kimocoder kimocoder marked this pull request as ready for review April 30, 2026 15:12
Copilot AI review requested due to automatic review settings April 30, 2026 15:12
Copilot AI changed the title [WIP] Apply patch to consolidate Evil Twin interface Consolidate Evil Twin iface config into interface_primary/interface_secondary Apr 30, 2026
Copilot AI requested a review from kimocoder April 30, 2026 15:13
@kimocoder kimocoder merged commit 08dde45 into master Apr 30, 2026
15 of 18 checks passed
@kimocoder kimocoder deleted the copilot/apply-patch-eviltwin-iface-consolidation branch April 30, 2026 15:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: b78796263d

ℹ️ 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/eviltwin.py
Comment on lines +82 to +85
self.interface_deauth = (
interface_deauth
or Configuration.interface_secondary
or Configuration.interface
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use primary interface for deauth in primary-only mode

When only --interface-primary (or --eviltwin-fakeap-iface) is provided, _get_interface_assignment() explicitly falls back to single-interface mode, but __init__ still sets self.interface_deauth from Configuration.interface instead of the chosen primary. In that scenario deauth packets go out on the scan interface, not the user-selected primary interface, which can break the intended primary-only Evil Twin setup and route deauth traffic to the wrong adapter.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Consolidates Evil Twin interface selection so it uses the generic dual-interface configuration (interface_primary / interface_secondary) and removes the old Evil Twin-specific configuration fields.

Changes:

  • Resolve Evil Twin AP/deauth interfaces from constructor args → Configuration.interface_primary/secondaryConfiguration.interface.
  • Make --eviltwin-fakeap-iface / --eviltwin-deauth-iface populate the generic primary/secondary interface fields and error on conflicts with --interface-primary/secondary.
  • Remove eviltwin_*_iface configuration fields/defaults and update Evil Twin validation accordingly; delete the patch file from the repo.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wifite/attack/eviltwin.py Uses primary/secondary config for interface resolution and updates interface assignment logic.
wifite/config/init.py Removes Evil Twin-specific interface configuration attributes.
wifite/config/defaults.py Removes defaults for the deleted Evil Twin-specific interface fields.
wifite/config/parsers/eviltwin.py Reworks Evil Twin CLI iface flags into aliases of primary/secondary with conflict detection.
wifite/config/validators.py Validates AP capability against interface_primary instead of the removed Evil Twin-specific field.
eviltwin-iface-consolidation.patch Deletes the applied patch file from the repository.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wifite/attack/eviltwin.py
'interface_secondary is set without interface_primary; '
'cannot use dual interface mode for Evil Twin')
Color.pl('{!} {O}Warning: secondary interface specified without primary; '
'falling back to single interface mode{W}')
Comment thread wifite/attack/eviltwin.py
Comment on lines +230 to +235
# Only primary specified → single interface mode using primary as
# the AP/deauth iface (already resolved in __init__).
if has_primary and not has_secondary:
log_info('EvilTwin',
f'Only primary interface specified ({Configuration.interface_primary}); '
'running single interface mode')
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