Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

merging for the sake of documentation changes #67

Merged
merged 9 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ I believe that you can also use the raspberry pi pico and run arduino .ino files
- At the line that says:

```cpp
raw.init("bssid of ap you will listen on", channel number); // set the settings here, ("BSSID", channel)
raw.init("fo:od:ba:be:fo:od", 1); // set the settings here, ("BSSID", channel)
```

Replace the `"bssid of ap you will listen on"` with your actual BSSID(in the quotations), and the `channel` with the channel you prefer(not in quotations). Note that the pwnagotchi will constantly switch channels so you should go check the channels in the pwnagotchi's web UI.
Replace the `"fo:od:ba:be:fo:od"` with your actual BSSID(in the quotations), and the `1` with the channel you prefer(not in quotations). Note that the pwnagotchi will constantly switch channels so you should go check the channels in the pwnagotchi's web UI.
- There should also be a line that says:

```cpp
deauthAttack.addToWhitelist("SSID"); // add your ssid(s) here
deauthAttack.addToWhitelist("ANOTHER_SSID");
deauthAttack.addToWhitelist("fo:od:ba:be:fo:od"); // add your ssid(s) here
deauthAttack.addToWhitelist("fo:od:ba:be:fo:od");
```

Replace the `SSID` and `ANOTHER_SSID` with the ssid's you want whitelisted. You can add more in this manner by copying and pasting this into the setup function
Replace the `fo:od:ba:be:fo:od` with the ssid's you want whitelisted. You can add more in this manner by copying and pasting this into the setup function

```cpp
deauthAttack.addToWhitelist("YOUR_SSID_HERE");
deauthAttack.addToWhitelist("YOUR_SSID_HERE_OR_BSSID_IDC_REALLY");
```

- Save and exit the file.
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@
### an even smaller pwnagotchi.
###

#### Intro
### Intro
Overall, this project started as a thought. A pwnagotchi on an even smaller board, in this case an esp8266. Crazy, right? Instead of grabbing handshakes, it will be a friend to a local pwnagotchi(most likely one of yours), along with deauthing random networks if the esp8266 is in the vicinity of any.
####
#### Install?
###
### Install guide
The install guide is [here](INSTALL.md), now that I have put out releases.
####
#### Languages
###
### 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](https://www.reddit.com/r/arduino/comments/x46sml/is_arduino_programming_language_c/) for more about this. Arduino probably has tweaked it to be more beginner friendly, although still being [low-level](https://en.wikipedia.org/wiki/Low-level_programming_language).
####
#### Some other ones...
###
### Some other ones...

- Python
- Go

Although nothing will be coded in these langauges(most likely) on this project, it will still be good to know these languages as they will help us understand how a pwnagotchi works. It's a complicated machine, and takes a while to fully understand considering how complex it can be.
####
#### Prerequisites
###
### Prerequisites
- An IDE (most likely the arduino ide)
- Hardware(esp8266 microcontroller)
- A reliable and appropriate power source and supply for the hardware
- Patience (a lot of it)
#### How it operates/works
### How it operates/works
The minigotchi relies on the IDE/serial shell for communication through logs. It will send raw frames to associate to an access point, and will advertise itself on a network like a pwnagotchi, or perhaps interact with the local pwngrid server that the pwnagotchi is running.
#### Something that you should know
### Something that you should know
We have dropped support for the pico, as it turns out, the esp8266 is a microcontroller itself(Though I can make progress for this in the future. For now, I am sticking with the esp8266).
####
#### Hardware
###
### Hardware
- Hardware is here(the esp8266):

https://www.amazon.com/QCCAN-Internet-ESP8266-Compatible-MicroPython/dp/B0B9XSNZXD/ref=sr_1_3?keywords=QCCAN-Internet-ESP8266-Compatible-MicroPython&sr=8-3

Keep in mind it comes with two of them. It's best to keep one extra in case a board gets burnt out and/or lost. I don't think I can find a singular one. I believe this is a clone, so be sure to set this as the clone in the Arduino IDE board manager.
####
#### To do
###
### To do
See this [project](https://github.com/orgs/Pwnagotchi-Unofficial/projects/4)
####
#### Contributing
###
### Contributing
Contributions to the code itself are going to be accepted! Small, and potentially useless pull requests will be ignored. I don't want to waste your time or my time on something as insignificant as adding a space, or putting a link to something I don't need. See more [here](CONTRIBUTING.md). Thank you!
####
#### FAQ
###
### FAQ
I'll add some more questions that I can answer here, but here are some I can answer.

**Why is this in a zip file, not a bin file?**
Expand Down Expand Up @@ -96,7 +96,7 @@ Nope. Never will be unless I publicly declare it and I let the organization take

I have an Open Collective [account](https://opencollective.com/minigotchi), if that helps.

#### Communication
### Communication

Wanna ask me questions?
You can contact me through:
Expand All @@ -109,9 +109,9 @@ You can contact me through:

The last thing I want for this project is for it to die suddenly, and for the creator to disappear and not be able to help people trying to build it, and running into issues. This is a very similar issue with what happened to the Pwnagotchi Project, and the main developer pretty much abondoned the community, which is not good for a very popular project.

####
#### Last but not least... Some thank yous!
##### Thanks to these projects for making this a little bit more possible for me:
###
### Last but not least... Some thank yous!
**Thanks to these projects for making this a little bit more possible for me:**

- Pico-sdk, allowing C/C++ to be compiled and ran on the raspberry pi pico

Expand Down
22 changes: 11 additions & 11 deletions minigotchi/deauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ uint8_t deauthPacket[26] = {
/* 24 - 25 */ 0x01, 0x00 // reason code (1 = unspecified reason)
};

void DeauthAttack::addWhitelist(const char* bssid) {
void DeauthAttack::addToWhitelist(const char* bssid) {
whitelist.push_back(bssid);
}
};

void DeauthAttack::selectAP() {
int apCount = WiFi.scanNetworks();
Expand All @@ -32,30 +32,30 @@ void DeauthAttack::selectAP() {

// check for ap in whitelist
if (std::find(whitelist.begin(), whitelist.end(), randomAP) != whitelist.end()) {
Serial.println("Selected AP is in the whitelist. Skipping deauthentication.");
Serial.println("('-') Selected AP is in the whitelist. Skipping deauthentication...");
return;
}

Serial.print("Selected random AP: ");
Serial.print("('-') Selected random AP: ");
Serial.println(randomAP);
} else {
Serial.println("No access points found.");
Serial.println("(;-;) No access points found.");
}
}
};

void DeauthAttack::startDeauth() {
if (randomAP.length() > 0) {
Serial.println("Starting deauthentication attack on the selected AP...");
Serial.println("(>-<) Starting deauthentication attack on the selected AP...");
// define the attack
if (!running) {
start();
} else {
Serial.println("Attack is already running.");
Serial.println("('-') Attack is already running.");
}
} else {
Serial.println("No access point selected. Use selectRandomAP() first.");
Serial.println("(X-X) No access point selected. Use selectRandomAP() first.");
}
}
};

void DeauthAttack::start() {
running = true;
Expand All @@ -69,4 +69,4 @@ void DeauthAttack::start() {
}
Serial.println("(^-^) Attack finished!");
running = false;
}
};
2 changes: 1 addition & 1 deletion minigotchi/deauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class DeauthAttack {
public:
void selectAP();
void startDeauth();
void addWhitelist(const char* bssid);
void addToWhitelist(const char* bssid);

private:
bool running;
Expand Down
20 changes: 12 additions & 8 deletions minigotchi/minigotchi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ void setup() {
Serial.println("You can edit my whitelist in the minigotchi.ino, and you can also edit the json parameters in the packet.cpp");
Serial.println(" ");
Serial.println("(>-<) Starting now...");
deauthAttack.addToWhitelist("SSID"); // add your ssid(s) here
deauthAttack.addToWhitelist("ANOTHER_SSID");
raw.init("bssid of ap you will listen on", channel_number); // set the settings here, ("BSSID", channel)
deauthAttack.addToWhitelist("fo:od:ba:be:fo:od"); // add your ssid(s) here
deauthAttack.addToWhitelist("fo:od:ba:be:fo:od");
raw.init("fo:od:ba:be:fo:od", 1); // set the settings here, ("BSSID", channel)
raw.start();
delay(15000);
Serial.println(" ");
Expand All @@ -37,21 +37,25 @@ void setup() {
// defines what happens every loop
// this goes on infinitely, until the minigotchi is turned off
// this shouldn't be tampered with unless YOU REALLY KNOW WHAT YOU'RE DOING

void loop() {
// get local payload from local pwnagotchi
pwnagotchi.detectAndHandlePwnagotchi();
delay(5000);
pwnagotchi.detectAndHandle();
// ugly hack: remove all these lines containing the words "delay(5000);" or comment them out with a "//" slash.
// doing so will make the loop a lot faster. plus this might overheat the board and stuff but its worth a try.
delay(5000);

// stop for deauthing and payload
raw.stop();

// send payload(10 times)
packetSender.sendJsonPayloadMultipleTimes(count, delayBetweenSends); // no need to adjust this lol
// note: replace function and set default values later
packetSender.sendDataFrame(count, delayBetweenSends); // no need to adjust this lol
delay(5000);

// deauth a random ap
deauthAttack.selectRandomAP();
deauthAttack.startRandomDeauth();
deauthAttack.selectAP();
deauthAttack.startDeauth();
delay(5000);

// restart the process
Expand Down
16 changes: 9 additions & 7 deletions minigotchi/webui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "webui.h"
// if you're gonna compile from source, install this library using the library manager
// life won't be very fun trying to compile something such as this while missing a library(trust me i know)
#include <AsyncFSWebServer.h>
// life won't be very fun trying to compile something such as this while missing a library(trust me I know)
#include <ESPAsyncWebServer.h>

// define the html for the site
const char* _htmlContent = R"=====(
Expand All @@ -22,7 +22,7 @@ const char* _htmlContent = R"=====(
<body>
<h1>Hello from minigotchi!</h1>
<p></p>
<p>This is a webserver being ran on the minigotchi. The html website is defined in the file <i>webui.h</i></p>
<p>This is a webserver being run on the minigotchi. The HTML website is defined in the file <i>webui.h</i></p>
<p></p>
<p>Minigotchi log:</p>
<div id="log-container">
Expand All @@ -37,7 +37,8 @@ const char* _htmlContent = R"=====(
const char* hostname = "minigotchi";

// start this server on port 80, unless otherwise
AsyncWebServer server(80)
// ok who tf names the class a different name than the library, that's nasty af.
AsyncWebServer server(80);

WebUI::WebUI() {
server.on("/", HTTP_GET, std::bind(&WebUI::handleRoot, this));
Expand All @@ -46,9 +47,10 @@ WebUI::WebUI() {

void WebUI::setupWebServer() {
server.begin();
enableFSCodeEditor();
}

void WebUI::handleRoot() {
::server.send(200, "text/html", _htmlContent);
}
AsyncWebServerRequest *request = server.newAsyncWebServerRequest();
requests->send(200, "text/html", _htmlContent);
delete request; // give the minigotchi dementia
}
2 changes: 1 addition & 1 deletion minigotchi/webui.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define WEBUI_H

#include <ESP8266WiFi.h>
#include <AsyncEspFSWebServer.h>
#include <ESPAsyncWebServer.h>

class WebUI {
public:
Expand Down
Loading