You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> **Disclaimer**: All content in this project is intended for security research purpose only.
4
-
<p align="justify">Have you ever watched a film where a hacker would plug-in, seemingly ordinary, USB drive into a a victims computer and steal data from it? - A proper wet dream for some. <br><br>
5
-
This summer I decided to do exactly that, to build a device that will allow me to steel data from a victims computer. So, how does one deploy malware and exfiltrate data? In the following text I will explain all of the necessary steps, theory and nuances when it comes to building your own keystroke injection tool. While this project/tutorial focuses on stored WiFi passwords, payload and the code could easily be altered to steal absolutely anything. You are only limited by your imagination (and your technical skills).</p>
4
+
<p align="justify">Have you ever watched a film where a hacker would plug-in, seemingly ordinary, USB drive into a a victims computer and steal data from it? - A proper wet dream for some.
6
5
7
6
## Table of contents
8
7
-[WiFi password stealer](#wifi-password-stealer)
9
8
-[Table of contents](#table-of-contents)
9
+
-[Introduction](#introduction)
10
+
-[Setup](#setup)
10
11
-[Prerequisites](#prerequisites)
11
12
-[Requirements - What you'll need](#requirements---what-youll-need)
12
-
-[Keystroke injection](#keystroke-injection)
13
-
-[USB Mass Storage Device Problem](#usb-mass-storage-device-problem)
-[USB Mass Storage Device Problem](#usb-mass-storage-device-problem)
14
18
-[Sending stolen data over email](#sending-stolen-data-over-email)
15
-
-[Setup](#setup)
16
-
-[Protection](#protection)
19
+
-[Exfiltrated WiFi data](#exfiltrated-wifi-data)
20
+
-[Limitations/Drawbacks](#limitationsdrawbacks)
17
21
-[To-Do List](#to-do-list)
18
22
23
+
## Introduction
24
+
<palign="justify">This summer I decided to do exactly that, to build a device that will allow me to steel data from a victims computer. So, how does one deploy malware and exfiltrate data? In the following text I will explain all of the necessary steps, theory and nuances when it comes to building your own keystroke injection tool. While this project/tutorial focuses on WiFi passwords, payload code could easily be altered to do something more nefarious than stealing stored WiFi passwords. You are only limited by your imagination (and your technical skills).</p>
25
+
26
+
## Setup
27
+
<palign="justify">After creating pico-ducky, you only need to copy the modified payload (adjusted for your SMTP details) to the RPi Pico.</p>
19
28
20
29
## Prerequisites
21
30
<ul>
@@ -39,11 +48,24 @@ This summer I decided to do exactly that, to build a device that will allow me t
39
48
> <ul><li>It is possible to build this tool using Rubber Ducky, but keep in mind that <ahref="https://www.raspberrypi.com/products/raspberry-pi-pico/">RPi Pico</a> costs $4.00 and the <ahref="https://shop.hak5.org/products/usb-rubber-ducky">Rubber Ducky</a> costs $80.00.</li>
40
49
> <li>In order to use Ducky Script to write the payload on your RPi Pico you first need to convert it to a pico-ducky.
41
50
42
-
## Keystroke injection
43
-
<palign="justify">Keystorke injection tool, once connected to a host machine, executes malicious commands by running code that mimics keystrokes enterned by a user. While it looks like a USB drive, it acts like a keyboard that types in a preprogrammed payload. Tools like Rubber Ducky can type over 1,000 words per minut. Once created, anyone with physical access can deploy these payloads with ease.</p>
51
+
## Exfiltration
52
+
<palign="justify">Data exfiltration is an unauthorized trasfer of data from a computer/device. Once the data is collected, adversary can package it to avoid detection while sending data over network, using encryption or compression. Two most common way of exfiltration are:
53
+
<ul>
54
+
<li>Exfiltration over network medium.</li>
55
+
<li>Exfiltration over a physical medium.</li>
56
+
</ul>
57
+
58
+
## Keystroke injection tool
59
+
<palign="justify">Keystorke injection tool, once connected to a host machine, executes malicious commands by running code that mimics keystrokes enterned by a user. While it looks like a USB drive, it acts like a keyboard that types in a preprogrammed payload. Tools like Rubber Ducky can type over 1,000 words per minut. Once created, anyone with physical access can deploy this payload with ease.</p>
60
+
61
+
### Keystoke injection
62
+
<palign="justify">The payload uses <code>STRING</code> command processes keystroke for injection. It accepts one or more alphanumeric/punctuation characters. <code>STRING</code> will type the remainder of the line exactly as-is into the target machine. The <code>ENTER</code>/<code>SPACE</code> will simulate a press of keyboard keys.</p.>
44
63
45
-
### USB Mass Storage Device Problem
46
-
<palign="justify">One of the advantages of Rubber Ducky over RPi Pico is that it doesn't show up as a USB mass storage device once plugged in. This isn't a default behaviour for RPi. If you want to prevent your RPi Pico from showing up as a USB mass storage device when plugged in, you need to connect jumper wire between pin 18 (<code>GND</code>) and pin 20 (<code>GPIO15</code>).</p>
64
+
### Delays
65
+
<palign="justify">We use <code>DELAY</code> command to temporarily pause execution of the payload. This is useful when a payload needs to wait for an element such as a Command Line to load. Delay is useful when used at the very beginning when a new USB device is connected to a targeted computer. Initially computer must complete a set of actions before it can begin accepting input commands. In the case of <ahref="https://en.wikipedia.org/wiki/Human_interface_device">HIDs</a> setup time is very short. In most cases it takes a fraction of a second, because the drivers are built-in. However, in some instances a slower PC may take longer to recognize the pico-ducky. The general advice is to adjust the delay time according to your target.</p>
66
+
67
+
## USB Mass Storage Device Problem
68
+
<palign="justify">One of the advantages of Rubber Ducky over RPi Pico is that it doesn't show up as a USB mass storage device once plugged in. Once plugged into a computer all the machine sees it as a USB keyboard. This isn't a default behaviour for RPi. If you want to prevent your RPi Pico from showing up as a USB mass storage device when plugged in, you need to connect jumper wire between pin 18 (<code>GND</code>) and pin 20 (<code>GPIO15</code>).</p>
47
69
48
70
> **Note**:
49
71
> <ul>
@@ -56,16 +78,31 @@ This summer I decided to do exactly that, to build a device that will allow me t
<palign="justify">After adding SMTP password, receiver and send email you need to copy the payload.dd to a RPi Pico.</a>
81
+
<palign="justify">After sending data over email, the <code>.txt</code> file is deleted.</p>
60
82
61
-
> **Note**: <palign="justify">You can also use some an SMTP from another email provider, but you should be mindful of SMTP server and port number you will write in the payload.</p>
83
+
> **Note**:
84
+
> <palign="justify">
85
+
> <ul>
86
+
> <li>You can also use some an SMTP from another email provider, but you should be mindful of SMTP server and port number you will write in the payload.</li>
87
+
> <li>Keep in mind that some networks could be blocking usage of an unknown SMTP at the firewall.</li>
88
+
> </ul>
89
+
> </p>
62
90
63
-
##Setup
64
-
<palign="justify">After creating pico-ducky, you only need to copy the modified payload (adjusted for your SMTP information) to the RPi Pico.</p>
91
+
### Exfiltrated WiFi data
92
+
<palign="justify">Below is an example of extracted data from a victims machine in a <code>.txt</code> format.<p>
65
93
66
-
## Protection
94
+
## Limitations/Drawbacks
95
+
<ul>
96
+
<li><palign="justify">This pico-ducky currently works only on Windows OS.</p></li>
97
+
<li><palign="justify">This attack requires a physical access to an unlocked device in order to be successfully deployed.</p></li>
98
+
<li><palign="justify">Victims machine firewall or networks firewall may prevent you from sending the stolen data to your email.</p></li>
99
+
<li><palign="justify">Payload delays could be inadequate due to varying speeds of different computers used to deploy an attack.</p></li>
0 commit comments