### Get list of available Modules Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/modules/modules.md Retrieves a list of modules that are available for installation. ```APIDOC ## GET /api/modules/available ### Description Retrieves a list of modules that are available for installation. ### Method GET ### Endpoint /api/modules/available ### Response #### Success Response (200) Returns a list of available modules. ### Response Example ```json { RESPONSE } ``` ``` -------------------------------- ### Register Action Handler Usage Example Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md Example demonstrating how to manually register an action handler for a module. ```python module = Module('example') def save_file(request: Request) -> Union[Any, Tuple[Any, bool]]: ... module.register_action_handler(save_file) ``` -------------------------------- ### Install Dependency Function Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Installs a package via opkg if it is not already installed. Optionally skips repository updates. Logs output using an optional logger instance. ```python def install_dependency(package: str, logger: Optional[Logger] = None, skip_repo_update: bool = False) -> [bool, str] ``` -------------------------------- ### Get Modules Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/modules/modules.md Retrieves a list of all installed modules on the WiFi Pineapple. ```APIDOC ## GET /api/modules ### Description Retrieves a list of all installed modules on the WiFi Pineapple. ### Method GET ### Endpoint /api/modules ### Response #### Success Response (200) Returns a list of installed modules. ### Response Example ```json { RESPONSE } ``` ``` -------------------------------- ### Get All Campaigns Response Structure Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Example JSON structure for a successful response when retrieving all campaigns. ```json { "campaigns": Campaign[] } ``` -------------------------------- ### Install Remote Module Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/modules/modules.md Installs a module from a remote source onto the WiFi Pineapple. ```APIDOC ## PUT /api/modules/install ### Description Installs a module from a remote source onto the WiFi Pineapple. ### Method PUT ### Endpoint /api/modules/install ### Request Body ```json { BODY } ``` ### Response #### Success Response (200) Returns a success response if the module is installed successfully. ### Response Example ```json { RESPONSE } ``` ``` -------------------------------- ### Make authenticated API request (GET) Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/authentication/authentication.md This example shows how to use the obtained Bearer token in the Authorization header to retrieve data, such as notifications, from the API. ```bash foxtrot@intent:~$ curl -X GET http://172.16.42.1:1471/api/notifications -H "Authorization: Bearer eyJVc2VyIjoicm9vdCIsIkV4cGlyeSI6IjIwMjAtMDUtMTdUMTg6NDM6NTEuNjg1NjA5NTJa In0=.VZpkUmWREeLMtKGx0wZFeWczj8hImbPnulTT5zpnQpM=" [{"id":1,"message":"Hello World!","level":0,"time":"2020-09-18T10:30:21.031669675Z","read":false,"displayed":false,"module_name":""}] foxtrot@intent:~$ ``` -------------------------------- ### install_dependency Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Install a package via opkg if its not currently installed. ```APIDOC ## install_dependency(package, logger, skip_repo_update) ### Description Install a package via opkg if its not currently installed. ### Parameters * package: The name of the package to install. * logger: An optional instance of logger to log output from opkg as debug. * skip_repo_update: True to skip running `opkg update`. An internet connection will still be checked for. ### Returns * bool: True if the package was installed, False if it as not. * str: Empty if successful, error message if it was not. ``` -------------------------------- ### Get All Campaign Reports Response Structure Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Example JSON structure for a successful response when retrieving all campaign reports. ```json { "fullPath": string, "fileName": string } ``` -------------------------------- ### Successful JSON Response Example Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/modules/modules.md This is an example of a successful JSON response structure. ```json { RESPONSE } ``` -------------------------------- ### on_start Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md A decorator that registers a function as a startup handler to be called on the start lifecycle event. ```APIDOC ## on_start() ### Description A decorator that registers a function as a startup handler to be called on the start lifecycle event. ### Example ```python @module.on_start() def copy_configs(): ... ``` ``` -------------------------------- ### Module Start Method Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md The main loop for a module, responsible for listening for incoming requests and processing them. ```python def start(self) ``` -------------------------------- ### Start Diagnostics Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Initiates a diagnostic process on the device. Returns a success status upon initiation. ```APIDOC ## POST /api/settings/diagnostics/start ### Description Initiates a diagnostic process on the device. ### Method POST ### Endpoint /api/settings/diagnostics/start ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example { "success": true } ``` -------------------------------- ### check_if_installed Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Check if a package is already installed via opkg. ```APIDOC ## check_if_installed(package, logger) ### Description Check if a package is already installed via opkg. ### Parameters * package: The name of the package to search for. * logger: An optional instance of logger to log output from opkg as debug. ### Returns * bool: True if package installed, False if it is not. ``` -------------------------------- ### Check if Package is Installed Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Checks if a specified package is currently installed via opkg. Logs output using an optional logger instance. ```python def check_if_installed(package: str, logger: Optional[Logger] = None) -> bool ``` -------------------------------- ### OpkgJob do_work Method Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md The do_work method for OpkgJob. It attempts to install each package in a list. Returns False if any package fails to install. ```python def do_work(self, logger: Logger) -> bool: If self.package is a List: Attempt to install each every package in the list. If a single package fails to install then this method will return False. ``` -------------------------------- ### Response for Get Updates Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Provides information about available updates, including version and changelog. ```json { "update_found": bool, "update_version": string, "update_changelog": string, "channel_closed": bool } ``` -------------------------------- ### Get Dashboard Card Data Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/dashboard/dashboard.md Example JSON response for the GET /api/dashboard/cards endpoint, detailing system and client status. ```json { "systemStatus": SystemStatus, "diskUsage": DiskUsage, "clientsConnected": string, "previousClients": string, "ssidsSeen": SSIDsSeen } ``` -------------------------------- ### register_startup_handler Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md Manually register a function to be called on the module start lifecycle event. This handler function must not take any arguments. ```APIDOC ## register_startup_handler(handler: Callable[[Optional[int]], None]) ### Description Manually register a function `handler` to be called on the module start lifecycle event. This handler function must not take any arguments. ### Parameters * handler (Callable[[Optional[int]], None]) - A function to be called on shutdown lifecycle event. ### Example ```python module = Module('example') def copy_configs(): ... module.register_startup_handler(copy_configs) ``` ``` -------------------------------- ### Check if Enterprise Certificate available Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Checks the status of the enterprise certificate installation. ```APIDOC ## Check if Enterprise Certificate available ### Description Checks if an enterprise certificate is currently installed. ### Method GET ### Endpoint /api/pineap/enterprise/cert ### Response #### Success Response (200) - **installed** (bool) - Indicates whether the certificate is installed. ``` -------------------------------- ### Get Open AP Configuration Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the configuration for the open Wi-Fi access point. ```APIDOC ## GET /api/settings/networking/ap/open ### Description Retrieves the configuration for the open Wi-Fi access point. ### Method GET ### Endpoint /api/settings/networking/ap/open ### Response #### Success Response (200) - **ssid** (string) - The SSID of the open AP. - **country** (string) - The country code for the open AP. - **channel** (number) - The channel for the open AP. - **hidden** (boolean) - Indicates if the SSID is hidden. #### Response Example ```json { "ssid": "MyOpenAP", "country": "US", "channel": 6, "hidden": false } ``` ``` -------------------------------- ### Get Button Script Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the currently configured button script. ```json { "button_script": string } ``` -------------------------------- ### Make API GET Request (Callback) Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Make a GET Request to a specified endpoint. A callback function is provided to handle the response. ```typescript this.API.APIGet('/api/status', (resp) => { console.log(resp); }); ``` -------------------------------- ### Start WPA Handshake Capture Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Initiates a WPA handshake capture process on a specified channel and BSSID. ```APIDOC ## POST /api/pineap/handshakes/start ### Description Initiates a WPA handshake capture process on a specified channel and BSSID. ### Method POST ### Endpoint /api/pineap/handshakes/start ### Parameters #### Request Body - **bssid** (string) - Required - The Basic Service Set Identifier (BSSID) of the target network. - **channel** (number) - Required - The wireless channel to capture on. ``` -------------------------------- ### Get Updates Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Checks for available firmware updates and retrieves their details. ```APIDOC ## GET /api/settings/update/refresh ### Description Checks for available firmware updates and retrieves their details. ### Method GET ### Endpoint /api/settings/update/refresh ### Response #### Success Response Returns details about any available update. #### Response Example ```json { "update_found": true, "update_version": "string", "update_changelog": "string", "channel_closed": false } ``` ``` -------------------------------- ### Start Recon Scan Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/recon/recon.md Upon a successful request to start a scan, the API returns the current scan status and a unique scan ID. ```json { "scanRunning": bool, "scanID": number } ``` -------------------------------- ### Get Resource Information Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves information about the available resources on the device. ```APIDOC ## GET /api/settings/resources ### Description Retrieves information about the available resources on the device. ### Method GET ### Endpoint /api/settings/resources ### Response #### Success Response Returns resource information. #### Response Example ```json { "Resources": "string" } ``` ``` -------------------------------- ### OpkgJob Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md A job to be used with the background JobManager that installs or uninstalls dependencies. ```APIDOC ## OpkgJob ### Description A job to be used with the background JobManager that installs or uninstalls dependencies. ### Methods #### do_work(self, logger) ##### Description If `self.package` is a List: Attempt to install each every package in the list. If a single package fails to install then this method will return False. ##### Parameters * logger: An optional instance of logger to log output from opkg as debug. ##### Returns * bool: True if no errors, False if error. #### stop(self) ##### Description Kill the opkg process if it is running. ##### Parameters None ##### Returns None ``` -------------------------------- ### Generate Enterprise Certificate Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Generates and installs a new enterprise certificate with the provided details. ```APIDOC ## Generate Enterprise Certificate ### Description Creates a new enterprise certificate using the specified details. ### Method POST ### Endpoint /api/pineap/enterprise/generatecert ### Parameters #### Request Body - **state** (string) - Required - The state for the certificate. - **country** (string) - Required - The country for the certificate. - **locality** (string) - Required - The locality for the certificate. - **organization** (string) - Required - The organization for the certificate. - **email** (string) - Required - The email address for the certificate. - **commonname** (string) - Required - The common name for the certificate. ### Response #### Success Response (200) - **success** (true) - Indicates the generation was successful. ``` -------------------------------- ### Register Startup Handler Manually Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md Manually register a function to be called when the module starts. The handler function must not take any arguments. ```python def register_startup_handler(self, handler: Callable[[Optional[int]], None]) Example: module = Module('example') def copy_configs(): ... module.register_startup_handler(copy_configs) ``` -------------------------------- ### Register Startup Handler with Decorator Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md Use the @on_start decorator to register a function as a startup handler. The decorated function will be called automatically when the module's start method is invoked. ```python def on_start(self) Example: @module.on_start() def copy_configs(): ... ``` -------------------------------- ### Get Campaign Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Retrieves the details of a specific campaign by its name. ```APIDOC ## GET /api/campaigns/:name ### Description Retrieves the details of a specific campaign by its name. ### Method GET ### Endpoint /api/campaigns/:name ### Response #### Success Response (200) - **campaign** (Campaign) - The details of the requested campaign. #### Response Example ```json { "campaign": Campaign } ``` ``` -------------------------------- ### uninstall_dependency Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Uninstall a package via opkg if its currently installed. ```APIDOC ## uninstall_dependency(package, logger) ### Description Uninstall a package via opkg if its currently installed. ### Parameters * package: The name of the package to install. * logger: An optional instance of logger to log output from opkg as debug. ### Returns * bool: True if the package was installed, False if it as not. * str: Empty if successful, error message if it was not. ``` -------------------------------- ### Get Routing Table Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the current routing table configuration. ```APIDOC ## GET /api/settings/networking/routes ### Description Retrieves the current routing table configuration. ### Method GET ### Endpoint /api/settings/networking/routes ### Response #### Success Response (200) - **routes** (string) - The routing table configuration. #### Response Example ```json { "routes": "string" } ``` ``` -------------------------------- ### Python Module Back End Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/modules/modules.md This Python script defines a basic module with a 'hello_world' action that returns a string. It uses the pineapple.modules library for handling actions and starting the module. ```python #!/usr/bin/env python3 import logging from pineapple.modules import Module, Request module = Module('MyModule', logging.DEBUG) @module.handles_action('hello_world') def hello_world(request: Request): return 'Hello World' if __name__ == '__main__': module.start() ``` -------------------------------- ### Get USB Devices Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves a list of connected USB devices. ```APIDOC ## GET /api/settings/usb ### Description Retrieves a list of connected USB devices. ### Method GET ### Endpoint /api/settings/usb ### Response #### Success Response Returns a string representing the connected USB devices. #### Response Example ```json { "devices": "string" } ``` ``` -------------------------------- ### OpkgJob Class Definition Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Defines the OpkgJob class, a background job for installing or uninstalling dependencies. ```python class OpkgJob(Job[bool]) ``` -------------------------------- ### Start Recon Scan Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/recon/recon.md Initiates a new reconnaissance scan. You can specify if the scan should be live, the duration, and the band to scan. ```APIDOC ## POST /api/recon/start ### Description Initiates a new reconnaissance scan. You can specify if the scan should be live, the duration, and the band to scan. ### Method POST ### Endpoint /api/recon/start ### Parameters #### Request Body - **live** (bool) - Required - Whether to perform a live scan. - **scan_time** (number) - Required - The duration of the scan in seconds. - **band** (string) - Required - The frequency band to scan (e.g., "2.4GHz", "5GHz"). ### Response #### Success Response (200) - **scanRunning** (bool) - Indicates if a scan is currently running. - **scanID** (number) - The unique identifier for the initiated scan. #### Response Example ```json { "scanRunning": true, "scanID": 12345 } ``` ``` -------------------------------- ### Start WPA Handshake Capture Request Body Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Initiates a WPA handshake capture. Requires the BSSID and channel of the target network. ```json { "bssid": string, "channel": number, } ``` -------------------------------- ### Get PineAP Settings Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Returns the current PineAP configuration settings if the request is successful. ```json { "enablePineAP": bool, "AutoStart": bool, "ap_channel": string, "beacon_interval": string, "beacon_response_interval": string, "beacon_responses": bool, "broadcast_ssid_pool": bool, "capture_ssids": bool, "connect_notifications": bool, "disconnect_notifications": bool, "karma": bool, "logging": bool, "pineap_mac": string, "target_mac": string } ``` -------------------------------- ### Get Network Interfaces Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves a list of all available network interfaces on the device. The response includes details about each interface. ```APIDOC ## GET /api/settings/networking/interfaces ### Description Retrieves a list of all available network interfaces on the device. ### Method GET ### Endpoint /api/settings/networking/interfaces ### Response #### Success Response (200) - An array of network interfaces. (Specific structure not detailed in source) #### Response Example (Example not provided in source) ``` -------------------------------- ### Start Recon Scan Request Body Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/recon/recon.md Use this JSON body to initiate a new reconnaissance scan. Specify if the scan should be live, the scan time in seconds, and the band (e.g., '2.4ghz', '5ghz'). ```json { "live": bool, "scan_time": number, "band": string } ``` -------------------------------- ### Response for Get Update Channel Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Returns the current update channel configuration for the device. ```json { "channel": string } ``` -------------------------------- ### Get Dashboard News Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/dashboard/dashboard.md Example JSON response for the GET /api/dashboard/news endpoint, containing a list of news items. ```json { "news": NewsItem[] } ``` -------------------------------- ### Get Management AP Configuration Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the configuration for the management Wi-Fi access point. ```APIDOC ## GET /api/settings/networking/ap/management ### Description Retrieves the configuration for the management Wi-Fi access point. ### Method GET ### Endpoint /api/settings/networking/ap/management ### Response #### Success Response (200) - **ssid** (string) - The SSID of the management AP. - **password** (string) - The password for the management AP. - **hidden** (boolean) - Indicates if the SSID is hidden. - **disabled** (boolean) - Indicates if the management AP is disabled. #### Response Example ```json { "ssid": "string", "password": "string", "hidden": true, "disabled": false } ``` ``` -------------------------------- ### Get All Campaigns Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Retrieves a list of all configured campaigns. This endpoint returns an object containing an array of campaign objects. ```APIDOC ## GET /api/campaigns ### Description Retrieves a list of all configured campaigns. ### Method GET ### Endpoint /api/campaigns ### Response #### Success Response (200) - **campaigns** (Campaign[]) - An array of campaign objects. #### Response Example ```json { "campaigns": [ { "enabled": true, "content": "string", "name": "string", "created": 0, "type": 0, "timeout": false } ] } ``` ``` -------------------------------- ### Response for Get USB Devices Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Returns a string representing the connected USB devices. The exact format of the string is not specified. ```json { "devices": string } ``` -------------------------------- ### Uninstall Dependency Function Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/opkg_helpers/opkg_helpers.md Uninstalls a package via opkg if it is currently installed. Logs output using an optional logger instance. ```python def uninstall_dependency(package: str, logger: Optional[Logger] = None) -> [bool, str] ``` -------------------------------- ### Get PineAP Enterprise Settings Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves the current configuration settings for PineAP Enterprise mode. ```APIDOC ## GET /api/pineap/enterprise/settings ### Description Retrieves the current configuration settings for PineAP Enterprise mode. ### Method GET ### Endpoint /api/pineap/enterprise/settings ### Response #### Success Response (200) - **enabled** (boolean) - Indicates if Enterprise mode is enabled. - **associations** (boolean) - Indicates if associations are enabled. - **ssid** (string) - The SSID for Enterprise mode. - **mac** (string) - The MAC address configuration. - **type** (string) - The type of Enterprise configuration. - **downgrade** (string) - Downgrade settings. ``` -------------------------------- ### Get WiFi Pineapple Mark 7 Model Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/generic/generic.md Retrieves the specific hardware model of the WiFi Pineapple Mark 7. ```json { "device": string } ``` -------------------------------- ### Make authenticated API request (PUT) Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/authentication/authentication.md Once you have a token, include it in the Authorization header as a Bearer token to make authenticated API requests. This example demonstrates updating notifications. ```bash foxtrot@intent:~$ curl -X PUT http://172.16.42.1:1471/api/notifications -H "Authorization: Bearer eyJVc2VyIjoicm9vdCIsIkV4cGlyeSI6IjIwMjAtMDUtMTdUMTg6NDM6NTEuNjg1NjA5NTJaIn0=.VZpkUmWREeLMtKGx0wZFeWczj8hImbPnulTT5zpnQpM=" -d '{"level": 0, "message": "Hello World!"}' {"success":true} foxtrot@intent:~$ ``` -------------------------------- ### Get Evil WPA Twin AP Configuration Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the current configuration for the Evil WPA Twin AP. ```APIDOC ## GET /api/settings/networking/ap/wpa ### Description Retrieves the current configuration for the Evil WPA Twin AP. ### Method GET ### Endpoint /api/settings/networking/ap/wpa ### Response #### Success Response (200) - **ssid** (string) - The SSID of the AP. - **bssid** (string) - The BSSID of the AP. - **auth** (string) - The authentication method. - **password** (string) - The password for the AP. - **hidden** (bool) - Whether the AP is hidden. - **disabled** (bool) - Whether the AP is disabled. - **capture_handshakes** (bool) - Whether to capture handshakes. #### Response Example { "ssid": "string", "bssid": "string", "auth": "string", "password": "string", "hidden": false, "disabled": false, "capture_handshakes": true } ``` -------------------------------- ### Module Initialization Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/module/module.md Initializes a WiFi Pineapple Module object. Specify the module name and the desired logging level. ```python def __init__(self, name: str, log_level: int = logging.WARNING): ``` -------------------------------- ### Get Connected Clients Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves a list of currently connected clients. Returns Client array if successful. ```APIDOC ## GET /api/pineap/clients ### Description Retrieves a list of currently connected clients. ### Method GET ### Endpoint /api/pineap/clients ### Response #### Success Response (200) - **clients** (Client[]) - Array of connected client objects. ``` -------------------------------- ### Get Network Interfaces Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/helpers/network_helpers/network_helpers.md Retrieves a list of all available network interfaces on the device. This is useful for identifying active network connections. ```python def get_interfaces() -> List[str] ``` -------------------------------- ### List Module Project Files Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/modules/modules.md Lists the files and directories within the src directory of a module project. This helps in understanding the project structure. ```bash (src) >> ls assets lib module.json module.svg public-api.ts ``` ```bash (src) >> ls assets/ README ``` ```bash (src) >> ls lib/ components modules MyModule.module.ts services ``` ```bash (src) >> ``` -------------------------------- ### Get Previously Connected Clients Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves a list of previously connected clients. Returns PreviousClient array if successful. ```APIDOC ## GET /api/pineap/previousclients ### Description Retrieves a list of previously connected clients. ### Method GET ### Endpoint /api/pineap/previousclients ### Response #### Success Response (200) - **previousClients** (PreviousClient[]) - Array of previously connected client objects. ``` -------------------------------- ### Get Open AP Configuration Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Returns the current configuration for the open Access Point. Refer to REST Error Responses for unsuccessful cases. ```json { "ssid": string, "country": string, "channel": number, "hidden": bool } ``` -------------------------------- ### Get Basic PineAP Enterprise Data Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves basic enterprise data. Returns BasicResponse array if successful. ```APIDOC ## GET /api/pineap/enterprise/basicdata ### Description Retrieves basic enterprise data. ### Method GET ### Endpoint /api/pineap/enterprise/basicdata ### Response #### Success Response (200) - **data** (BasicResponse[]) - Array of basic enterprise data objects. ``` -------------------------------- ### Get WiFi Pineapple Mark 7 Model Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/generic/generic.md Retrieves the model name of the WiFi Pineapple Mark 7. ```APIDOC ## GET /api/device ### Description Gets the model name of the WiFi Pineapple Mark 7. ### Method GET ### Endpoint /api/device ### Response #### Success Response (200) - **device** (string) - The model name of the device. ### Response Example ```json { "device": "string" } ``` ``` -------------------------------- ### Build a Module Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/modules/modules.md After generating a module, use the build.sh script within the module's directory to build the module for the WiFi Pineapple. You can optionally package the module for distribution. ```bash (MyModule) >> ./build.sh [*] Angular Build Succeeded [*] Skipping Packaging (Run ./build.sh package to generate) (MyModule) >> ``` -------------------------------- ### Get All Campaign Reports Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Retrieves a list of all available campaign reports. Each report is identified by its file name and full path. ```APIDOC ## GET /api/campaigns/reports ### Description Retrieves a list of all available campaign reports. ### Method GET ### Endpoint /api/campaigns/reports ### Response #### Success Response (200) - **fullPath** (string) - The full path to the report file. - **fileName** (string) - The name of the report file. #### Response Example ```json { "fullPath": "string", "fileName": "string" } ``` ``` -------------------------------- ### Get Logger Function Signature Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/logger/logger.md Defines the signature for the `get_logger` function, specifying its parameters and return type. Use this to instantiate a logger instance. ```python def get_logger(name: str, level: int, log_to_file: bool = True, console_logger_level: int = logging.DEBUG) -> Logger ``` -------------------------------- ### API GET Request Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Makes a GET request to a specified endpoint. This function is intended for use with endpoints documented in the REST API. ```APIDOC ## API GET Request ### Description Make a GET Request to a GET endpoint described in the REST API documentation. ### Method GET ### Endpoint `this.API.APIGet(path: string, callback: (any))` ### Parameters #### Path Parameters - **path** (string) - Required - The path of the GET endpoint. #### Query Parameters None explicitly defined. #### Request Body None. ### Request Example ```typescript this.API.APIGet('/api/status', (resp) => { console.log(resp); }); ``` ### Response #### Success Response - **(any)** - The response from the GET request, passed to the callback function. ``` -------------------------------- ### Perform Update Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Initiates the firmware update process. ```APIDOC ## POST /api/settings/update/apply ### Description Initiates the firmware update process. ### Method POST ### Endpoint /api/settings/update/apply ### Response #### Success Response (200) Indicates the update process has started. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Make Asynchronous API GET Request Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Asynchronously make a GET Request to a specified endpoint. Returns a Promise that resolves with the response. ```typescript const resp: any = await this.API.APIGetAsync('/api/status'); console.log(resp); ``` -------------------------------- ### Create Module Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/modules/modules.md Creates a new module on the WiFi Pineapple. This is typically used for local module creation. ```APIDOC ## PUT /api/modules/create ### Description Creates a new module on the WiFi Pineapple. This is typically used for local module creation. ### Method PUT ### Endpoint /api/modules/create ### Request Body ```json { BODY } ``` ### Response #### Success Response (200) Returns a success response upon successful module creation. ### Response Example ```json { RESPONSE } ``` ``` -------------------------------- ### Asyncronous API GET Request Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Asynchronously makes a GET request to a specified endpoint. This function is intended for use with endpoints documented in the REST API. ```APIDOC ## Asyncronous API GET Request ### Description Asynchronously make a GET Request to a GET endpoint described in the REST API documentation. ### Method GET ### Endpoint `async this.API.APIGetAsync(path: string)` ### Parameters #### Path Parameters - **path** (string) - Required - The path of the GET endpoint. #### Query Parameters None explicitly defined. #### Request Body None. ### Request Example ```typescript const resp: any = await this.API.APIGetAsync('/api/status'); console.log(resp); ``` ### Response #### Success Response - **(any)** - The response from the GET request. ``` -------------------------------- ### Get Filters Client List Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves the list of MAC addresses currently being filtered for clients. Returns MAC addresses separated by newlines. ```APIDOC ## GET /api/pineap/filters/client/list ### Description Retrieves the list of MAC addresses currently being filtered for clients. ### Method GET ### Endpoint /api/pineap/filters/client/list ### Response #### Success Response (200) - MAC addresses separated by newlines. #### Response Example ``` 00:11:22:33:44:55 AA:BB:CC:DD:EE:FF ``` ``` -------------------------------- ### Get PineAP Settings Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves the current configuration settings for the PineAP system. This endpoint returns a JSON object containing various boolean and string parameters that define the PineAP's operational state. ```APIDOC ## GET /api/pineap/settings ### Description Retrieves the current configuration settings for the PineAP system. ### Method GET ### Endpoint /api/pineap/settings ### Response #### Success Response (200) - **enablePineAP** (bool) - Indicates if PineAP is enabled. - **AutoStart** (bool) - Indicates if PineAP should auto-start. - **ap_channel** (string) - The Wi-Fi channel for the AP. - **beacon_interval** (string) - The beacon interval setting. - **beacon_response_interval** (string) - The beacon response interval. - **beacon_responses** (bool) - Whether beacon responses are enabled. - **broadcast_ssid_pool** (bool) - Whether to broadcast the SSID pool. - **capture_ssids** (bool) - Whether to capture SSIDs. - **connect_notifications** (bool) - Whether to enable connect notifications. - **disconnect_notifications** (bool) - Whether to enable disconnect notifications. - **karma** (bool) - The karma setting. - **logging** (bool) - Whether logging is enabled. - **pineap_mac** (string) - The MAC address of the PineAP. - **target_mac** (string) - The target MAC address. #### Response Example ```json { "enablePineAP": true, "AutoStart": false, "ap_channel": "6", "beacon_interval": "100", "beacon_response_interval": "500", "beacon_responses": true, "broadcast_ssid_pool": false, "capture_ssids": true, "connect_notifications": true, "disconnect_notifications": false, "karma": true, "logging": false, "pineap_mac": "00:11:22:33:44:55", "target_mac": "AA:BB:CC:DD:EE:FF" } ``` ``` -------------------------------- ### Get Timezone Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the current timezone setting of the device. ```APIDOC ## GET /api/settings/timezone ### Description Retrieves the device's current timezone. ### Method GET ### Endpoint /api/settings/timezone ### Response #### Success Response (200) - **timezone** (string) - The current timezone setting (e.g., "UTC", "America/New_York"). ### Response Example ```json { "timezone": "UTC" } ``` ``` -------------------------------- ### Enroll in Cloud C2 Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Configures the device for Cloud C2 enrollment. ```APIDOC ## PUT /api/settings/cloudc2/config ### Description Configures the device for Cloud C2 enrollment. ### Method PUT ### Endpoint /api/settings/cloudc2/config ### Request Body - **c2config** (string) - Required - Cloud C2 Configuration details. ### Response #### Success Response (200) Indicates successful configuration for Cloud C2. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get Timezone Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Returns the current system timezone. ```json { "timezone": string } ``` -------------------------------- ### Create New Campaign Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/campaigns/campaigns.md Creates a new campaign with the specified configuration parameters. This endpoint allows for detailed customization of campaign settings. ```APIDOC ## PUT /api/campaigns/create ### Description Creates a new campaign with the specified configuration parameters. ### Method PUT ### Endpoint /api/campaigns/create ### Request Body - **name** (string) - Required - The name of the campaign. - **mode** (number) - Required - The mode of the campaign. - **autoRun** (boolean) - Required - Whether the campaign should auto-run. - **interval** (string) - Required - The interval for the campaign. - **plainReport** (boolean) - Required - Whether to generate a plain text report. - **htmlReport** (boolean) - Required - Whether to generate an HTML report. - **storagePath** (string) - Required - The path for storing campaign data. - **enableC2** (boolean) - Required - Whether to enable C2 communication. - **enableC2Exfil** (boolean) - Required - Whether to enable C2 exfiltration. ### Request Example ```json { "name": "string", "mode": 0, "autoRun": true, "interval": "string", "plainReport": true, "htmlReport": true, "storagePath": "string", "enableC2": true, "enableC2Exfil": true } ``` ``` -------------------------------- ### Connect to Network Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Connects the device to a specified Wi-Fi network in client mode. All necessary network credentials and interface information must be provided. ```json { "ssid": string, "bssid": string, "encryption": string, "password": string, "hidden": bool, "interface": string } ``` -------------------------------- ### Delete Enterprise Certificate Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Deletes the currently installed enterprise certificate. ```APIDOC ## Delete Enterprise Certificate ### Description Removes the enterprise certificate from the system. ### Method DELETE ### Endpoint /api/pineap/enterprise/cert ### Response #### Success Response (200) - **success** (true) - Indicates the deletion was successful. ``` -------------------------------- ### Get WPA Handshakes Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Retrieves a list of all captured WPA handshakes. ```APIDOC ## GET /api/pineap/handshakes ### Description Retrieves a list of all captured WPA handshakes. ### Method GET ### Endpoint /api/pineap/handshakes ### Response #### Success Response (200) - **handshakes** (Handshake[]) - A list of handshake objects. ``` -------------------------------- ### Python Module Back End Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/modules/modules.md This Python script defines a custom module named 'MyModule' that handles the 'hello_world' action. It processes user input and returns a formatted string. ```python #!/usr/bin/env python3 import logging from pineapple.modules import Module, Request module = Module('MyModule', logging.DEBUG) @module.handles_action('hello_world') def check_dependencies(request: Request): return 'You said: {}'.format(request.user_input) if __name__ == '__main__': module.start() ``` -------------------------------- ### Requests Module Initialization Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/python/modules/request/request.md Initializes a WiFi Pineapple Module Request. It includes 'self.module' and 'self.action', along with any parameters from a TypeScript API request. ```python def __init__(self) ``` -------------------------------- ### Get Update Channel Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Retrieves the current update channel configuration. ```APIDOC ## GET /api/settings/update/channel ### Description Retrieves the current update channel configuration. ### Method GET ### Endpoint /api/settings/update/channel ### Response #### Success Response Returns the current update channel. #### Response Example ```json { "channel": "string" } ``` ``` -------------------------------- ### Connect to Network Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Connects the client to a specified network. ```APIDOC ## POST /api/settings/networking/clientmode/connect ### Description Connects the client to a specified network. ### Method POST ### Endpoint /api/settings/networking/clientmode/connect ### Request Body - **ssid** (string) - The SSID of the network to connect to. - **bssid** (string) - The BSSID of the network to connect to. - **encryption** (string) - The encryption type of the network. - **password** (string) - The password for the network. - **hidden** (bool) - Whether the network is hidden. - **interface** (string) - The network interface to use for connecting. ### Request Example { "ssid": "string", "bssid": "string", "encryption": "string", "password": "string", "hidden": false, "interface": "string" } ``` -------------------------------- ### Login to obtain API token Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/authentication/authentication.md Use this snippet to log in with your username and password to obtain an API token. The API responds with an error for invalid credentials or a token on success. ```bash foxtrot@intent:~$ curl -X POST http://172.16.42.1:1471/api/login -d '{"username": "root", "password": "test"}' {"token":"eyJVc2VyIjoicm9vdCIsIkV4cGlyeSI6IjIwMjAtMDUtMTdUMTg6NDM6NTEuNjg1NjA5NTJaIn0=.VZpkUmWREeLMtKGx0wZFeWczj8hImbPnulTT5zpnQpM="} foxtrot@intent:~$ ``` -------------------------------- ### Get Notifications Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/notifications/notifications.md Retrieves a list of all notifications, including their status (read/displayed). ```APIDOC ## GET /api/notifications ### Description Retrieves all notifications. ### Method GET ### Endpoint /api/notifications ### Response #### Success Response (200) - **id** (number) - Unique identifier for the notification. - **message** (string) - The content of the notification. - **level** (number) - The notification level. - **time** (string) - The timestamp when the notification was created. - **read** (boolean) - Indicates if the notification has been read. - **displayed** (boolean) - Indicates if the notification has been displayed to the user. - **module_name** (string) - The name of the module that sent the notification. ### Response Example ```json [ { "id": 1, "message": "Configuration updated.", "level": 0, "time": "2023-10-27T10:00:00Z", "read": false, "displayed": true, "module_name": "Settings" } ] ``` ``` -------------------------------- ### Make a Simple Module Request Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Shows how to make a basic request to a module's action using the ApiService. The payload requires 'module' and 'action' properties. ```typescript // A simple Module request this.API.request({ module: 'ExampleModule', action: 'some_action' }, (response) => { console.log(response); }); ``` -------------------------------- ### PineAPSettings Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Defines the configuration settings for PineAP. ```APIDOC ## PineAPSettings ### Description Represents the configuration settings for the PineAP module. ### Fields - **enablePineAP** (bool) - Whether PineAP is enabled. - **autostartPineAP** (bool) - Whether PineAP should autostart. - **ap_channel** (string) - The Wi-Fi channel for the AP. - **beacon_interval** (string) - The interval for sending beacons. - **beacon_response_interval** (string) - The interval for responding to beacons. - **beacon_responses** (bool) - Whether to respond to beacons. - **broadcast_ssid_pool** (bool) - Whether to broadcast the SSID pool. - **capture_ssids** (bool) - Whether to capture SSIDs. - **connect_notifications** (bool) - Whether to show connection notifications. - **disconnect_notifications** (bool) - Whether to show disconnection notifications. - **karma** (bool) - Whether KARMA mode is enabled. - **logging** (bool) - Whether logging is enabled. - **pineap_mac** (string) - The MAC address of the PineAP interface. - **target_mac** (string) - The target MAC address for PineAP operations. ``` -------------------------------- ### API File Download Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/typescript/typescript.md Initiates a file download from a specified full path to a given filename. ```APIDOC ## API File Download ### Description Initiates a file download from a specified full path to a given filename. ### Method File Download (implied by function name `APIDownload`) ### Parameters #### Path Parameters - **fullpath** (string) - Required - The full path to the file to be downloaded. - **filename** (string) - Required - The desired name for the downloaded file. ### Request Example ```typescript this.API.APIDownload('/tmp/log.txt', 'log-output'); ``` ### Response This method returns void. ``` -------------------------------- ### PineAP Enterprise Certificate Status Response Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/pineap/pineap.md Response indicating whether an enterprise certificate is installed. ```json { "installed": bool } ``` -------------------------------- ### Generate a New Module Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/modules/modules.md Use the create.sh script to generate a new module. You will be prompted for module details such as name, title, author, and description. You can also choose to prepare the Angular workspace for the UI. ```bash (mk7-modules) >> ./create.sh __ ___ ______ _ _____ _ _ \ \ / (_) ____(_) | __ (_) | | \ \ /\ / / _| |__ _ | |__) | _ __ ___ __ _ _ __ _ __ | | ___ \ \/ \/ / | | __| | | | ___/ | '_ \ / _ \/ _` | '_ \| '_ \| |/ _ \ \ /\ / | | | | | | | | | | | | __/ (_| | |_) | |_) | | __/ \/ \/ |_|_| |_| |_| |_|_| |_|\___|\__,_| .__/| .__/|_|\___| Mark 7 Module Creation Helper | | | | Version 1.0 |_| |_| [*] Module Name: MyModule [*] Module Title: My Module [*] Module Author: foxtrot [*] Module Short Description: This is my first module! [*] Creating New Module (TestModule). [!] Would you like to prepare the Angular workspace? [Y/n] y [*] Preparing the Angular workspace. [*] Prepared the Angular workspace. [*] A new module has been created! Exiting. (mk7-modules) >> ``` -------------------------------- ### Reinstall Firmware Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Reinstalls the current firmware on the device. ```APIDOC ## POST /api/settings/update/reinstall ### Description Reinstalls the current firmware on the device. ### Method POST ### Endpoint /api/settings/update/reinstall ### Response #### Success Response (200) Indicates the firmware reinstallation process has started. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Save Open AP Configuration Source: https://github.com/hak5/mk7-docs/blob/gh-pages/docs/rest/settings/settings.md Saves the configuration for the open Wi-Fi access point. ```APIDOC ## PUT /api/settings/networking/ap/open ### Description Saves the configuration for the open Wi-Fi access point. ### Method PUT ### Endpoint /api/settings/networking/ap/open ### Request Body - **ssid** (string) - The SSID of the open AP. - **country** (string) - The country code for the open AP. - **channel** (number) - The channel for the open AP. - **hidden** (boolean) - Indicates if the SSID should be hidden. ### Request Example ```json { "ssid": "MyOpenAP", "country": "US", "channel": 6, "hidden": false } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. #### Response Example ```json { "success": true } ``` ```