Git Product home page Git Product logo

minigotchi's Introduction

minigotchi - ミニゴッチ

GitHub code size in bytes GitHub license GitHub contributors GitHub commit activity GitHub Repo stars

An even smaller Pwnagotchi.

Intro

This is a project meant to showcase the use of low-level Wi-Fi frame manipulation in a Pwnagotchi-like matter with an ESP8266/ESP32. This firmware is designed with simplicity just as much as similarity to the Pwnagotchi, promoting configuration reusability, low(er) memory usage, and a little bit of mischief.

The Minigotchi can detect Pwnagotchis, and send "advertisements" for another Pwnagotchi to detect, along with deauthenticating devices connected to an AP. Originally meant to just befriend a local Pwnagotchi, I plan to improve it and extend its purpose, merely with an ESP8266 with 4 MB of memory.

We just made a discord server! Feel free to join!

Install guide

See the install guide.

Languages

The code is written in these languages.

  • C
  • C++

Note that the C++ in Arduino is slightly modified from what I have heard. See this Reddit question for more about this. Arduino probably has tweaked it to be more beginner-friendly, although still being low-level. The Pwnagotchi is a complex machine written in Python and Go, so code from the Pwnagotchi Project is not compatible with mine.

Prerequisites

  • Arduino IDE
  • A good understanding of coding/programming
  • D1 Mini ESP8266 V4(or any other supported hardware in the wiki)
  • A reliable and appropriate power source and supply for the hardware
  • Patience (a lot of it)
  • The ability to read

How it operates/works

See the wiki.

Hardware

See the wiki.

To do

See this project.

Contributing

See the Contributing Guidelines here.

FAQ

See the wiki.

Communication

See the wiki.

Last but not least... Some thank you's

If you believe your project wasn't properly credited, please let me know ASAP! Here's how you can communicate with me.

Thanks to these projects for making this a little bit more possible for me, I have used libraries/code from these projects and implemented it here:

  • Pwngrid, this is what the project is trying to replicate, specifically the Pwnagotchi's system of peer detection. If this didn't exist, this project probably wouldn't have either.

  • Arduino, mostly just the repository containing libraries for the project so I can build this code. Many libraries were used in this core repository.

  • 80211Raw allows raw arbitrary frames to be received and sent through an ESP8266 or ESP32 using C and C++ in an interesting and useful POC. This was used to send the Pwnagotchi-like frames. Most of the previous releases used this library, but now not anymore.

  • ESP8266 Deauther, the POC that shows that an ESP8266 can deauth and attack local access points. Deauthing is based on this project and is done in a very similar fashion. Not only that, but it can also send probes and create fake APs.

  • ESP32 Marauder, similar to the ESP8266 Deauther, although packed with more features and support for Flipper Zero's ESP32 WiFi Card Module. It has wardriving capabilities, BLE, Pwnagotchi Scanning, and Deauthing available. This is a very cool project, I highly recommend checking this out if you have an ESP32.

  • ESPAsyncWebServer, the library that allows a Web UI on the ESP8266, along with an AP.

  • Milkydeveloper, idk what he did but he wanted to be here ig so...(this is totally not an advertisement)

  • This is a set of projects, one of which was an ESP32 sniffer.

  • esp8266-sniffer, an ESP8266 sniffer dedicated to finding probes from smartphones.

Made with ❤️ by @dj1ch and the rest of the Pwnagotchi-Unofficial team!

minigotchi's People

Contributors

dj1ch avatar eltociear avatar matrix224 avatar najmajmal avatar nothingbutlucas avatar restyled-commits avatar restyled-io[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minigotchi's Issues

Flipper Zero GPIO/UART output

Is anyone able to test if this works on a flipper by connecting this to the GPIO pins of a flipper(specifically the UART pins)? As of now I don't have a flipper and people have been asking about flipper support.

Pwnagotchi stuck as found

I apologize if I missed something and this is wrong, but I figured I should note it just in case regardless. I haven't encountered this myself, but happened to notice it when looking over the code.

In Pwnagotchi.cpp, when another pwnagotchi is found, it sets pwnagotchiDetected to true. But it looks like it never gets reset to false, so in any subsequent calls to Pwnagotchi::detect() after a pwnagotchi has been found, I think it would always be considered as having found one. It doesn't really matter currently since it doesn't do any special handling when it's true anyway, but I figured it wouldn't hurt just to have it working if that changes later.

Also (not to derail the point of this report, but it's in the same area) couldn't the calls to

    Minigotchi::monStop();
    Pwnagotchi::stopCallback();

that happen in the if-else block there be done just once before or after it since it's currently being done in all cases?

Support for wio terminal

Hello!

Awesome project! I would like to suggest an extra board to add to the project, wio terminal! Wio is a small device released by Seeedstudio based on a samd51 chip and a realtek wifi/bluetooth module. The Arduino drivers for it are pretty stable and easy to use. The thing I believe would make this device worth to be added is that it has a 320x240 TFT color screen that would be very fun to display the pawnagotchi faces lol. What do you think? Is it too complicated to add? (I don't know c well enough to add something myself I am mostly a ts/python dev)

error in function `ieee80211_raw_frame_sanity_check'

Hi

I tried to compile the code for my M5Cardputer but got an error "multiple definition of ieee80211_raw_frame_sanity_check'" (output shorted) because it was also defined in the library of espressif.
My workaround was to instruct the linker to do weak linking. What i did to get the code compiled was very easy:
from extern "C" int ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3) { return 0; }
to extern "C" int __attribute__((weak)) ieee80211_raw_frame_sanity_check(int32_t arg, int32_t arg2, int32_t arg3) { return 0; }
okay not the best way but its working for me.

I know there are also other workarounds out there for other projcets but i think this is even better then to hexedit a library

Incorrectly marking everything as hidden

In Deauth::printHidden() method, it looks like it's incorrectly marking everything as hidden.

Currently it is calling WiFi.channel(network) to check if it's hidden, which from what I understand just returns the channel that network index is on. As such it would always be interpreted as true unless the channel was somehow actually 0.

I believe this should instead be WiFi.isHidden(network)

How about support for this lil guy NodeMCU ESP8266 Development Board with 0.96 Inch OLED Display

Discussed in #132

Originally posted by DSCustoms June 4, 2024
Not to add more work, I'm not sure exactly what would need to be changed, I've tried a few things and the minigotchi is running but I can't get this display to work.

https://www.amazon.com/dp/B0BVM3H46B?psc=1

It's a great little board with the oled already onboard, but it needs this u8g2 library and commands.

https://github.com/olikraus/u8g2/wiki

https://kbin.social/m/Arduino/t/779187/Default-setup-and-screen-display-code-for-Ideaspark-ESP8266-096OLED

Anyone want to tackle this or give me a little idea what to start to change?

SH1106 support request

I thought that the SH1106 screens would either be plug and play or work very easily, but I haven't been able to get it to work myself. Do you think you could add support for the SH1106 screens when you get a chance? There's a nice 1.3" screen which would be great for handhelds.

1.3 Inch I2C OLED Display Module 128x64 Pixel SH1106 Screen Module

It connects and lights up, but only shows static right now. There is an adafruit SH110X library that should cover it, I also found this repo
https://github.com/fcgdam/Adafruit_SH1106

Thanks!

Mhumm.... Chắc có vẽ câu hỏi này hơi ngu :?!

All these lyrics are translated by GG (maybe it won't be very accurate)
I earned this article. I skimmed it and I wonder if it can connect to Flipperzero like a paper monitor?.
Currently I have available Esp 32, Esp 8266...
Looking forward to hearing from you!. Thank you again!!!

Deauth ignore unencrypted AP, reset last used AP

Alright I'm back again with a couple more lol

  1. Currently the AP scan will pick up open APs, which I figure there's no point deauthing since there's nothing to actually deauth there. As far as I'm aware there's no way to ignore them in the scan, but we can at least check if our selected AP is encrypted or not and ignore it. I just put this after the check for whitelisted in my local Deauth::select() and it seemed to work fine. I know it's probably not a common case you'd see out in the wild, but I figured if the Pwnagotchi ignores APs like these, the little guy may as well too.
        uint8_t encType = WiFi.encryptionType(Deauth::randomIndex);
        // -1 indicates unknown / unhandled
        if (encType == -1 || encType == ENC_TYPE_NONE) {
          Serial.println("('-') Selected AP is not encrypted. Skipping deauthentication...");
          Display::cleanDisplayFace("('-')");
          Display::attachSmallText("Selected AP is not encrypted. Skipping deauthentication...");
          return;
        }

and e.g.:

('-') Selected random AP: <redacted>

('-') Selected AP is not encrypted. Skipping deauthentication...
  1. From my issue yesterday (128), I had mentioned resetting the last deauthed index/SSID before each new call to select(). I don't think the code change that was made in that issue covered that though and it can lead to possibly odd / unexpected behavior. It doesn't seem to cause any direct issue (e.g. crashes), but I think it's just misleading. Basically imagine this scenario:
    • An AP is selected and deauthed
    • select() gets called again on the next run, but something happened where it wouldn't continue (no APs are found, AP is whitelisted, etc)
    • All of the messages / serial output indicate no deauthing will occur, however Deauth::deauth() only checks that the randomAP that was selected has a length > 0. Since it wasn't reset from the last run, it does in fact have a length > 0
    • It then proceeds to deauth the last AP that was deauthed even though all the other messages and logic indicated it couldn't get an AP and would do nothing right now

Error on compilation - SSD1306 implementation

Hi!
Building this again I found an error on compilation with the new screen SSD1306 implementation (Not the shield).

I'm using the last release v3.1.1-beta.

Describe the bug

This is the error on compilation step:

/minigotchi/display.cpp: In static member function 'static void Display::startScreen()':
/minigotchi/display.cpp:12:117: error: no matching function for call to 'Adafruit_SSD1306::Adafruit_SSD1306(int, int, TwoWire*, int)'
       adafruit_display = new Adafruit_SSD1306(SSD1306_SCREEN_WIDTH, SSD1306_SCREEN_HEIGHT, &Wire, SSD1306_OLED_RESET);

To Reproduce
Steps to reproduce the behavior:

  1. Build the project.

Expected behavior
The build should not break.

Screenshots

I have the wemos oled shield so to bypass this error I commented the lines 12 and 13 of the display.cpp file:

imagen

I have a clean installation of arduino IDE with the libraries for this project only:

imagen

I think that the mini oled library it's not compatible with the SSD1306 regular screen... But I can not test it because I don't have that screen.

Commenting the lines 12 and 13 like I said before "works" and do not break the building process.

Please let me know if u need any more details, thanks.

Pwnagotchi scan delay

I'm not sure if I'm overlooking something, but in Pwnagotchi::detect() shouldn't there be some kind of delay after calling Minigotchi::monStart()? Otherwise isn't it just basically starting and stopping the scan almost instantly without giving it any time to actually detect something?
I'm guessing maybe it was meant to be put before the whole scanning loop above it, or at least before the long delay that's at the end of it. If it's supposed to go before the loop above it then I would opt to also remove the if (!Config::parasite) { since I had put that in under the impression that the loop was just for show, not functionally doing anything.

weird compile issue in web editor

Describe the bug
Main developer here. There are multiple library issues in the web editor. I am unaware on how this happened. You can compile using the actual Arduino IDE application

To Reproduce
Steps to reproduce the behavior:

  1. Go to the web editor
  2. Upload and compile
  3. Get errors

Expected behavior
To compile correctly

Logs
/usr/local/bin/arduino-cli compile --fqbn esp8266:esp8266:d1_mini_lite:baud=921600,dbg=Disabled,eesz=1M,exception=disabled,ip=lm2f,lvl=None____,vt=flash,wipe=none,xtal=80 --build-cache-path /tmp --output-dir /tmp/1810650504/build --build-path /tmp/arduino-build-6FE5A0DE4EA6426ABEECC04BF50195A9 /tmp/1810650504/minigotchi

In file included from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/FloatTraits.hpp:13:0,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/convertNumber.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantData.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantFunctions.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/JsonVariantConst.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantRefBase.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/ElementProxy.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/JsonArray.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.hpp:29,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.h:9,

from /tmp/1810650504/minigotchi/packet.h:8,

from /tmp/1810650504/minigotchi/packet.cpp:3:

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'const T* ArduinoJson::V6213PB2::detail::pgm_read(const T* const*) [with T = char]':

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:42: required from here

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp:25:52: error: 'const void*' is not a pointer-to-object type

return reinterpret_cast<const T*>(pgm_read_ptr(p));

^

In file included from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/FloatTraits.hpp:13:0,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/convertNumber.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantData.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantFunctions.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/JsonVariantConst.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantRefBase.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/ElementProxy.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/JsonArray.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.hpp:29,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.h:9,

from /tmp/1810650504/minigotchi/packet.h:8,

from /tmp/1810650504/minigotchi/minigotchi.ino:5:

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'const T* ArduinoJson::V6213PB2::detail::pgm_read(const T* const*) [with T = char]':

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:42: required from here

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp:25:52: error: 'const void*' is not a pointer-to-object type

return reinterpret_cast<const T*>(pgm_read_ptr(p));

^

In file included from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/FloatTraits.hpp:13:0,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Numbers/convertNumber.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantData.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantFunctions.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/JsonVariantConst.hpp:15,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Variant/VariantRefBase.hpp:9,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/ElementProxy.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Array/JsonArray.hpp:7,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.hpp:29,

from /home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson.h:9,

from /tmp/1810650504/minigotchi/pwnagotchi.cpp:4:

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'const T* ArduinoJson::V6213PB2::detail::pgm_read(const T* const*) [with T = char]':

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:42: required from here

/home/builder/Arduino/libraries/arduinojson_6_21_3/src/ArduinoJson/Polyfills/pgmspace_generic.hpp:25:52: error: 'const void*' is not a pointer-to-object type

return reinterpret_cast<const T*>(pgm_read_ptr(p));

^

Multiple libraries were found for "ArduinoJson.h"

Used: /home/builder/opt/libraries/arduinojson_6_21_3

Not used: /home/builder/opt/libraries/thingesp_1_3_0

Not used: /home/builder/opt/libraries/balemessengerbot_arduino_0_1_0

Not used: /home/builder/opt/libraries/iotkme_3_0_1

Not used: /home/builder/opt/libraries/antares_esp8266_mqtt_0_9_2

Not used: /home/builder/opt/libraries/cmmc_mqtt_connector_1_3_3

Not used: /home/builder/opt/libraries/allthingstalk_lte_m_sdk_2_0_4

Not used: /home/builder/opt/libraries/antares_esp8266_http_1_3_3

Not used: /home/builder/opt/libraries/thingsiot_1_2_0

Not used: /home/builder/opt/libraries/coogleiot_1_3_1

Error during build: exit status 1

Deauth questions / possible issues

I'm back once more with some other things regarding Deauth!

  1. When selecting an AP in the Deauth::select() method, is the intention that it doesn't use the same channel as was selected in the Channel::cycle() method? Currently it is not using it from what I can tell, but it doesn't affect functionality.
    • My understanding is that calling WiFi.scanNetworks() with no parameters scans all channels. If you use a specific channel, you're morel likely to find no APs I would guess since you're targeting just that one channel. I only ask this because I've modified my Minigotchi to communicate directly with my Pwnagotchi over serial and sync their channels, and it was all working fine except when it scanned for APs. The channel in the Channel class was synced fine, but it would end up scanning APs on other random channels when it got to Deauth::select(). I updated the code to do WiFi.scanNetworks(false, false, Channel::getChannel()); instead of just WiFi.scanNetworks() and that ended that issue, but I'm thinking this really only matters for my specific use-case.
  2. When Deauth::select() doesn't find any APs, it can lead to issues. I'm unfortunately not well versed in C, so I'm not entirely sure where the issue lies. But basically when it finds no access points, it leads to some exception and the entire unit crashes + restarts. I avoided this by updating the code to just return; if no APs are found since I figured there's nothing to deauth in that case anyway, which works fine. The downside is that Deauth::deauth() yells at me because it thinks I broke the select method :(
  3. Part of above, if an AP is selected and then on the next call to Deauth::select() it can't find any APs, it still has the old values set in Deauth::randomIndex and Deauth::randomAP, which leads to other random issues from what I can tell. I think those two values should be cleared first before doing anything else in Deauth::select()

Deauth::start packet sending

While playing with the board in #133 I had an issue that was from me choosing the wrong ESP8266 board at first. It resulted in the Both packets failed to send! message being printed, which prompted me to go look and see where that was coming from.

It's in the Deauth::start method, and after looking over the whole if-else statement setup in the for-loop in there, I was unsure what the intention of all of that is; it didn't seem to make sense.
Is it supposed to try and send both the deauth and disassociation frames, and count it as failed if at least one of those fails?
Or does it just want to try and send at least one of them, and then count it as failed if both fail?

Currently it looks like the latter where it tries to send the deauth or association frame, and if both of those fail, then it counts it as both failing; which is fine. But then all of the else-ifs after about one specific packet failing don't make sense since I imagine they'd most likely never be called (I say most likely because all of the else-ifs try to send the packets again too in their if-statements, which is another thing that seemed odd to me).

Request for Support for M5stickC Plus2

I would like to suggest adding support for the M5stickC Plus2 device in the Minigotchi project.
Including M5stickC Plus2 as compatible hardware would significantly enhance the project's capabilities and offer users more configuration options.
The M5stickC Plus2, with its advanced features and compatibility with ESP32, would be a valuable addition to the Minigotchi project. I hope you consider this suggestion and add support for this device.

Add support to ssd1306

I believe that adding a 1306 or SH1106 SSD screen where you can see the logs or data sent via serial to the project is very useful because if you want to bring the ESP to evaluate whether there are any errors, turning on a PC and connecting it via serial becomes complicated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.