diff --git a/Makefile b/Makefile index e95ac5a..2c48571 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ -PACKER_VERSION=1.5.2 +PACKER_VERSION=1.7.2 PWN_HOSTNAME=pwnagotchi PWN_VERSION=master all: clean install image +langs: + @for lang in pwnagotchi/locale/*/; do\ + echo "compiling language: $$lang ..."; \ + ./scripts/language.sh compile $$(basename $$lang); \ + done + install: curl https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_amd64.zip -o /tmp/packer.zip unzip /tmp/packer.zip -d /tmp diff --git a/README.md b/README.md index 2ddd00c..9a2f652 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ full and half WPA handshakes. ![ui](https://i.imgur.com/X68GXrn.png) -Instead of merely playing [Super Mario or Atari games](https://becominghuman.ai/getting-mario-back-into-the-gym-setting-up-super-mario-bros-in-openais-gym-8e39a96c1e41?gi=c4b66c3d5ced) like most reinforcement learning-based "AI" *(yawn)*, Pwnagotchi tunes [its parameters](https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.yml#L73) over time to **get better at pwning WiFi things to** in the environments you expose it to. +Instead of merely playing [Super Mario or Atari games](https://becominghuman.ai/getting-mario-back-into-the-gym-setting-up-super-mario-bros-in-openais-gym-8e39a96c1e41?gi=c4b66c3d5ced) like most reinforcement learning-based "AI" *(yawn)*, Pwnagotchi tunes [its parameters](https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.toml) over time to **get better at pwning WiFi things to** in the environments you expose it to. More specifically, Pwnagotchi is using an [LSTM with MLP feature extractor](https://stable-baselines.readthedocs.io/en/master/modules/policies.html#stable_baselines.common.policies.MlpLstmPolicy) as its policy network for the [A2C agent](https://stable-baselines.readthedocs.io/en/master/modules/a2c.html). If you're unfamiliar with A2C, here is [a very good introductory explanation](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752) (in comic form!) of the basic principles behind how Pwnagotchi learns. (You can read more about how Pwnagotchi learns in the [Usage](https://www.pwnagotchi.ai/usage/#training-the-ai) doc.) diff --git a/builder/data/etc/network/interfaces.d/usb0-cfg b/builder/data/etc/network/interfaces.d/usb0-cfg index 445ed90..18c428d 100644 --- a/builder/data/etc/network/interfaces.d/usb0-cfg +++ b/builder/data/etc/network/interfaces.d/usb0-cfg @@ -4,4 +4,5 @@ iface usb0 inet static netmask 255.255.255.0 network 10.0.0.0 broadcast 10.0.0.255 - gateway 10.0.0.1 \ No newline at end of file + gateway 10.0.0.1 + metric 20 diff --git a/builder/pwnagotchi.json b/builder/pwnagotchi.json index 296d3c6..8f1a095 100644 --- a/builder/pwnagotchi.json +++ b/builder/pwnagotchi.json @@ -4,7 +4,6 @@ "name": "pwnagotchi", "type": "arm-image", "iso_url": "https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-07-12/2019-07-10-raspbian-buster-lite.zip", - "iso_checksum_type": "sha256", "iso_checksum": "9e5cf24ce483bb96e7736ea75ca422e3560e7b455eee63dd28f66fa1825db70e", "last_partition_extra_size": 3221225472 } diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index a294153..15c4f11 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -178,7 +178,7 @@ chdir: /usr/local/src/gratis target: rpi params: - EPD_IO: epd_io.h + EPD_IO: epd_io_free_uart.h PANEL_VERSION: 'V231_G2' when: gratisgit.changed @@ -187,7 +187,7 @@ chdir: /usr/local/src/gratis target: rpi-install params: - EPD_IO: epd_io.h + EPD_IO: epd_io_free_uart.h PANEL_VERSION: 'V231_G2' when: gratisgit.changed @@ -243,13 +243,13 @@ - name: install opencv-python pip: - name: "https://www.piwheels.hostedpi.com/simple/opencv-python/opencv_python-3.4.3.18-cp37-cp37m-linux_armv6l.whl" + name: "https://www.piwheels.org/simple/opencv-python/opencv_python-3.4.3.18-cp37-cp37m-linux_armv6l.whl" extra_args: "--no-deps --no-cache-dir --platform=linux_armv6l --only-binary=:all: --target={{ pip_target.stdout }}" when: (pip_packages['opencv-python'] is undefined) or (pip_packages['opencv-python'] != '3.4.3.18') - name: install tensorflow pip: - name: "https://www.piwheels.hostedpi.com/simple/tensorflow/tensorflow-1.13.1-cp37-none-linux_armv6l.whl" + name: "https://www.piwheels.org/simple/tensorflow/tensorflow-1.13.1-cp37-none-linux_armv6l.whl" extra_args: "--no-deps --no-cache-dir --platform=linux_armv6l --only-binary=:all: --target={{ pip_target.stdout }}" when: (pip_packages['tensorflow'] is undefined) or (pip_packages['tensorflow'] != '1.13.1') diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index 40a4240..cdbb4ce 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -52,6 +52,7 @@ main.plugins.wpa-sec.whitelist = [] main.plugins.wigle.enabled = false main.plugins.wigle.api_key = "" main.plugins.wigle.whitelist = [] +main.plugins.wigle.donate = true main.plugins.bt-tether.enabled = false @@ -183,6 +184,9 @@ ui.faces.angry = "(-_-')" ui.faces.friend = "(♥‿‿♥)" ui.faces.broken = "(☓‿‿☓)" ui.faces.debug = "(#__#)" +ui.faces.upload = "(1__0)" +ui.faces.upload1 = "(1__1)" +ui.faces.upload2 = "(0__1)" ui.web.enabled = true ui.web.address = "0.0.0.0" diff --git a/pwnagotchi/locale/af/LC_MESSAGES/voice.mo b/pwnagotchi/locale/af/LC_MESSAGES/voice.mo new file mode 100644 index 0000000..d55da59 Binary files /dev/null and b/pwnagotchi/locale/af/LC_MESSAGES/voice.mo differ diff --git a/pwnagotchi/locale/af/LC_MESSAGES/voice.po b/pwnagotchi/locale/af/LC_MESSAGES/voice.po new file mode 100644 index 0000000..1efce8b --- /dev/null +++ b/pwnagotchi/locale/af/LC_MESSAGES/voice.po @@ -0,0 +1,248 @@ +# Afrikaans translation of pwnagotchi. +# Copyright (C) 2020. +# This file is distributed under the same license as the pwnagotchi package. +# FIRST AUTHOR MatthewNunu https://github.com/MatthewNunu, 2020. +# +msgid "" +msgstr "" +"Project-Id-Version: 1.5.3\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-11-29 21:50+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: MatthewNunu https://github.com/MatthewNunu\n" +"Language-Team: \n" +"Language: Afrikaans\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "ZzzzZZzzzzZzzz" +msgstr "ZzzzZZzzzzZzzz" + +msgid "Hi, I'm Pwnagotchi! Starting ..." +msgstr "Hi, ek is Pwnagotchi! Aanvang ..." + +msgid "New day, new hunt, new pwns!" +msgstr "Nuwe dag, nuwe jag, nuwe pwns!" + +msgid "Hack the Planet!" +msgstr "Hack die wêreld!" + +msgid "AI ready." +msgstr "AI gereed." + +msgid "The neural network is ready." +msgstr "Die neurale netwerk is gereed." + +msgid "Generating keys, do not turn off ..." +msgstr "Genereer wagwoord, moenie afskakel nie ..." + +#, python-brace-format +msgid "Hey, channel {channel} is free! Your AP will say thanks." +msgstr "Haai, kanaal {channel} is gratis! Jou AP sal dankie sê." + +msgid "Reading last session logs ..." +msgstr "Lees laaste sessie logs ..." + +#, python-brace-format +msgid "Read {lines_so_far} log lines so far ..." +msgstr "Ek het {lines_so_far} tot dusver gelees ..." + +msgid "I'm bored ..." +msgstr "Ek's verveeld ..." + +msgid "Let's go for a walk!" +msgstr "Kom ons gaan vir 'n loopie!" + +msgid "This is the best day of my life!" +msgstr "Dit is die beste dag van my lewe!" + +msgid "Shitty day :/" +msgstr "Poes kak dag :/" + +msgid "I'm extremely bored ..." +msgstr "Ek's baie verveeld ..." + +msgid "I'm very sad ..." +msgstr "Ek's baie hartseer ..." + +msgid "I'm sad" +msgstr "Ek's hartseer ..." + +msgid "Leave me alone ..." +msgstr "Los my uit ..." + +msgid "I'm mad at you!" +msgstr "Ek is kwaad vir jou!" + +msgid "I'm living the life!" +msgstr "Ek leef die lewe!" + +msgid "I pwn therefore I am." +msgstr "Ek pwn daarom is ek." + +msgid "So many networks!!!" +msgstr "Soveel netwerke!!!" + +msgid "I'm having so much fun!" +msgstr "Ek het soveel pret!" + +msgid "My crime is that of curiosity ..." +msgstr "My misdaad is dié van nuuskierigheid ..." + +#, python-brace-format +msgid "Hello {name}! Nice to meet you." +msgstr "Hallo {name}! Lekker om jou te ontmoet." + +#, python-brace-format +msgid "Yo {name}! Sup?" +msgstr "Yo {name}! Sup?" + +#, python-brace-format +msgid "Hey {name} how are you doing?" +msgstr "Haai {name} hoe doen jy?" + +#, python-brace-format +msgid "Unit {name} is nearby!" +msgstr "Eenheid {name}} is naby!" + +#, python-brace-format +msgid "Uhm ... goodbye {name}" +msgstr "Uhm ... totsiens {name}" + +#, python-brace-format +msgid "{name} is gone ..." +msgstr "{name} is weg ..." + +#, python-brace-format +msgid "Whoops ... {name} is gone." +msgstr "Whoops ... {name} is weg." + +#, python-brace-format +msgid "{name} missed!" +msgstr "{name} gemis!" + +msgid "Missed!" +msgstr "Gemis!" + +msgid "Good friends are a blessing!" +msgstr "Goeie vriende is 'n seën!" + +msgid "I love my friends!" +msgstr "Ek is lief vir my vriende!" + +msgid "Nobody wants to play with me ..." +msgstr "Niemand wil met my speel nie ..." + +msgid "I feel so alone ..." +msgstr "Ek voel so alleen ..." + +msgid "Where's everybody?!" +msgstr "Waar is almal?!" + +#, python-brace-format +msgid "Napping for {secs}s ..." +msgstr "Slaap vir {secs}s ..." + +msgid "Zzzzz" +msgstr "Zzzzz" + +#, python-brace-format +msgid "ZzzZzzz ({secs}s)" +msgstr "ZzzZzzz ({secs}s)" + +msgid "Good night." +msgstr "Goeie nag." + +msgid "Zzz" +msgstr "Zzz" + +#, python-brace-format +msgid "Waiting for {secs}s ..." +msgstr "Wag tans vir {secs}s ..." + +#, python-brace-format +msgid "Looking around ({secs}s)" +msgstr "Rondkyk ({secs}s)" + +#, python-brace-format +msgid "Hey {what} let's be friends!" +msgstr "Haai {what} kom ons wees vriende!" + +#, python-brace-format +msgid "Associating to {what}" +msgstr "Assosieer na {what}" + +#, python-brace-format +msgid "Yo {what}!" +msgstr "Yo {what}!" + +#, python-brace-format +msgid "Just decided that {mac} needs no WiFi!" +msgstr "Net besluit dat {mac} geen WiFi nodig het nie!" + +#, python-brace-format +msgid "Deauthenticating {mac}" +msgstr "Deauthenticating {mac}" + +#, python-brace-format +msgid "Kickbanning {mac}!" +msgstr "Kickbanning {mac}!" + +#, python-brace-format +msgid "Cool, we got {num} new handshake{plural}!" +msgstr "Koel, ons het {num} nuwe handdruk gekry!" + +#, python-brace-format +msgid "You have {count} new message{plural}!" +msgstr "Jy het {count} nuwe boodskap!" + +msgid "Oops, something went wrong ... Rebooting ..." +msgstr "Oops, iets het verkeerd gegaan ... Herlaai ..." + +#, python-brace-format +msgid "Kicked {num} stations\n" +msgstr "Geskop {num} stasies\n" + +#, python-brace-format +msgid "Made {num} new friends\n" +msgstr "Gemaak {num} nuwe vriende\n" + +#, python-brace-format +msgid "Got {num} handshakes\n" +msgstr "Het {num} handdrukke\n" + +msgid "Met 1 peer" +msgstr "Ontmoet 1 eweknie" + +#, python-brace-format +msgid "Met {num} peers" +msgstr "Ontmoet {num} eweknie" + +#, python-brace-format +msgid "" +"I've been pwning for {duration} and kicked {deauthed} clients! I've also met " +"{associated} new friends and ate {handshakes} handshakes! #pwnagotchi " +"#pwnlog #pwnlife #hacktheplanet #skynet" +msgstr "" +"Ek was pwning vir {duration} en het {deauthed} kliënte geskop! Ek het ook ontmoet " +"{associated} nuwe vriende en het {handshakes} handdrukke geëet! #pwnagotchi " +"#pwnlog #pwnlife #hacktheplanet #skynet" + +msgid "hours" +msgstr "uur" + +msgid "minutes" +msgstr "minute" + +msgid "seconds" +msgstr "sekondes" + +msgid "hour" +msgstr "uur" + +msgid "minute" +msgstr "minuut" + +msgid "second" +msgstr "tweede" diff --git a/pwnagotchi/locale/ch/LC_MESSAGES/voice.mo b/pwnagotchi/locale/ch/LC_MESSAGES/voice.mo index a917080..84cff02 100644 Binary files a/pwnagotchi/locale/ch/LC_MESSAGES/voice.mo and b/pwnagotchi/locale/ch/LC_MESSAGES/voice.mo differ diff --git a/pwnagotchi/locale/ch/LC_MESSAGES/voice.po b/pwnagotchi/locale/ch/LC_MESSAGES/voice.po index 3e464d2..74e61b5 100644 --- a/pwnagotchi/locale/ch/LC_MESSAGES/voice.po +++ b/pwnagotchi/locale/ch/LC_MESSAGES/voice.po @@ -40,7 +40,7 @@ msgstr "创建密钥中, 请勿断电..." #, python-brace-format msgid "Hey, channel {channel} is free! Your AP will say thanks." -msgstr "" +msgstr "嘿,频道{channel}是免费的!你的AP会说谢谢。" msgid "I'm bored ..." msgstr "我无聊了..." @@ -84,7 +84,7 @@ msgstr "你好{name}!很高兴认识你." #, python-brace-format msgid "Unit {name} is nearby!" -msgstr "" +msgstr "小队{name}就在附近!" #, python-brace-format msgid "Uhm ... goodbye {name}" @@ -193,7 +193,7 @@ msgid "Got {num} handshakes\n" msgstr "捕获了{num}握手包\n" msgid "Met 1 peer" -msgstr "" +msgstr "有{num}同龄人" #, python-brace-format msgid "Met {num} peers" diff --git a/pwnagotchi/locale/es/LC_MESSAGES/voice.mo b/pwnagotchi/locale/es/LC_MESSAGES/voice.mo index 25567cc..4e26cba 100644 Binary files a/pwnagotchi/locale/es/LC_MESSAGES/voice.mo and b/pwnagotchi/locale/es/LC_MESSAGES/voice.mo differ diff --git a/pwnagotchi/locale/es/LC_MESSAGES/voice.po b/pwnagotchi/locale/es/LC_MESSAGES/voice.po index fbf182c..5f9da7e 100644 --- a/pwnagotchi/locale/es/LC_MESSAGES/voice.po +++ b/pwnagotchi/locale/es/LC_MESSAGES/voice.po @@ -8,25 +8,26 @@ msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-10-09 17:42+0200\n" -"PO-Revision-Date: 2019-10-09 21:07+0000\n" -"Last-Translator: diegopastor \n" -"Language-Team: LANGUAGE \n" -"Language: spanish\n" +"PO-Revision-Date: 2020-08-25 23:06+0200\n" +"Last-Translator: Sergio Ruiz \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language-Team: \n" +"X-Generator: Poedit 2.4.1\n" msgid "ZzzzZZzzzzZzzz" msgstr "ZzzzZZzzzzZzzz" msgid "Hi, I'm Pwnagotchi! Starting ..." -msgstr "Hola, soy Pwnagotchi! Empezando ..." +msgstr "¡Hola, soy Pwnagotchi! Empezando ..." msgid "New day, new hunt, new pwns!" -msgstr "Nuevo día, nueva cazería, nuevos pwns!" +msgstr "Nuevo día, nueva caceria, nuevos pwns!" msgid "Hack the Planet!" -msgstr "Hackea el planeta!" +msgstr "¡Hackea el planeta!" msgid "AI ready." msgstr "IA lista." @@ -36,51 +37,51 @@ msgstr "La red neuronal está lista." #, python-brace-format msgid "Hey, channel {channel} is free! Your AP will say thanks." -msgstr "Oye, el canal {channel} está libre! Tú AP lo agradecerá." +msgstr "¡Oye, el canal {channel} está libre! Tu AP lo agradecerá." msgid "I'm bored ..." msgstr "Estoy aburrido ..." msgid "Let's go for a walk!" -msgstr "Vamos por un paseo!" +msgstr "¡Vamos por un paseo!" msgid "This is the best day of my life!" -msgstr "Este es el mejor día de mi vida!" +msgstr "¡Este es el mejor día de mi vida!" msgid "Shitty day :/" msgstr "Día de mierda :/" msgid "I'm extremely bored ..." -msgstr "Estoy extremadamente aburrido ..." +msgstr "Estoy muy aburrido ..." msgid "I'm very sad ..." msgstr "Estoy muy triste ..." msgid "I'm sad" -msgstr "Estoy triste." +msgstr "Estoy triste" msgid "I'm living the life!" -msgstr "Estoy viviendo la vida!" +msgstr "¡Estoy viviendo la vida!" msgid "I pwn therefore I am." -msgstr "Pwneo, por lo tanto, existo" +msgstr "Pwneo, luego existo." msgid "So many networks!!!" -msgstr "Cuantas redes!!!" +msgstr "¡¡¡Cuántas redes!!!" msgid "I'm having so much fun!" -msgstr "Me estoy divirtiendo mucho!" +msgstr "¡Me estoy divirtiendo mucho!" msgid "My crime is that of curiosity ..." -msgstr "Mi único crimen es la curiosidad ..." +msgstr "Mi crimen es la curiosidad ..." #, python-brace-format msgid "Hello {name}! Nice to meet you. {name}" -msgstr "Hola {name}! encantado de conocerte." +msgstr "¡Hola {name}! Encantado de conocerte. {name}" #, python-brace-format msgid "Unit {name} is nearby! {name}" -msgstr "La unidad {name} está cerca!" +msgstr "¡La unidad {name} está cerca! {name}" #, python-brace-format msgid "Uhm ... goodbye {name}" @@ -92,14 +93,14 @@ msgstr "{name} se fue ..." #, python-brace-format msgid "Whoops ... {name} is gone." -msgstr "Uy ... {name} se fue" +msgstr "Ups ... {name} se fue." #, python-brace-format msgid "{name} missed!" -msgstr "{name} perdido!" +msgstr "¡{name} perdido!" msgid "Missed!" -msgstr "Perdido!" +msgstr "¡Perdido!" msgid "Nobody wants to play with me ..." msgstr "Nadie quiere jugar conmigo ..." @@ -108,11 +109,11 @@ msgid "I feel so alone ..." msgstr "Me siento tan solo ..." msgid "Where's everybody?!" -msgstr "Dónde está todo el mundo?" +msgstr "¡¿Dónde está todo el mundo?!" #, python-brace-format msgid "Napping for {secs}s ..." -msgstr "Tomándo una siesta por {secs}s ..." +msgstr "Descansando durante {secs}s ..." msgid "Zzzzz" msgstr "Zzzzz" @@ -133,23 +134,23 @@ msgstr "Esperando {secs}s .." #, python-brace-format msgid "Looking around ({secs}s)" -msgstr "Mirando al rededor ({secs}s)" +msgstr "Mirando alrededor ({secs}s)" #, python-brace-format msgid "Hey {what} let's be friends!" -msgstr "Oye {what} seamos amigos!" +msgstr "¡Oye {what} seamos amigos!" #, python-brace-format msgid "Associating to {what}" -msgstr "Asociando a {what}" +msgstr "Asociándome a {what}" #, python-brace-format msgid "Yo {what}!" -msgstr "Ey {what}!" +msgstr "¡Ey {what}!" #, python-brace-format msgid "Just decided that {mac} needs no WiFi!" -msgstr "Acabo de decidir que {mac} no necesita WiFi!" +msgstr "¡Acabo de decidir que {mac} no necesita WiFi!" #, python-brace-format msgid "Deauthenticating {mac}" @@ -157,14 +158,14 @@ msgstr "Desautenticando a {mac}" #, python-brace-format msgid "Kickbanning {mac}!" -msgstr "Expulsando y banneando a {mac}!" +msgstr "¡Expulsando y baneando a {mac}!" #, python-brace-format msgid "Cool, we got {num} new handshake{plural}!" -msgstr "Genial, obtuvimos {num} nuevo{plural} handshake{plural}!" +msgstr "¡Genial, obtuvimos {num} nuevo{plural} handshake{plural}!" msgid "Oops, something went wrong ... Rebooting ..." -msgstr "Oops, algo salió mal ... Reiniciándo ..." +msgstr "Oops, algo salió mal ... Reiniciando ..." #, python-brace-format msgid "Kicked {num} stations\n" @@ -172,27 +173,27 @@ msgstr "Expulsamos {num} estaciones\n" #, python-brace-format msgid "Made {num} new friends\n" -msgstr "Hicimos {num} nuevos amigos\n" +msgstr "Hice {num} nuevos amigos\n" #, python-brace-format msgid "Got {num} handshakes\n" -msgstr "Obtuvimos {num} handshakes\n" +msgstr "Consegui {num} handshakes\n" msgid "Met 1 peer" -msgstr "Conocí 1 igual" +msgstr "Conocí 1 colega" #, python-brace-format msgid "Met {num} peers" -msgstr "Conocí {num} iguales" +msgstr "Conocí {num} colegas" #, python-brace-format msgid "" "I've been pwning for {duration} and kicked {deauthed} clients! I've also met " -"{associated} new friends and ate {handshakes} handshakes! #pwnagotchi " -"#pwnlog #pwnlife #hacktheplanet #skynet" +"{associated} new friends and ate {handshakes} handshakes! #pwnagotchi #pwnlog " +"#pwnlife #hacktheplanet #skynet" msgstr "" -"He estado pwneando por {duration} y expulsé {deauthed} clientes! También conocí" -"{associated} nuevos amigos y me comí {handshakes} handshakes! #pwnagotchi " +"¡He estado pwneando por {duration} y expulsé {deauthed} clientes! También " +"conocí {associated} nuevos amigos y comí {handshakes} handshakes! #pwnagotchi " "#pwnlog #pwnlife #hacktheplanet #skynet" msgid "hours" diff --git a/pwnagotchi/locale/nl/LC_MESSAGES/voice.mo b/pwnagotchi/locale/nl/LC_MESSAGES/voice.mo index 562f7f4..ddef7e5 100644 Binary files a/pwnagotchi/locale/nl/LC_MESSAGES/voice.mo and b/pwnagotchi/locale/nl/LC_MESSAGES/voice.mo differ diff --git a/pwnagotchi/locale/nl/LC_MESSAGES/voice.po b/pwnagotchi/locale/nl/LC_MESSAGES/voice.po index 57a129f..469360b 100644 --- a/pwnagotchi/locale/nl/LC_MESSAGES/voice.po +++ b/pwnagotchi/locale/nl/LC_MESSAGES/voice.po @@ -20,7 +20,7 @@ msgid "ZzzzZZzzzzZzzz" msgstr "ZzzzZZzzzzZzzz" msgid "Hi, I'm Pwnagotchi! Starting ..." -msgstr "Hoi, Ik ben Pwnagotchi! Opstarten ..." +msgstr "Hoi, Ik ben Pwnagotchi! Aan het opstarten ..." msgid "New day, new hunt, new pwns!" msgstr "Nieuwe dag, nieuwe jacht, nieuwe pwns!" @@ -32,7 +32,7 @@ msgid "AI ready." msgstr "AI is klaar." msgid "The neural network is ready." -msgstr "Neuronen netwerkis klaar voor gebruik." +msgstr "Neuronen netwerk is klaar." #, python-brace-format msgid "Hey, channel {channel} is free! Your AP will say thanks." @@ -42,37 +42,37 @@ msgid "I'm bored ..." msgstr "Ik verveel me ..." msgid "Let's go for a walk!" -msgstr "Laten we een rondje lopen!" +msgstr "Laten we gaan wandelen!" msgid "This is the best day of my life!" msgstr "Dit is de beste dag van mijn leven!" msgid "Shitty day :/" -msgstr "Ruk dag :/" +msgstr "Wat een rotdag :/" msgid "I'm extremely bored ..." msgstr "Ik verveel me kapot ..." msgid "I'm very sad ..." -msgstr "Ik ben ergverdrietig ..." +msgstr "Ik ben erg verdrietig ..." msgid "I'm sad" msgstr "Ik ben verdrietig" msgid "I'm living the life!" -msgstr "Beter kan het levenniet worden!" +msgstr "Beter kan het leven niet worden!" msgid "I pwn therefore I am." -msgstr "Ik pwn daarom besta ik." +msgstr "Ik pwn daarom ben ik er." msgid "So many networks!!!" msgstr "Zo veel netwerken!!!" msgid "I'm having so much fun!" -msgstr "Dit is zo leuk!" +msgstr "Ik heb zoveel plezier!" msgid "My crime is that of curiosity ..." -msgstr "Mijn enige misdrijf is mijn nieuwsgierigheid ..." +msgstr "Mijn misdrijf is mijn nieuwsgierigheid ..." #, python-brace-format msgid "Hello {name}! Nice to meet you. {name}" @@ -88,11 +88,11 @@ msgstr "Uhm ...tot ziens {name}" #, python-brace-format msgid "{name} is gone ..." -msgstr "{name} is weg" +msgstr "{name} is weg ..." #, python-brace-format msgid "Whoops ... {name} is gone." -msgstr "Whoopsie ...{name} is weg" +msgstr "Whoopsie ...{name} is weg." #, python-brace-format msgid "{name} missed!" @@ -102,10 +102,10 @@ msgid "Missed!" msgstr "Gemist!" msgid "Nobody wants to play with me ..." -msgstr "Niemand wil metmij spelen ..." +msgstr "Niemand wil met mij spelen ..." msgid "I feel so alone ..." -msgstr "Zo alleen ..." +msgstr "Ik voel me zo alleen ..." msgid "Where's everybody?!" msgstr "Waar is iedereen?!" @@ -119,11 +119,11 @@ msgstr "Zzzzz" #, python-brace-format msgid "ZzzZzzz ({secs}s)" -msgstr "" +msgstr "ZzzZzzz ({secs}s)" #, python-brace-format msgid "Waiting for {secs}s ..." -msgstr "Even {secs}s wachten ..." +msgstr "Ik wacht voor {secs}s ..." #, python-brace-format msgid "Looking around ({secs}s)" @@ -131,7 +131,7 @@ msgstr "Rond kijken ({secs}s)" #, python-brace-format msgid "Hey {what} let's be friends!" -msgstr "Hey {what}, laten we vriendenworden!" +msgstr "Hey {what}, laten we vrienden worden!" #, python-brace-format msgid "Associating to {what}" @@ -139,26 +139,26 @@ msgstr "Verbinden met {what}" #, python-brace-format msgid "Yo {what}!" -msgstr "" +msgstr "Yo {what}!" #, python-brace-format msgid "Just decided that {mac} needs no WiFi!" -msgstr "Ik vind dat {mac} genoeg WiFiheeft gehad!" +msgstr "Ik besloot dat {mac} geen WiFi meer nodig heeft!" #, python-brace-format msgid "Deauthenticating {mac}" -msgstr "De-autoriseren {mac}" +msgstr "Deauthenticatie van {mac}" #, python-brace-format msgid "Kickbanning {mac}!" -msgstr "Ik ga {mac} even kicken!" +msgstr "Kickbanning {mac}!" #, python-brace-format msgid "Cool, we got {num} new handshake{plural}!" -msgstr "Gaaf, we hebben {num} nieuwe handshake{plural}!" +msgstr "Cool, we hebben {num} nieuwe handshake{plural}!" msgid "Oops, something went wrong ... Rebooting ..." -msgstr "Oops, iets ging fout ...Rebooting ..." +msgstr "Oops, er ging iets fout ...Rebooting ..." #, python-brace-format msgid "Kicked {num} stations\n" @@ -166,11 +166,11 @@ msgstr "{num} stations gekicked\n" #, python-brace-format msgid "Made {num} new friends\n" -msgstr "{num} nieuwe vrienden\n" +msgstr "{num} nieuwe vrienden gemaakt.\n" #, python-brace-format msgid "Got {num} handshakes\n" -msgstr "{num} nieuwe handshakes\n" +msgstr "Ik heb {num} nieuwe handshakes\n" msgid "Met 1 peer" msgstr "1 peer ontmoet" @@ -190,19 +190,19 @@ msgstr "" "gegeten! #pwnagotchi #pwnlog #pwnlife #hacktheplanet #skynet" msgid "hours" -msgstr "" +msgstr "uren" msgid "minutes" -msgstr "" +msgstr "minuten" msgid "seconds" -msgstr "" +msgstr "seconden" msgid "hour" -msgstr "" +msgstr "uur" msgid "minute" -msgstr "" +msgstr "minuut" msgid "second" -msgstr "" +msgstr "seconde" diff --git a/pwnagotchi/locale/tw/LC_MESSAGES/voice.mo b/pwnagotchi/locale/tw/LC_MESSAGES/voice.mo new file mode 100644 index 0000000..afa35f7 Binary files /dev/null and b/pwnagotchi/locale/tw/LC_MESSAGES/voice.mo differ diff --git a/pwnagotchi/locale/tw/LC_MESSAGES/voice.po b/pwnagotchi/locale/tw/LC_MESSAGES/voice.po new file mode 100644 index 0000000..360890c --- /dev/null +++ b/pwnagotchi/locale/tw/LC_MESSAGES/voice.po @@ -0,0 +1,227 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , 2020. +# 有很多翻譯不到味,如果有繁體愛好者,歡迎之後大家一起翻譯! + +msgid "" +msgstr "" +"Project-Id-Version: 0.0.1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-10-21 15:56+0200\n" +"PO-Revision-Date: 2020-10-22 10:00+0008\n" +"Last-Translator: ShaqKSmith \n" +"Language-Team: LANGUAGE \n" +"Language: traditional chinese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "ZzzzZZzzzzZzzz" +msgstr "ZzzzZZzzzzZzzz" + +msgid "Hi, I'm Pwnagotchi! Starting ..." +msgstr "HI!我是Pwnagotchi!\n程式啟動..." + +msgid "New day, new hunt, new pwns!" +msgstr "新的一天!\n新的狩獵!新的入侵!" + +msgid "Hack the Planet!" +msgstr "我要駭入\n地球的所有人!" + +msgid "AI ready." +msgstr "人工智慧已啟動." + +msgid "The neural network is ready." +msgstr "神經網路已啟動." + +msgid "Generating keys, do not turn off ..." +msgstr "產生金鑰中,\n請勿關閉..." + +#, python-brace-format +msgid "Hey, channel {channel} is free! Your AP will say thanks." +msgstr "嘿,{channel}很順暢!\n你的WIFI會感謝你的." + +msgid "I'm bored ..." +msgstr "我好無聊..." + +msgid "Let's go for a walk!" +msgstr "我們出去走走吧!" + +msgid "This is the best day of my life!" +msgstr "這是我生命中最美好的一天!" + +msgid "Shitty day :/" +msgstr "糟糕的一天 :/" + +msgid "I'm extremely bored ..." +msgstr "我超無聊的..." + +msgid "I'm very sad ..." +msgstr "我好難過..." + +msgid "I'm sad" +msgstr "傷心。" + +msgid "I'm living the life!" +msgstr "真是充實的一生!" + +msgid "I pwn therefore I am." +msgstr "我駭故我在." + +msgid "So many networks!!!" +msgstr "好多網路啊!!!" + +msgid "I'm having so much fun!" +msgstr "我玩的超級開心!" + +msgid "My crime is that of curiosity ..." +msgstr "我的缺點就是\n太好奇了..." + +#, python-brace-format +msgid "Hello {name}! Nice to meet you." +msgstr "Hello{name}!\n很高興認識你." + +#, python-brace-format +msgid "Unit {name} is nearby!" +msgstr "{name}\n就在附近!" + +#, python-brace-format +msgid "Uhm ... goodbye {name}" +msgstr "啊 ... \n拜拜{name}" + +#, python-brace-format +msgid "{name} is gone ..." +msgstr "{name}\n不見了 ..." + +#, python-brace-format +msgid "Whoops ... {name} is gone." +msgstr "歐哦...\n{name}\n不見了." + +#, python-brace-format +msgid "{name} missed!" +msgstr "我剛剛錯過了{name}!" + +msgid "Missed!" +msgstr "又錯過了!" + +msgid "Good friends are a blessing!" +msgstr "有個好朋友\n真幸福!" + +msgid "I love my friends!" +msgstr "我喜歡\n我的朋友!" + +msgid "Nobody wants to play with me ..." +msgstr "沒人想跟我玩..." + +msgid "I feel so alone ..." +msgstr "我感覺好孤單..." + +msgid "Where's everybody?!" +msgstr "大家都去哪裡了?!" + +#, python-brace-format +msgid "Napping for {secs}s ..." +msgstr "我想瞇{secs}秒一下..." + +msgid "Zzzzz" +msgstr "Zzzzz" + +#, python-brace-format +msgid "ZzzZzzz ({secs}s)" +msgstr "ZzzZzzz({secs}秒)" + +msgid "Good night." +msgstr "晚安." + +msgid "Zzz" +msgstr "Zzz" + +#, python-brace-format +msgid "Waiting for {secs}s ..." +msgstr "等我{secs}秒..." + +#, python-brace-format +msgid "Looking around ({secs}s)" +msgstr "環顧四周({secs}秒)" + +#, python-brace-format +msgid "Hey {what} let's be friends!" +msgstr "嗨\n{what}\n讓我我們來當朋友吧!" + +#, python-brace-format +msgid "Associating to {what}" +msgstr "正在連接\n{what}" + +#, python-brace-format +msgid "Yo {what}!" +msgstr "喲,\n{what}!" + +#, python-brace-format +msgid "Just decided that {mac} needs no WiFi!" +msgstr "我要讓\n{mac}\n斷線!\n他不需要上網!" + +#, python-brace-format +msgid "Deauthenticating {mac}" +msgstr "解除\n{mac}\n的授權中" + +#, python-brace-format +msgid "Kickbanning {mac}!" +msgstr "把\n{mac}\n踢出中!" + +#, python-brace-format +msgid "Cool, we got {num} new handshake{plural}!" +msgstr "酷哦,我們抓到{num}個\n新的握手包{plural}!" + +#, python-brace-format +msgid "You have {count} new message{plural}!" +msgstr "你有{count}個新訊息{plural}!" + +msgid "Oops, something went wrong ... Rebooting ..." +msgstr "喔歐,有些地方出錯了...\n重新啟動中..." + +#, python-brace-format +msgid "Kicked {num} stations\n" +msgstr "踢了 {num} 個設備\n" + +#, python-brace-format +msgid "Made {num} new friends\n" +msgstr "交了 {num} 個新朋友\n" + +#, python-brace-format +msgid "Got {num} handshakes\n" +msgstr "捕獲了 {num} 個握手包\n" + +msgid "Met 1 peer 同好" +msgstr "遇到了 1 個" + +#, python-brace-format +msgid "Met {num} peers" +msgstr "遇到了 {num} 個同好" + +#, python-brace-format +msgid "" +"I've been pwning for {duration} and kicked {deauthed} clients! I've also met " +"{associated} new friends and ate {handshakes} handshakes! #pwnagotchi " +"#pwnlog #pwnlife #hacktheplanet #skynet" +msgstr "我花了{duration}的時間\n駭入和踢了{deauthed}好多設備.\n" +"我還交了好多{associated}新朋友,\n而且抓到了{handshakes}握手包!" +"#pwnagotchi#入侵日志 #駭客人生 #入侵整個星球 #天網" + +msgid "hours" +msgstr "時" + +msgid "minutes" +msgstr "分" + +msgid "seconds" +msgstr "秒" + +msgid "hour" +msgstr "時" + +msgid "minute" +msgstr "分" + +msgid "second" +msgstr "秒" diff --git a/pwnagotchi/locale/voice.pot b/pwnagotchi/locale/voice.pot index 4b62ea9..0b9fcb8 100644 --- a/pwnagotchi/locale/voice.pot +++ b/pwnagotchi/locale/voice.pot @@ -244,3 +244,7 @@ msgstr "" msgid "second" msgstr "" + +#, python-brace-format +msgid "Uploading data to {to} ..." +msgstr "" diff --git a/pwnagotchi/plugins/default/memtemp.py b/pwnagotchi/plugins/default/memtemp.py index f64e287..898df2f 100644 --- a/pwnagotchi/plugins/default/memtemp.py +++ b/pwnagotchi/plugins/default/memtemp.py @@ -1,6 +1,6 @@ # memtemp shows memory infos and cpu temperature # -# mem usage, cpu load, cpu temp +# mem usage, cpu load, cpu temp, cpu frequency # ############################################################### # @@ -16,8 +16,15 @@ # - Added CPU load # - Added horizontal and vertical orientation # +# 19-09-2020 by crahan +# - Added CPU frequency +# - Made field types and order configurable (max 3 fields) +# - Made line spacing and position configurable +# - Updated code to dynamically generate UI elements +# - Changed horizontal UI elements to Text +# - Updated to version 1.0.2 ############################################################### -from pwnagotchi.ui.components import LabeledValue +from pwnagotchi.ui.components import LabeledValue, Text from pwnagotchi.ui.view import BLACK import pwnagotchi.ui.fonts as fonts import pwnagotchi.plugins as plugins @@ -27,54 +34,31 @@ import logging class MemTemp(plugins.Plugin): __author__ = 'https://github.com/xenDE' - __version__ = '1.0.1' + __version__ = '1.0.2' __license__ = 'GPL3' __description__ = 'A plugin that will display memory/cpu usage and temperature' + ALLOWED_FIELDS = { + 'mem': 'mem_usage', + 'cpu': 'cpu_load', + 'temp': 'cpu_temp', + 'freq': 'cpu_freq' + } + DEFAULT_FIELDS = ['mem', 'cpu', 'temp'] + LINE_SPACING = 10 + LABEL_SPACING = 0 + FIELD_WIDTH = 4 + def on_loaded(self): logging.info("memtemp plugin loaded.") def mem_usage(self): - return int(pwnagotchi.mem_usage() * 100) + return f"{int(pwnagotchi.mem_usage() * 100)}%" def cpu_load(self): - return int(pwnagotchi.cpu_load() * 100) + return f"{int(pwnagotchi.cpu_load() * 100)}%" - def on_ui_setup(self, ui): - if ui.is_waveshare_v2(): - h_pos = (180, 80) - v_pos = (180, 61) - elif ui.is_waveshare_v1(): - h_pos = (170, 80) - v_pos = (170, 61) - elif ui.is_waveshare144lcd(): - h_pos = (53, 77) - v_pos = (78, 67) - elif ui.is_inky(): - h_pos = (140, 68) - v_pos = (165, 54) - elif ui.is_waveshare27inch(): - h_pos = (192, 138) - v_pos = (216, 122) - else: - h_pos = (155, 76) - v_pos = (180, 61) - - if self.options['orientation'] == "vertical": - ui.add_element('memtemp', LabeledValue(color=BLACK, label='', value=' mem:-\n cpu:-\ntemp:-', - position=v_pos, - label_font=fonts.Small, text_font=fonts.Small)) - else: - # default to horizontal - ui.add_element('memtemp', LabeledValue(color=BLACK, label='', value='mem cpu temp\n - - -', - position=h_pos, - label_font=fonts.Small, text_font=fonts.Small)) - - def on_unload(self, ui): - with ui._lock: - ui.remove_element('memtemp') - - def on_ui_update(self, ui): + def cpu_temp(self): if self.options['scale'] == "fahrenheit": temp = (pwnagotchi.temperature() * 9 / 5) + 32 symbol = "f" @@ -85,11 +69,116 @@ class MemTemp(plugins.Plugin): # default to celsius temp = pwnagotchi.temperature() symbol = "c" + return f"{temp}{symbol}" + + def cpu_freq(self): + with open('/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq', 'rt') as fp: + return f"{round(float(fp.readline())/1000000, 1)}G" + + def pad_text(self, data): + return " " * (self.FIELD_WIDTH - len(data)) + data + + def on_ui_setup(self, ui): + try: + # Configure field list + self.fields = self.options['fields'].split(',') + self.fields = [x.strip() for x in self.fields if x.strip() in self.ALLOWED_FIELDS.keys()] + self.fields = self.fields[:3] # limit to the first 3 fields + except Exception: + # Set default value + self.fields = self.DEFAULT_FIELDS + + try: + # Configure line_spacing + line_spacing = int(self.options['linespacing']) + except Exception: + # Set default value + line_spacing = self.LINE_SPACING + + try: + # Configure position + pos = self.options['position'].split(',') + pos = [int(x.strip()) for x in pos] + if self.options['orientation'] == "vertical": + v_pos = (pos[0], pos[1]) + else: + h_pos = (pos[0], pos[1]) + except Exception: + # Set default position based on screen type + if ui.is_waveshare_v2(): + h_pos = (178, 84) + v_pos = (197, 74) + elif ui.is_waveshare_v1(): + h_pos = (170, 80) + v_pos = (165, 61) + elif ui.is_waveshare144lcd(): + h_pos = (53, 77) + v_pos = (73, 67) + elif ui.is_inky(): + h_pos = (140, 68) + v_pos = (160, 54) + elif ui.is_waveshare27inch(): + h_pos = (192, 138) + v_pos = (211, 122) + else: + h_pos = (155, 76) + v_pos = (175, 61) if self.options['orientation'] == "vertical": - ui.set('memtemp', - " mem:%s%%\n cpu:%s%%\ntemp:%s%s" % (self.mem_usage(), self.cpu_load(), temp, symbol)) + # Dynamically create the required LabeledValue objects + for idx, field in enumerate(self.fields): + v_pos_x = v_pos[0] + v_pos_y = v_pos[1] + ((len(self.fields) - 3) * -1 * line_spacing) + ui.add_element( + f"memtemp_{field}", + LabeledValue( + color=BLACK, + label=f"{self.pad_text(field)}:", + value="-", + position=(v_pos_x, v_pos_y + (idx * line_spacing)), + label_font=fonts.Small, + text_font=fonts.Small, + label_spacing=self.LABEL_SPACING, + ) + ) else: # default to horizontal - ui.set('memtemp', - " mem cpu temp\n %s%% %s%% %s%s" % (self.mem_usage(), self.cpu_load(), temp, symbol)) + h_pos_x = h_pos[0] + ((len(self.fields) - 3) * -1 * 25) + h_pos_y = h_pos[1] + ui.add_element( + 'memtemp_header', + Text( + color=BLACK, + value=" ".join([self.pad_text(x) for x in self.fields]), + position=(h_pos_x, h_pos_y), + font=fonts.Small, + ) + ) + ui.add_element( + 'memtemp_data', + Text( + color=BLACK, + value=" ".join([self.pad_text("-") for x in self.fields]), + position=(h_pos_x, h_pos_y + line_spacing), + font=fonts.Small, + ) + ) + + def on_unload(self, ui): + with ui._lock: + if self.options['orientation'] == "vertical": + for idx, field in enumerate(self.fields): + ui.remove_element(f"memtemp_{field}") + else: + # default to horizontal + ui.remove_element('memtemp_header') + ui.remove_element('memtemp_data') + + def on_ui_update(self, ui): + if self.options['orientation'] == "vertical": + for idx, field in enumerate(self.fields): + ui.set(f"memtemp_{field}", getattr(self, self.ALLOWED_FIELDS[field])()) + else: + # default to horizontal + data = " ".join([self.pad_text(getattr(self, self.ALLOWED_FIELDS[x])()) for x in self.fields]) + ui.set('memtemp_data', data) diff --git a/pwnagotchi/plugins/default/onlinehashcrack.py b/pwnagotchi/plugins/default/onlinehashcrack.py index 1a7484f..b63a2ed 100644 --- a/pwnagotchi/plugins/default/onlinehashcrack.py +++ b/pwnagotchi/plugins/default/onlinehashcrack.py @@ -110,9 +110,8 @@ class OnlineHashCrack(plugins.Plugin): if handshake_new: logging.info("OHC: Internet connectivity detected. Uploading new handshakes to onlinehashcrack.com") for idx, handshake in enumerate(handshake_new): - display.set('status', - f"Uploading handshake to onlinehashcrack.com ({idx + 1}/{len(handshake_new)})") - display.update(force=True) + display.on_uploading(f"onlinehashcrack.com ({idx + 1}/{len(handshake_new)})") + try: self._upload_to_ohc(handshake) if handshake not in reported: @@ -127,6 +126,9 @@ class OnlineHashCrack(plugins.Plugin): self.skip.append(handshake) logging.debug("OHC: %s", os_e) continue + + display.on_normal() + if 'dashboard' in self.options and self.options['dashboard']: cracked_file = os.path.join(handshake_dir, 'onlinehashcrack.cracked') if os.path.exists(cracked_file): diff --git a/pwnagotchi/plugins/default/ups_lite.py b/pwnagotchi/plugins/default/ups_lite.py index 482472f..c439636 100644 --- a/pwnagotchi/plugins/default/ups_lite.py +++ b/pwnagotchi/plugins/default/ups_lite.py @@ -7,14 +7,18 @@ # For Raspberry Pi Zero Ups Power Expansion Board with Integrated Serial Port S3U4 # https://www.ebay.de/itm/For-Raspberry-Pi-Zero-Ups-Power-Expansion-Board-with-Integrated-Serial-Port-S3U4/323873804310 # https://www.aliexpress.com/item/32888533624.html +# +# To display external power supply status you need to bridge the necessary pins on the UPS-Lite board. See instructions in the UPS-Lite repo. import logging import struct +import RPi.GPIO as GPIO + +import pwnagotchi +import pwnagotchi.plugins as plugins +import pwnagotchi.ui.fonts as fonts from pwnagotchi.ui.components import LabeledValue from pwnagotchi.ui.view import BLACK -import pwnagotchi.ui.fonts as fonts -import pwnagotchi.plugins as plugins -import pwnagotchi # TODO: add enable switch in config.yml an cleanup all to the best place @@ -43,6 +47,14 @@ class UPS: except: return 0.0 + def charging(self): + try: + GPIO.setmode(GPIO.BCM) + GPIO.setup(4, GPIO.IN) + return '+' if GPIO.input(4) == GPIO.HIGH else '-' + except: + return '-' + class UPSLite(plugins.Plugin): __author__ = 'evilsocket@gmail.com' @@ -66,7 +78,8 @@ class UPSLite(plugins.Plugin): def on_ui_update(self, ui): capacity = self.ups.capacity() - ui.set('ups', "%2i%%" % capacity) + charging = self.ups.charging() + ui.set('ups', "%2i%s" % (capacity, charging)) if capacity <= self.options['shutdown']: logging.info('[ups_lite] Empty battery (<= %s%%): shuting down' % self.options['shutdown']) ui.update(force=True, new_data={'status': 'Battery exhausted, bye ...'}) diff --git a/pwnagotchi/plugins/default/watchdog.py b/pwnagotchi/plugins/default/watchdog.py index 6a370eb..8ebb6b8 100644 --- a/pwnagotchi/plugins/default/watchdog.py +++ b/pwnagotchi/plugins/default/watchdog.py @@ -33,4 +33,4 @@ class Watchdog(plugins.Plugin): logging.info('[WATCHDOG] Blind-Bug detected. Restarting.') mode = 'MANU' if agent.mode == 'manual' else 'AUTO' import pwnagotchi - pwnagotchi.restart(mode=mode) + pwnagotchi.reboot(mode=mode) diff --git a/pwnagotchi/plugins/default/wigle.py b/pwnagotchi/plugins/default/wigle.py index f281757..3a7bce7 100644 --- a/pwnagotchi/plugins/default/wigle.py +++ b/pwnagotchi/plugins/default/wigle.py @@ -9,6 +9,7 @@ from datetime import datetime from pwnagotchi.utils import WifiInfo, FieldNotFoundError, extract_from_pcap, StatusFile, remove_whitelisted from threading import Lock from pwnagotchi import plugins +from pwnagotchi._version import __version__ as __pwnagotchi_version__ def _extract_gps_data(path): @@ -34,14 +35,14 @@ def _format_auth(data): return out -def _transform_wigle_entry(gps_data, pcap_data): +def _transform_wigle_entry(gps_data, pcap_data, plugin_version): """ Transform to wigle entry in file """ dummy = StringIO() # write kismet header dummy.write( - "WigleWifi-1.4,appRelease=20190201,model=Kismet,release=2019.02.01.{},device=kismet,display=kismet,board=kismet,brand=kismet\n") + "WigleWifi-1.4,appRelease={},model=pwnagotchi,release={},device=pwnagotchi,display=kismet,board=kismet,brand=pwnagotchi\n".format(plugin_version, __pwnagotchi_version__)) dummy.write( "MAC,SSID,AuthMode,FirstSeen,Channel,RSSI,CurrentLatitude,CurrentLongitude,AltitudeMeters,AccuracyMeters,Type") @@ -62,7 +63,7 @@ def _transform_wigle_entry(gps_data, pcap_data): return dummy.getvalue() -def _send_to_wigle(lines, api_key, timeout=30): +def _send_to_wigle(lines, api_key, donate=True, timeout=30): """ Uploads the file to wigle-net """ @@ -76,7 +77,7 @@ def _send_to_wigle(lines, api_key, timeout=30): headers = {'Authorization': f"Basic {api_key}", 'Accept': 'application/json'} - data = {'donate': 'false'} + data = {'donate': 'on' if donate else 'false'} payload = {'file': dummy, 'type': 'text/csv'} try: @@ -112,6 +113,9 @@ class Wigle(plugins.Plugin): if not 'whitelist' in self.options: self.options['whitelist'] = list() + if not 'donate' in self.options: + self.options['donate'] = True + self.ready = True def on_internet_available(self, agent): @@ -172,14 +176,14 @@ class Wigle(plugins.Plugin): logging.debug("WIGLE: %s", sc_e) self.skip.append(gps_file) continue - new_entry = _transform_wigle_entry(gps_data, pcap_data) + new_entry = _transform_wigle_entry(gps_data, pcap_data, self.__version__) csv_entries.append(new_entry) no_err_entries.append(gps_file) if csv_entries: - display.set('status', "Uploading gps-data to wigle.net ...") - display.update(force=True) + display.on_uploading('wigle.net') + try: - _send_to_wigle(csv_entries, self.options['api_key']) + _send_to_wigle(csv_entries, self.options['api_key'], donate=self.options['donate']) reported += no_err_entries self.report.update(data={'reported': reported}) logging.info("WIGLE: Successfully uploaded %d files", len(no_err_entries)) @@ -189,3 +193,5 @@ class Wigle(plugins.Plugin): except OSError as os_e: self.skip += no_err_entries logging.debug("WIGLE: Got the following error: %s", os_e) + + display.on_normal() diff --git a/pwnagotchi/plugins/default/wpa-sec.py b/pwnagotchi/plugins/default/wpa-sec.py index 5c14018..6b6163b 100644 --- a/pwnagotchi/plugins/default/wpa-sec.py +++ b/pwnagotchi/plugins/default/wpa-sec.py @@ -82,6 +82,7 @@ class WpaSec(plugins.Plugin): self.options['whitelist'] = list() self.ready = True + logging.info("WPA_SEC: plugin loaded") def on_webhook(self, path, request): from flask import make_response, redirect @@ -110,8 +111,8 @@ class WpaSec(plugins.Plugin): if handshake_new: logging.info("WPA_SEC: Internet connectivity detected. Uploading new handshakes to wpa-sec.stanev.org") for idx, handshake in enumerate(handshake_new): - display.set('status', f"Uploading handshake to wpa-sec.stanev.org ({idx + 1}/{len(handshake_new)})") - display.update(force=True) + display.on_uploading(f"wpa-sec.stanev.org ({idx + 1}/{len(handshake_new)})") + try: self._upload_to_wpasec(handshake) reported.append(handshake) @@ -125,6 +126,8 @@ class WpaSec(plugins.Plugin): logging.debug("WPA_SEC: %s", os_e) continue + display.on_normal() + if 'download_results' in self.options and self.options['download_results']: cracked_file = os.path.join(handshake_dir, 'wpa-sec.cracked.potfile') if os.path.exists(cracked_file): diff --git a/pwnagotchi/ui/faces.py b/pwnagotchi/ui/faces.py index c47a5e9..66874d0 100644 --- a/pwnagotchi/ui/faces.py +++ b/pwnagotchi/ui/faces.py @@ -20,7 +20,9 @@ ANGRY = "(-_-')" FRIEND = '(♥‿‿♥)' BROKEN = '(☓‿‿☓)' DEBUG = '(#__#)' - +UPLOAD = '(1__0)' +UPLOAD1 = '(1__1)' +UPLOAD2 = '(0__1)' def load_from_config(config): for face_name, face_value in config.items(): diff --git a/pwnagotchi/ui/hw/inky.py b/pwnagotchi/ui/hw/inky.py index bb02fd7..7f71b7a 100644 --- a/pwnagotchi/ui/hw/inky.py +++ b/pwnagotchi/ui/hw/inky.py @@ -42,6 +42,12 @@ class Inky(DisplayImpl): from pwnagotchi.ui.hw.libs.inkyphat.inkyphatfast import InkyPHATFast self._display = InkyPHATFast('black') self._display.set_border(InkyPHATFast.BLACK) + elif self.config['color'] == 'auto': + from inky.auto import auto + self._display = auto() + self._display.set_border(self._display.BLACK) + self._layout['width'] = self._display.WIDTH + self._layout['height'] = self._display.HEIGHT else: from inky import InkyPHAT self._display = InkyPHAT(self.config['color']) diff --git a/pwnagotchi/ui/view.py b/pwnagotchi/ui/view.py index 974a968..9ecc857 100644 --- a/pwnagotchi/ui/view.py +++ b/pwnagotchi/ui/view.py @@ -1,20 +1,20 @@ import _thread -from threading import Lock -import time import logging import random +import time +from threading import Lock + from PIL import ImageDraw import pwnagotchi -import pwnagotchi.utils as utils import pwnagotchi.plugins as plugins -from pwnagotchi.voice import Voice - -import pwnagotchi.ui.web as web -import pwnagotchi.ui.fonts as fonts import pwnagotchi.ui.faces as faces +import pwnagotchi.ui.fonts as fonts +import pwnagotchi.ui.web as web +import pwnagotchi.utils as utils from pwnagotchi.ui.components import * from pwnagotchi.ui.state import State +from pwnagotchi.voice import Voice WHITE = 0xff BLACK = 0x00 @@ -345,6 +345,11 @@ class View(object): self.update() time.sleep(5.0) + def on_uploading(self, to): + self.set('face', random.choice((faces.UPLOAD, faces.UPLOAD1, faces.UPLOAD2))) + self.set('status', self._voice.on_uploading(to)) + self.update(force=True) + def on_rebooting(self): self.set('face', faces.BROKEN) self.set('status', self._voice.on_rebooting()) diff --git a/pwnagotchi/voice.py b/pwnagotchi/voice.py index fff7579..991d26f 100644 --- a/pwnagotchi/voice.py +++ b/pwnagotchi/voice.py @@ -1,6 +1,6 @@ -import random import gettext import os +import random class Voice: @@ -159,6 +159,9 @@ class Voice: def on_rebooting(self): return self._("Oops, something went wrong ... Rebooting ...") + def on_uploading(self, to): + return self._("Uploading data to {to} ...").format(to=to) + def on_last_session_data(self, last_session): status = self._('Kicked {num} stations\n').format(num=last_session.deauthed) if last_session.associated > 999: diff --git a/release.stork b/release.stork new file mode 100755 index 0000000..023c4ec --- /dev/null +++ b/release.stork @@ -0,0 +1,7 @@ +#!/usr/bin/env stork -f + +version:parser "__version__\\s*=\\s*['\"]([\\d\\.ab]+)[\"']" +version:file "pwnagotchi/_version.py" +version:from_user + +git:create_tag $VERSION \ No newline at end of file diff --git a/scripts/changelog.sh b/scripts/changelog.sh deleted file mode 100755 index 1c2f28a..0000000 --- a/scripts/changelog.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -NEW=() -FIXES=() -MISC=() - -echo "@ Fetching remote tags ..." -git fetch --tags >/dev/null -printf "\n\n" - -CURTAG=$(git describe --tags --abbrev=0) -OUTPUT=$(git log $CURTAG..HEAD --oneline) -IFS=$'\n' LINES=($OUTPUT) - -for LINE in "${LINES[@]}"; do - LINE=$(echo "$LINE" | sed -E "s/^[[:xdigit:]]+\s+//") - if [[ $LINE == *"new:"* ]]; then - LINE=$(echo "$LINE" | sed -E "s/^new: //") - NEW+=("$LINE") - elif [[ $LINE == *"fix:"* ]]; then - LINE=$(echo "$LINE" | sed -E "s/^fix: //") - FIXES+=("$LINE") - elif [[ $LINE != *"i did not bother commenting"* ]] && [[ $LINE != *"Merge "* ]]; then - echo " MISC LINE =$LINE" - LINE=$(echo "$LINE" | sed -E "s/^[a-z]+: //") - MISC+=("$LINE") - fi -done - -if [ -n "$NEW" ]; then - echo - echo "**New Features**" - echo - for l in "${NEW[@]}"; do - echo "* $l" - done -fi - -if [ -n "$FIXES" ]; then - echo - echo "**Fixes**" - echo - for l in "${FIXES[@]}"; do - echo "* $l" - done -fi - -if [ -n "$MISC" ]; then - echo - echo "**Misc**" - echo - for l in "${MISC[@]}"; do - echo "* $l" - done -fi - -echo diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index abe406d..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -# nothing to see here, just a utility i use to create new releases ^_^ - -VERSION_FILE=$(dirname "${BASH_SOURCE[0]}")/../pwnagotchi/_version.py -echo "version file is $VERSION_FILE" -CURRENT_VERSION=$(cat $VERSION_FILE | grep version | cut -d"'" -f2) -TO_UPDATE=( - $VERSION_FILE -) - -echo -n "current version is $CURRENT_VERSION, select new version: " -read NEW_VERSION -echo "creating version $NEW_VERSION ...\n" - -for file in "${TO_UPDATE[@]}"; do - echo "patching $file ..." - sed -i.bak "s/$CURRENT_VERSION/$NEW_VERSION/g" "$file" - rm -rf "$file.bak" - git add $file -done - -git commit -m "releasing v$NEW_VERSION" -git push -git tag -a v$NEW_VERSION -m "release v$NEW_VERSION" -git push origin v$NEW_VERSION - -echo -echo "All done, v$NEW_VERSION released ^_^"