Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FingerprintUSBHost implementation to detect OS #48

Merged
merged 2 commits into from Aug 5, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions ESPloitV2_whid/README.md
Expand Up @@ -170,6 +170,10 @@ Set a one time delay between sending lines in payload
To make a generic delay:
-"Delay"
--"Delay" would wait for The Default Delay x 2 before proceeding to next item in payload

To detect the OS of the victim computer:
-"GetOS:"
--"After executing the command "GetOS:" in the Exfiltrate section an OS.txt file will appear. In this file you can find the operating system that has the victim computer."

For individual keypresses or combinations of key presses:
-"Press:X" or "Press:X+Y" or "Press:X+Y+Z" and so forth
Expand Down Expand Up @@ -310,6 +314,17 @@ The victim is forced to access the URL above and now under "List Exfiltrated Dat
For FTP exfiltration method use the credentials configured in the "Configure ESPloit" page. Also note that only Passive Mode FTP is supported.

See the example payloads for more in depth examples.

-----
Detect OS
-----

Based on the Keyboardio FingerprintUSBHost library.

Inspect USB Descriptors and guess the host operating system based on markers it sees.

Execute the "GetOS:" command in the textarea or in a payload.
After executing the command "GetOS:" in the Exfiltrate section an OS.txt file will appear. In this file you can find the operating system that has the victim computer.

-----
ESPortal Credential Harvester(Phisher)
Expand Down
15 changes: 13 additions & 2 deletions ESPloitV2_whid/source/Arduino_32u4_Code/Arduino_32u4_Code.ino
Expand Up @@ -30,6 +30,7 @@
//Requires Keyboard and SoftwareSerial library
#include <Keyboard.h>
#include <Mouse.h>
#include "FingerprintUSBHost.h"
//#include <SoftwareSerial.h>

//Setup RX and TX pins to be used for the software serial connection
Expand All @@ -41,13 +42,14 @@
//const int debug=0;

String version = "2.2";
String os;

//Used later for determining if we are ready to release a key press or a combination of key presses
int keypressdone=0;

//Start serial interfaces and HID keyboard emulator
void setup() {

void setup() {
//Start up the ESP 8266
pinMode(13, OUTPUT);
digitalWrite(13,HIGH);
Expand All @@ -59,6 +61,9 @@ void setup() {
Serial1.begin(38400);
Serial.begin(38400);
Keyboard.begin();
delay(3000);
FingerprintUSBHost.guessHostOS(os);
delay(3000);
}

//Do-IT!
Expand Down Expand Up @@ -105,6 +110,12 @@ void loop() {
keypressdone=0;
}
}

//If command equals "GetOS"
else if(cmd.startsWith("GetOS")) {
Serial1.print("OS: ");
Serial1.println(os);
}

//If command equals "Print:X"
else if(cmd == "Print") {
Expand Down
7 changes: 7 additions & 0 deletions ESPloitV2_whid/source/ESP_Code/ESP_Code.ino
Expand Up @@ -1168,6 +1168,13 @@ void loop() {
f.println(SerialEXFIL);
f.close();
}
else if(cmd == "OS"){
String os = Serial.readStringUntil('\n');
File f = SPIFFS.open("/OS.txt", "a+");
f.print("Target OS: ");
f.println(os);
f.close();
}
else if(cmd == "BlinkLED") {
String cmdinput = Serial.readStringUntil('\n');
int blinkcount = cmdinput.toInt();
Expand Down
Binary file modified ESPloitV2_whid/source/ESP_Code/ESP_Code.ino.generic.bin
Binary file not shown.