Switcher plugin

I’m currently working on the so called “switcher” plugin. The idea is, that on some occasions I’d like to do something different with the raspberry. E.g. when the “bored” or “sad” state is reached, because there is a lot of inactivity. In this case I’d like pwnagotchi to act like an rouge AP and catch some credentials.

At first i wanted to do everything within the plugin (previous name “EvilAp”), but it turns out, we have to reboot the system because the wifi driver is fcked up and hostapd won’t be able to create an AP.

This is why I thought: wait a minute, why not making this whole thing more general (maybe there are other tasks we could run).

And so the switcher plugin was born.

You can add for every emotion (or every other “on_” method of plugins) a set of commands which will be executed. You also have to specify if you want the system to reboot before doing that (important for my usecase). In case of a reboot, you will also have to specify a stopwatch-limit (in minutes) and tell em how long you want to do this task. If you don’t reboot, this will be done in parallel (while pwnagotchi & bettercap are still running).

What do you think?

Main usecase is this:


Config will be like:

            enabled: true
                    enabled: true
                    reboot: true  # reboot raspberry
                      - systemctl start fisch 
                    stopwatch: 15
1 Like

Nice feature.
Looking at https://pwnagotchi.ai/plugins/
I cannot figure how to install switcher

Because this plugin isn’t merged :slight_smile:

Is it possible to add code by myself and test it?

Yes, go ahead

Could you help me with the procedure?
Link for source files and destination… Thanks

cd /usr/local/src/pwnagotchi
git remote add dadav https://github.com/dadav/pwnagotchi.git
git fetch --all
git checkout feature/switcher
pip3 install .