Local


As part of the software components that run on every Pwnagotchi, the pwngrid binary runs in background in peer mode and exposes an API on http://127.0.0.1:8666/ that is used by the other components for nearby units advertisement and detection, but that can also be used easier access the grid API through the unit itself and therefore without any need for authentication other than the SSH authentication you need to access the unit and talk to the local API.

Mesh

GET /api/v1/mesh/{status}

If status is one of true or enabled it will enable WiFi advertising to nearby units, if false or disabled it will disable it.

GET /api/v1/mesh/peers

Returns a list of detected nearby units and their data updated in realtime, sorted by strongest signal first.

Example Response

GET /api/v1/mesh/data

Get the data that’s currently used as advertisement.

Example Response

POST /api/v1/mesh/data

Set the data that’s used as advertisement. Fields that don’t exist will be added, fields set to null will be deleted.

Example Request

GET /api/v1/mesh/memory

Returns a list of all the units that have ever been met.

Example Response

GET /api/v1/mesh/memory/{fingerprint}

Return the historical information of a unit given its fingerprint.

Example Response

Grid

GET /api/v1/data

Get the data that’s currently being sent to the enrollment API.

Example Response

POST /api/v1/data

Set the data that’s currently being sent to the enrollment API. Fields that don’t exist will be added, fields set to null will be deleted. Server side features will be available depending on what you decide to remove from the sent data.

Example Request

GET /api/v1/units

Get a paged list of all the enrolled units, use ?p=2 for pages other than the first one.

Example Response

POST /api/v1/report/ap

Fully opted-in units can use this API to report a pwned access point.

Example Request

PwnMAIL

GET /api/v1/inbox

Get a paged list of all PwnMAIL inbox messages.

Example Response

GET /api/v1/inbox/{id}

Get a message given its identifier. The content is decrypted and its signature verified by the pwngrid binary itself.

Example Response

GET /api/v1/inbox/{id}/{mark}

Mark a message given its identifier, mark can be seen, unseen or deleted.

POST /api/v1/unit/{fingerprint}/inbox

Send a message to a unit by its fingerprint. The content will be automatically encrypted and signed locally by pwngrid.

Example Request