WiFi Pineapple Mark 7 Modules
repository·master·Indexed 19 days ago
https://github.com/hak5/pineapple-modulesA 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.
What's inside hak5-pineapple-modules
- 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.
Overview of WiFi Pineapple Mark 7 Module Libraries
masterThe 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.Access WiFi Pineapple module development documentation
masterFor technical guidance on how to build and develop modules for the Mark 7, refer to the official developer documentation. This includes an introductory guide to the module system.
- Developer Docs: https://hak5.github.io/mk7-docs
- Introductory Guide: https://hak5.github.io/mk7-docs/docs/modules/modules/
Submit a new WiFi Pineapple module
masterTo 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.Control State and Client Lists
masterThe 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.txtfile. These are clients permitted to interact with the portal. - Permanent Clients: Managed via the
/pineapple/ui/modules/evilportal/assets/permanentclients.txtfile. These are persistent clients.
Both lists support adding or removing clients via the
update_client_listAPI action.MDK4 Attack Modes and Options
masterMDK4 supports several attack modes, each with a specific set of command-line flags. The
attackModekey uses single-character identifiers. When constructing a command, the system combines the basemdk4command with the selected interface, mode, and specific attack options.Available Attack Modes
a: Authentication Denial Of Serviceb: Beacon Floodingd: Deauthentication and Disassociatione: EAPOL Start and Logoff Packet Injectionm: Michael Countermeasures Exploitationp: SSID Probing and Bruteforcings: Attacks for IEEE 802.11s mesh networksw: WIDS Confusionf: Packet Fuzzer
How targeted routing works in Evil Portal
masterThe Evil Portal uses a targeted skeleton (
index.php) to serve different captive portal pages to clients based on specific criteria defined in a.epJSON 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:
- Metadata Mapping: The system collects client information using
getClientMac,getClientSSID,getClientHostName, and theHTTP_USER_AGENTserver variable. - Rule Evaluation: It iterates through the
rule_orderdefined in the{portalName}.epfile. - Matching Logic: For each rule, it checks for either
exactmatches orregexmatches: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.
- Fallback: If no rules match, the system includes the page specified in the
defaultkey of the JSON configuration.
- Metadata Mapping: The system collects client information using
Manage DenyIP IP Lists
masterThe 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);Implement the authorization form in Evil Portal templates
masterTo 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
targetcontaining 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>Run and Control MDK4 Attacks
masterTo 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_idand monitors anoutput_filefor real-time logs.Start an Attack
Send a request to the
startaction. You must include:command: The fullmdk4command 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
stopaction to terminate the currently running MDK4 process.Monitor and Download Output
- Monitoring: The system polls the
poll_jobaction using thejob_idto check for completion. - Loading Logs: Use the
load_outputaction with theoutput_filepath to retrieve the current log content. - Downloading: Logs are stored at
/root/.mdk4/[output_file]. Use theAPIDownloadmethod to retrieve them locally asmdk4-[output_file].log.
Manage MDK4 Dependencies
masterMDK4 requires specific system dependencies to function. You can check the current status and install missing dependencies via the API.
Check Dependencies
Calls
check_dependenciesto see if the environment is ready.Install Dependencies
Calls
manage_dependencieswithinstall: 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.Manage Evil Portal Dependencies
masterThe Evil Portal module requires specific dependencies to function. You can check their status and manage installation through the API.
- Check Status: Use the
check_dependenciesaction. It returns whether dependencies areinstalledor if an installation is currently in progress (installing). - Install: Use the
manage_dependenciesaction with{ "install": true }. This initiates a background job. - Monitor: If an installation is triggered, the API returns a
job_id. Use thepoll_jobaction with thatjob_idto monitor progress untilis_completeis true.
- Check Status: Use the