Pwnagotchi’s developement environment is Raspbian + nexmon patches for monitor mode, or any Linux with a monitor mode enabled interface (if you tune config.toml
).
Do not try with Kali on the Raspberry Pi 0 W, it is compiled without hardware floating point support and TensorFlow is simply not available for it, use Raspbian.
The easiest way to extend Pwnagotchi’s functionalities is writing a plugin. Pwnagotchi has a simple plugin system that you can
use to customize your unit and its behavior. You can place your plugins anywhere as Python files, and then edit the
config.toml
file (main.plugins
value) to point to their containing folder.
Check the plugins page for more information.
You can write any type of application on top of our API, sky is the limit!
Currently Pwnagotchi supports several displays and adding support for new ones is very easy! All you have to do is copying the specific Python libraries of the hardware into this folder and then create a new class in its parent folder that implements the methods of the following abstract class:
class DisplayImpl(object):
def __init__(self, config, name):
self.name = name
self.config = config['ui']['display']
self._layout = {
'width': 0,
'height': 0,
'face': (0, 0),
'name': (0, 0),
'channel': (0, 0),
'aps': (0, 0),
'uptime': (0, 0),
'line1': (0, 0),
'line2': (0, 0),
'friend_face': (0, 0),
'friend_name': (0, 0),
'shakes': (0, 0),
'mode': (0, 0),
# status is special :D
'status': {
'pos': (0, 0),
'font': fonts.Medium,
'max': 20
}
}
def layout(self):
raise NotImplementedError
def initialize(self):
raise NotImplementedError
def render(self, canvas):
raise NotImplementedError
def clear(self):
raise NotImplementedError
For instance, the pwnagotchi/ui/hw/oledhat.py file which supports this hat looks like this:
import logging
import pwnagotchi.ui.fonts as fonts
from pwnagotchi.ui.hw.base import DisplayImpl
class OledHat(DisplayImpl):
def __init__(self, config):
super(OledHat, self).__init__(config, 'oledhat')
self._display = None
def layout(self):
fonts.setup(8, 8, 8, 8)
self._layout['width'] = 128
self._layout['height'] = 64
self._layout['face'] = (0, 32)
self._layout['name'] = (0, 10)
self._layout['channel'] = (0, 0)
self._layout['aps'] = (25, 0)
self._layout['uptime'] = (65, 0)
self._layout['line1'] = [0, 9, 128, 9]
self._layout['line2'] = [0, 53, 128, 53]
self._layout['friend_face'] = (0, 41)
self._layout['friend_name'] = (40, 43)
self._layout['shakes'] = (0, 53)
self._layout['mode'] = (103, 10)
self._layout['status'] = {
'pos': (30, 18),
'font': fonts.Small,
'max': 18
}
return self._layout
def initialize(self):
logging.info("initializing oledhat display")
from pwnagotchi.ui.hw.libs.waveshare.oledhat.epd import EPD
self._display = EPD()
self._display.init()
self._display.Clear()
def render(self, canvas):
self._display.display(canvas)
def clear(self):
self._display.clear()
If you want to create a custom image for testing, developing or just hacking, you will need a GNU/Linux computer and the binaries for
curl
, git
, make
, unzip
, go
, qemu-user-static
and kpartx
. The Makefile will also temporarily install packer and use sudo
as needed.
To create a zip file with the image and one with its sha256 checksum, just run:
make image
To remove the generated files:
sudo make clean
If you want to contribute a new translation of Pwnagotchi’s status messages for the UI, do the following:
voice.pot
); the template should NOT be changed manually../scripts/language.sh add <lang> (e.g. "de")
pwnagotchi/locale/<lang>/LC_MESSAGES/voice.po
msgstr
part, NOT the msgid
part!.mo
files:./scripts/language.sh compile <lang>
Sometimes we change old or add new status messages in Pwnagotchi’s UI. If that’s happened and something in the voice.py
the code has changed, users can submit updated translations using the following procedure:
./scripts/language.sh update <lang>
fuzzy
marked strings in the file pwnagotchi/locale/fuzzy
string afterwards.mo
file./scripts/language.sh compile <lang>