WiFi Pineapple Mark 7 Modules

repository·master·Indexed 19 days ago

https://github.com/hak5/pineapple-modules

A collection of community-developed modules and Python-based helper libraries for the WiFi Pineapple Mark 7. This repository provides security auditing and testing capabilities, including the Cabinet module for filesystem management, the DenyIP module for managing IPv4/IPv6 blocklists via ipset and iptables, and the DNSspoof module for DNS allocation and mapping.

Tokens
23.2K
Snippets
65
Records
99
Agent score
68%

What's inside hak5-pineapple-modules

  1. Overview of WiFi Pineapple Mark 7 Modules

    master
    This repository serves as the central collection for community-developed modules for the WiFi Pineapple Mark 7. Developers can find existing module assets here and are encouraged to contribute new modules or improvements via Pull Requests.
  2. Overview of WiFi Pineapple Mark 7 Module Libraries

    master
    The WiFi Pineapple Mark 7 Module Libraries provide a collection of Python-based helpers and frameworks designed to simplify the development of custom modules for the WiFi Pineapple Mark 7. These libraries abstract complex tasks, allowing developers to build and deploy modules more efficiently by using pre-defined frameworks and utility functions.
  3. Submit a new WiFi Pineapple module

    master
    To add a new module to the WiFi Pineapple ecosystem, develop your module and submit it to this repository via a Pull Request. Once your Pull Request is reviewed and approved, your module will be added to the official WiFi Pineapple module download site. This allows users to download your module directly from the WiFi Pineapple management interface.
  4. Control State and Client Lists

    master

    The Evil Portal module maintains several state objects that reflect the current configuration of the hardware and the module:

    Control State

    Tracks the operational status of the module:

    • running: Whether the Evil Portal service is active.
    • webserver: Whether the webserver is running.
    • autoStart: Whether the module is configured to start on boot.

    Client Lists

    There are two primary lists for managing client access:

    • Allowed Clients: Managed via the /tmp/EVILPORTAL_CLIENTS.txt file. These are clients permitted to interact with the portal.
    • Permanent Clients: Managed via the /pineapple/ui/modules/evilportal/assets/permanentclients.txt file. These are persistent clients.

    Both lists support adding or removing clients via the update_client_list API action.

  5. MDK4 Attack Modes and Options

    master

    MDK4 supports several attack modes, each with a specific set of command-line flags. The attackMode key uses single-character identifiers. When constructing a command, the system combines the base mdk4 command with the selected interface, mode, and specific attack options.

    Available Attack Modes

    • a: Authentication Denial Of Service
    • b: Beacon Flooding
    • d: Deauthentication and Disassociation
    • e: EAPOL Start and Logoff Packet Injection
    • m: Michael Countermeasures Exploitation
    • p: SSID Probing and Bruteforcing
    • s: Attacks for IEEE 802.11s mesh networks
    • w: WIDS Confusion
    • f: Packet Fuzzer
  6. How targeted routing works in Evil Portal

    master

    The Evil Portal uses a targeted skeleton (index.php) to serve different captive portal pages to clients based on specific criteria defined in a .ep JSON configuration file.

    When a client connects, the system maps their metadata (MAC address, SSID, Hostname, or User Agent) against a set of rules. The routing logic follows these steps:

    1. Metadata Mapping: The system collects client information using getClientMac, getClientSSID, getClientHostName, and the HTTP_USER_AGENT server variable.
    2. Rule Evaluation: It iterates through the rule_order defined in the {portalName}.ep file.
    3. Matching Logic: For each rule, it checks for either exact matches or regex matches:
      • exact: Checks if the client's data exists as a key in the rule's value array.
      • regex: Iterates through regular expression patterns and returns the destination if a match is found.
    4. Fallback: If no rules match, the system includes the page specified in the default key of the JSON configuration.
  7. Manage DenyIP IP Lists

    master

    The DenyIP module allows you to manage blocked IP addresses. You can add specific IPs or user types to a deny list, clear the entire list, or retrieve the current list of IPv4 and IPv6 addresses being managed.

    /* Example: Adding an IP via the API */
    // To add an IP, use the 'add' action with the following parameters:
    // user_ip: The IP address to block
    // user_type: The category or type of user/IP
    
    // API Call Example:
    // API.request({ module: 'DenyIP', action: 'add', user_ip: '192.168.1.1', user_type: 'client' }, callback);
  8. Implement the authorization form in Evil Portal templates

    master

    To allow users to authorize through the portal and redirect them to their original destination, include a POST form that targets /captiveportal/index.php.

    The form must include a hidden input field named target containing the destination URL. The destination URL is typically constructed using the current protocol, host, and request URI to ensure the user returns to where they were before being intercepted.

    <form method="POST" action="/captiveportal/index.php">
        <input type="hidden" name="target" value="<?php echo $destination; ?>">
        <button type="submit">Authorize</button>
    </form>
  9. Run and Control MDK4 Attacks

    master

    To execute an MDK4 attack, you must provide the command string, the input interface, and the output interface. The system tracks the job via a job_id and monitors an output_file for real-time logs.

    Start an Attack

    Send a request to the start action. You must include:

    • command: The full mdk4 command string including all flags.
    • input_iface: The interface used for input.
    • output_iface: The interface used for output.

    Stop an Attack

    Send a request to the stop action to terminate the currently running MDK4 process.

    Monitor and Download Output

    • Monitoring: The system polls the poll_job action using the job_id to check for completion.
    • Loading Logs: Use the load_output action with the output_file path to retrieve the current log content.
    • Downloading: Logs are stored at /root/.mdk4/[output_file]. Use the APIDownload method to retrieve them locally as mdk4-[output_file].log.
  10. Manage MDK4 Dependencies

    master

    MDK4 requires specific system dependencies to function. You can check the current status and install missing dependencies via the API.

    Check Dependencies

    Calls check_dependencies to see if the environment is ready.

    Install Dependencies

    Calls manage_dependencies with install: true. This initiates a background job (opkg) to install the required packages. The system monitors this job and will notify you once installation is complete or if an error occurs.

  11. Manage Evil Portal Dependencies

    master

    The Evil Portal module requires specific dependencies to function. You can check their status and manage installation through the API.

    1. Check Status: Use the check_dependencies action. It returns whether dependencies are installed or if an installation is currently in progress (installing).
    2. Install: Use the manage_dependencies action with { "install": true }. This initiates a background job.
    3. Monitor: If an installation is triggered, the API returns a job_id. Use the poll_job action with that job_id to monitor progress until is_complete is true.