The blue box worked because the telephone network accepted any tone that sounded like a switch. Keystroke injection works because a computer accepts any device that announces itself as a keyboard. This part of the series opened by the map from the blue box to the Flipper Zero follows that one idea through four generations of Universal Serial Bus (USB) hardware: the and its scripting language, the Bash Bunny that can pretend to be several devices at once, the reprogrammed controllers that researchers named in 2014, and the , which hides the attack inside an ordinary-looking lead. The company behind most of these tools has its own part. After reading, you can explain why the trust exists, read a listing down to the bytes a computer receives, tell keystroke injection from BadUSB, retell the documented attacks from their sources, choose defences knowing where each one stops, and say what the law says in Brazil, the United States (US), the United Kingdom (UK) and the European Union (EU).

Why a computer believes any keyboard

USB has a device class for keyboards, mice and similar controls: the human interface device (HID) class, whose definition, version 1.11, is dated 27 June 2001 (USB Implementers Forum (USB-IF), Device Class Definition for HID 1.11). A device tells the host what it is through descriptors, and a keyboard that supports the simple "boot" protocol declares interface subclass 1, "Boot Interface Subclass", a simpler format meant for devices that the BIOS (basic input/output system) must support before an operating system loads (same document, section 4.2).

The boot keyboard speaks in eight-byte reports. Byte 0 carries the modifier keys, byte 1 is reserved, and bytes 2 to 7 carry up to six key codes; in the other direction a one-byte output report lights Num Lock, Caps Lock, Scroll Lock, Compose and Kana (HID 1.11, appendix B.1). On each report the host looks at the modifier bits and the six key codes to see what changed since the last report, and translates the codes through a lookup table (appendix F.5). The table lives in the HID Usage Tables, where 0x04 is the A key, 0x15 the R key, 0x28 Return (Enter) and 0xE3 the Left key (GUI for graphical user interface), which a footnote of the tables equates with the Windows key (USB-IF, HID Usage Tables 1.5).

Nothing in that exchange asks the keyboard to prove anything. A systematization of USB attacks presented at the Symposium on Security and Privacy in May 2018 (University of Illinois, paper record) concluded that "all attacks abuse the 'trust-by-default' nature of the USB ecosystem", and noted that the word "security" does not appear in the USB 1.x specification at all (Tian, Scaife, Kumar, Bailey, Bates and Butler, SoK: "Plug & Pray" Today, 2018). Operating systems follow the same default: documentation states that "By default, all USB devices are authorized" (Linux kernel, Authorizing (or not) your USB devices).

A keyboard also types with the privileges of whoever is logged in. Microsoft's long-standing "10 Immutable Laws of Security" put the consequence in one line: "If a bad guy has unrestricted physical access to your computer, it's not your computer anymore" (Microsoft Learn, 10 Immutable Laws of Security, law 3). Keystroke injection is that law compressed into a few seconds: a device that says it is a keyboard, types what its author wrote, and leaves.

2010: the idea becomes a product

Two projects put programmable keyboards into testers' hands in the same year. At 18, on 31 July 2010, Adrian Crenshaw presented the Programmable HID USB Keystroke (PHUKD), built on the Teensy microcontroller board, which typed stored keystrokes and mouse macros when plugged in, after a set time, or when a sensor saw light, noise or temperature change (InfoconDB, DEF CON 18, Crenshaw). His pitched it as a replacement for the autorun-based USB tricks of the time "in places where autorun from removable storage it is disabled" (Irongeek, Programmable HID USB Keystroke Dongle).

, a company that began as a video show in 2005 (Hak5, Our Story), says it "introduced Keystroke Injection in 2010 with the USB Rubber Ducky", a technique its founder Darren Kitchen used to automate routine chores in his information technology job, such as fixing printers and network shares (Hak5 documentation, USB Rubber Ducky). The same page says the guide covers hardware "mark I (2011) and II (2022)", and the shop's public product data dates the Ducky's listing to 20 September 2011 (Hak5 shop, USB Rubber Ducky product data). The shop goes further than the documentation and says the Ducky "invented the Keystroke Injection attack (sometimes called BadUSB)" (same product data); Crenshaw's talk of the same summer is the other half of the record, and the two claims sit side by side.

The language was the selling point. DuckyScript was "Originally just three commands", which Hak5 says anyone could learn in minutes whatever their experience (Hak5 documentation). Hak5's product page promised that computers would "accept pre-programmed keystroke payloads at over 1000 words per minute" (Hak5, USB Rubber Ducky page).

The USB Rubber Ducky today

The second-generation Ducky arrived in 2022 with DuckyScript 3.0, which Hak5 describes as a structured language with conditional statements, loops, functions and extensions, plus features specific to injection: HID and storage attack modes, Keystroke Reflection, jitter and randomization (Hak5 documentation). Darren Kitchen showed it at that year's DEF CON, where press coverage singled out its ability to tell a Windows computer from a Mac and to leak data through the keyboard lights (TechRadar, 17 August 2022).

What it presents to the computer. The ATTACKMODE command chooses between HID (a keyboard), STORAGE (a flash drive backed by its microSD card), both at once as a composite device, or OFF, which stops the computer from seeing the device at all (Hak5 documentation, Attack Modes). The same command sets the 16-bit identifier (VID) and product identifier (PID); the documentation's own example copies a Logitech K120 keyboard, and notes that the identifiers of an Apple keyboard suppress the Keyboard Setup Assistant that macOS opens for unfamiliar keyboards. Without such parameters the device announces itself as "USB Input Device" with the serial number 111111111111 (same page).

Keystroke Reflection. The one-byte output report that lights a keyboard's lock keys also travels from the computer to the device, and Hak5 built an exfiltration channel on it: a payload makes the target encode data as Caps Lock and Num Lock changes, and the Ducky records the resulting light changes, bit by bit, into a file on its card. Hak5 presents it as a technique it developed that "does not rely on a system weakness, rather the system design and implementation dating back to 1984", and says it works through on Windows and Bash on Linux, with "very limited" macOS support (Hak5 documentation, Exfiltration).

Timing. A payload cannot type until the computer has finished setting up the new device. Hak5's guidance explains that on very old computers that setup could take one to two seconds, which is why payloads traditionally began with a three-second pause (Hak5 blog, Detect Ready). A jitter option randomizes the gap between key presses, up to 20 milliseconds by default, so that each run types with a different cadence (Hak5 documentation, Jitter).

The product and its terms. On 16 November 2026 Hak5 listed the Ducky at $100, with Pro and Elite bundles at $110 and $130; the hardware has built-in USB-A and USB-C connectors and stores its compiled script on the included microSD card, and Hak5 now frames it for "an authorized assessment", teaching and automation (Hak5 shop, USB Rubber Ducky product data). A separate "USB Rubber Ducky R" has been listed since 8 September 2022 at $1,000 with no public description (Hak5 shop, USB Rubber Ducky R product data). The documentation's legal notice says the material is for "education, authorized auditing and analysis purposes where permitted subject to local and international laws" and that Hak5 products are available only to countries in the US export-control category it names (Hak5 documentation).

A DuckyScript listing, line by line

Hak5's introductory page teaches the original language in four lines, a remark, a delay, a string and the Enter key, and then gives a slightly longer example for Windows, reproduced here as published (Hak5 documentation, Hello, World!):

REM A slightly more advanced "Hello, World!" for Windows
DELAY 3000
REM Open the Run dialog
WINDOWS r
DELAY 1000
REM Open powershell with our message
STRING powershell "echo 'Hello, World!'; pause"
ENTER

Hak5's own breakdown says that each line is processed one at a time, and that a line holds a comment, a delay, or keys to press (same page). Hak5's pages do not publish the Ducky's own report descriptor, so the right-hand column below shows what the computer receives in the standard boot keyboard format, worked out from the HID class definition and the usage table cited above.

LineWhat DuckyScript means (Hak5)What reaches the computer
REM ...A remark: a comment for the author, never typedNothing
DELAY 3000Pause for 3,000 millisecondsNothing; the pause covers the time the computer takes to set up the new keyboard (Detect Ready)
WINDOWS rPress the Windows key with R, the shortcut for the Run dialogOne report holding the Left GUI modifier (usage 0xE3, the fourth bit of byte 0, value 0x08) and key code 0x15, then an all-zero report that releases both (HID 1.11; HUT 1.5)
DELAY 1000Wait a second for the dialog to openNothing
STRING powershell ...Type the characters, holding Shift where needed (Keystroke Injection)A press and a release report for every character; capitals and symbols such as the double quote carry the Shift modifier
ENTERPress EnterKey code 0x28, then release

Byte by byte, the report for WINDOWS r looks like this in the boot format (the eight-byte layout is from HID 1.11, appendix B.1):

Byte0 (modifiers)1 (reserved)234567
Value0x08 (Left GUI)0x000x15 (R)0x000x000x000x000x00

Two practical details follow from the design. First, the codes are positions on a keyboard, not letters, so the Ducky's compiler uses a "Language File", the lookup table "the Compiler uses to encode your keystrokes for a given keyboard language" (Hak5, Hello, World!), and a payload has to be compiled for the keyboard language the target uses. Second, what the defender can see is the arrival of a new keyboard, a window that flashes open, and a process started by the logged-in user, which is the detection chain describes for hardware additions (MITRE ATT&CK, T1200 Hardware Additions).

The Bash Bunny: one plug, many devices

Hak5 introduced the Bash Bunny in 2017 and coupled DuckyScript with the Bash shell, so that payloads could run "multi-vector USB attacks" from a Linux computer the size of a flash drive (Hak5 documentation); the open-source P4wnP1 project recalls that the Bunny was announced days after its own first commit in February 2017 (P4wnP1 wiki). Hak5 sums the device up as one that emulates "combinations of trusted USB devices", such as gigabit , serial, flash storage and keyboards (Hak5 documentation, Bash Bunny).

Its ATTACKMODE covers a serial console (the Abstract Control Model, ACM), Ethernet in the form Windows expects (Remote Network Driver Interface Specification, RNDIS) and the form Linux, Mac and Android (Ethernet Control Model, ECM), USB mass storage and the HID keyboard; each combination registers by default under vendor identifier 0xF000 with its own product identifier, from 0xFF01 for a keyboard alone to 0xFF21 for storage with ECM Ethernet, and both identifiers can be spoofed (Hak5 documentation, ATTACKMODE). A three-position switch selects two payload slots and an arming mode, in which the device offers its Linux shell over serial (Switch Positions; Bash Bunny product data).

The Mark II added a microSDXC slot (up to 2 TB in Hak5's listing), Bluetooth Low Energy for "wireless geofencing, remote triggers", a quad-core -A7 processor up to 1.3 GHz and 8 GB of onboard storage, runs Debian Linux, and keeps first-generation payloads working; Hak5 listed it at $200 on 16 November 2026 and claims it "goes from plug to pwn in 7 seconds" (Hak5 shop, Bash Bunny product data; Considerations for Mark II).

The network inside the plug

The Bunny's most consequential trick is not typing. Presented as a USB network adapter, it becomes "a network of two", the Bash Bunny and its target, and Hak5 explains that as a "2 gigabit adapter with an authoritative server" (Dynamic Host Configuration Protocol) it obtains a low metric, so "the computer will instantly trust the Bash Bunny with its network traffic", locked or unlocked; its QuickCreds payload, Hak5 says, steals "hashed credentials from locked computers in seconds" (Hak5 documentation, Network Hijacking Attacks).

The technique was published months before the Bunny shipped. On 6 September 2016 Rob Fuller (mubix) wrote that a device masquerading as a USB Ethernet adapter could capture credentials from a logged-in but locked computer, calling it "dead simple and shouldn't work, but it does"; his set-up used the USB Armory or Hak5's Turtle (LAN for local area network) running the Responder tool, and a DHCP option that hands the computer a proxy configuration (Malicious Link, Snagging creds from locked machines). On 16 November 2016 Samy Kamkar published PoisonTap, built for the "$5" Raspberry Pi Zero, whose DHCP answer told the computer that the entire IPv4 address space was local, so that traffic flowed to the device even though it had lower priority than the real network card; he added that locking the computer "has no effect" because the network and USB stacks keep working (Samy Kamkar, PoisonTap). Neither attack types a key. Both rest on the same default as the Ducky: a new USB device is accepted, and its network is believed.

BadUSB: when the chip inside the plug is the attacker

In 2014 the Berlin firm Security Research Labs (SRLabs) moved the problem from purpose-built gadgets to ordinary peripherals. Its post of 31 July 2014 explained that USB controller chips, including those in thumb drives, "have no protection from such reprogramming", and that a reprogrammed device could emulate a keyboard, spoof a network card to change the computer's DNS settings, or boot a small virus before the operating system starts (SRLabs, USB peripherals can turn against their users). Karsten Nohl and Jakob Lell presented the work at USA on 7 August 2014 as "BadUSB - On Accessories that Turn Evil", announcing a full system compromise from USB and a self-replicating USB virus that the protections of the day could not detect (InfoconDB, Black Hat USA 2014).

The slides, which also credit Sascha Krißler, show the mechanism: a thumb drive contains a microcontroller (an 8051 core in their example) running the user never sees; reversing and patching that firmware "took less than 2 months"; a device can deregister and register again as a different device; and "Keyboard emulation is enough for infection and privilege escalation" (SRLabs, BadUSB, Black Hat slides). Their table of protections found each one wanting: allow lists fail because devices do not always have unique serial numbers, firmware scanning fails because malicious firmware can spoof a legitimate one, code signing is hard on small chips, and only disabling firmware updates in hardware was "Simple and effective" (same slides).

A later version of the talk, given at PacSec 2014, surveyed 52 chip families from the top eight vendors and 33 devices, concluded that "up to half of USB chips are BadUSB-vulnerable", found fuse bits in only one large chip family and firmware signing in none, and reported that no affected vendor offered patches or an advisory (SRLabs, BadUSB, PacSec slides). SRLabs itself did not release its modified controller firmware and offered an Android proof of concept instead (SRLabs post). At DerbyCon that autumn Adam Caudill and Brandon Wilson did publish code for the Phison 2251-03 controller, including a custom firmware that presents itself as a HID device and a patch that hides half of a drive's storage; Caudill wrote that they hoped the release would push manufacturers to demand signed firmware updates (Adam Caudill, Making BadUSB Work For You, 2 October 2014). Their repository includes a tool to embed a Rubber Ducky inject.bin script into the custom firmware, which is where the two lines of history meet (Psychson README).

A word that drifted. In SRLabs' sense BadUSB is an ordinary peripheral whose controller has been reprogrammed. In everyday use the word now covers purpose-built injectors too: Hak5's shop applies it to the Ducky (product data), the FBI warning described below calls cheap Arduino-based boards "BadUSB" (WaterISAC summary of the FBI FLASH), and the USBGuard project describes its target as "rogue USB devices (a.k.a. BadUSB)" (USBGuard). The distinction matters for defence: a purpose-built device can at least be recognized by what it is, while a reprogrammed peripheral looks like the product its label says it is.

The O.MG Cable: the implant moves into the wire

The leaked National Security Agency (NSA) ANT catalogue included a malicious cable called COTTONMOUTH, and Mike Grover, known as MG, recalls that "you had to have a million dollars just to get fifty cables. So, that's twenty grand each" (Darknet Diaries, episode 161, MG, 15 July 2025, transcript). In the same interview he describes the step that changed his own cable: a radio meant "There was no need to get access to the cable to update a payload on it or to trigger a payload" (same transcript; episode page).

His account of the production is a lesson in why such tools were rare. For DEF CON in August 2019 he made cables "from the ground up in my kitchen", at eight hours per cable with half of them failing, so sixteen hours of work per viable cable; they sold out, Darren Kitchen of Hak5 taught him about mass production, a factory took about five months to learn the job, and the first batch went to the Hak5 warehouse around 1 January 2020 for online sales (Darknet Diaries 161). In August 2019 he demonstrated a hand-modified Apple Lightning cable to Motherboard: the reporter's Mac behaved normally until MG opened a terminal on it remotely from his phone, at a range he put at "up to 300 feet" with a smartphone, or unlimited if the cable joined a nearby Wi-Fi network with internet access (Vice, 10 August 2019).

The product line today is made by Mischief Gadgets LLC, which calls itself "a small group of security professionals and researchers" and sells through an exclusive (Mischief Gadgets), and that reseller is Hak5 (O.MG). Hak5's documentation says the O.MG platform licenses DuckyScript (Hak5 documentation). On 16 November 2026 the listings read as follows (O.MG Cable; O.MG Plug; O.MG Adapter; O.MG UnBlocker; Malicious Cable Detector):

DeviceWhat it looks likeListed price (16 November 2026)Maker's description
O.MG Cable, BasicUSB-A cable to Lightning, micro-USB or USB-C, 1 m$150"Keystroke Injection with WiFi controls" (O.MG)
O.MG Cable, EliteUSB-A or USB-C cable, plain or woven$180 to $220Adds a "Covert Exfil & Comms Channel, Hardware Keylogger, Networked ", C2 being command and control (O.MG)
O.MG PlugKeychain plug$85 (Basic), $115 (Elite)DuckyScript payloads controlled from a web browser
O.MG AdapterUSB-A to USB-C adapter$200 (Elite)USB 2.0 passthrough while the implant "stays undetectable to the host"
O.MG UnBlockerA USB data blocker$150 (Elite)"looks and functions like a data blocker, but inside is a wireless O.MG implant"
Malicious Cable DetectorA small tester$40Detects "all known malicious USB cables" and doubles as a data blocker

The cable listing frames the product against the agency's: "Until now, a cable like this would cost $20,000", it says, giving COTTONMOUTH-I as the example, and adds the cables help red teams emulate sophisticated adversaries and test detection (Hak5 shop, O.MG Cable product data). Several listings add that regulations require the devices to be shipped "deactivated", to be enabled with a separate programmer (O.MG Plug product data).

How hard they are to see. Mischief Gadgets' own detector page explains that most malicious cables found in the wild are physically suspicious or "produce signals on the data lines", but that O.MG cables are "invisible on the data lines until a payload is triggered"; the detector instead watches the cable's power draw "200,000 times per second" (Malicious Cable Detector product data). When the industrial imaging company Lumafield scanned an O.MG USB-C cable in 2024, its computed tomography (CT) showed the antenna and microcontroller in the connector and a second die hidden under the microcontroller that was practically invisible on an ordinary two-dimensional X-ray (Tom's Hardware, 5 December 2024). MG tells of a red team engagement in which the client found two planted network devices within a day and swept the room, and the O.MG cable "was still in play" afterwards (Darknet Diaries 161).

Cheap clones and open platforms

The commercial tools have inexpensive cousins. Analysing a fake Best Buy gift-card letter in March 2020, Trustwave found a board marked "HW-374", sold online as a "BadUSB Leonardo USB ATMEGA32U4", programmed to emulate a keyboard, and observed that personal computers "trust keyboard USB devices by default" (Trustwave SpiderLabs, 26 March 2020). P4wnP1, a "highly customizable USB attack platform" for the Raspberry Pi Zero first released in February 2017 (P4wnP1 wiki), lives on as P4wnP1 A.L.O.A., for which Kali Linux still publishes an image (Kali documentation). Defaults give such tools away until someone changes them: a SensePost walkthrough shows a P4wnP1 board announcing itself to Linux as "MaMe82 P4wnP1 by MaMe82" (SensePost, 18 May 2020), much as the Ducky's default name and serial number and the Bunny's 0xF000 vendor identifier do (sources above).

In the wild

Would anyone plug it in? In a controlled experiment, researchers dropped 297 flash drives on the University of Illinois campus and estimated a success rate of 45 to 98%, with the first drive connected in under six minutes; 68% of the people who answered their survey said they took no precautions (Tischer and others, Users Really Do Plug in USB Drives They Find, IEEE Symposium on Security and Privacy 2016). One of the authors, Elie Bursztein of Google, then showed at Black Hat how keys that spoof a keyboard make such drops reliable, because the attack runs "as soon as the device is plugged into the computer" (Elie Bursztein, 2 August 2016). The existing part on social engineering covers baiting as a technique.

FIN7's mailings. The Best Buy letter that Trustwave analysed promised a $50 gift card and carried the keyboard-emulating board, which fetched PowerShell code from the attackers' server; Trustwave later received confirmation from multiple sources that the campaign matched indicators of FIN7, a criminal group targeting hospitality and retail since at least 2015 (Trustwave SpiderLabs). In January 2022 the Federal Bureau of Investigation (FBI) updated its warning in a FLASH report distributed to industry under the Traffic Light Protocol, which public summaries describe this way: since August 2021 businesses in transport and insurance, and since November 2021 the US defence industry, received packages by the US Postal Service and United Parcel Service imitating the Department of Health and Human Services (HHS), with letters about COVID-19 guidelines, or Amazon, with counterfeit gift cards and forged thank-you notes; the enclosed devices, "BadUSB" or "Bad Beetle USB" boards with the LilyGO logo, registered as HID keyboards, which let them work "even with removable storage devices toggled off", and the group's goal was such as BlackMatter and REvil (BleepingComputer, 7 January 2022; WaterISAC, 11 January 2022). The FBI quotation that WaterISAC published is the whole mechanism: "When plugged into a computer system, the USB device automatically injects a series of keystrokes to download and execute a malware payload" (WaterISAC).

A Bash Bunny in a bank. Kaspersky's investigation of the DarkVishnya thefts at no fewer than eight Eastern European banks in 2017 and 2018 found that intruders posing as couriers or job seekers planted one of three devices: a cheap laptop, a Raspberry Pi or a Bash Bunny; on the network the device "appeared as an unknown computer, an external flash drive, or even a keyboard", and a cellular modem gave the attackers remote access (Kaspersky, Securelist, DarkVishnya, 6 December 2018). The case belongs as much to the next part of the series, on network implants.

Defences, layer by layer

No single control closes the gap; the 2018 systematization found that none of the existing protections is a complete solution and that those spanning several layers work best (Tian and others, SoK, 2018). The table pairs each layer with what it stops and where it stops.

LayerControlWhat it stopsWhere it stops
PeopleDo not connect unknown devices; report mailed or found onesThe mailed and dropped devices aboveUp to 98% of found drives were connected in the Illinois study (Tischer and others)
Operating system promptmacOS on Apple silicon laptops asks before a new accessory may connect (Apple Support)An unattended plug-in on a locked or unlocked Mac, depending on the settingThe user approves what looks like a keyboard; administrators can set "Always allow"
Kernel and policy, LinuxUSB authorization (in the kernel since 2007) enforced by USBGuard rules (USBGuard)Unlisted devices, flash drives that also expose a keyboard, a second keyboardRules matching vendor and product identifiers can be fooled by spoofing (Hak5, Attack Modes)
Policy, WindowsDevice installation policies by hardware identifier (ID), instance ID or setup class; Defender for Endpoint device control (Microsoft Learn)Unapproved device types and modelsBlocking removable storage does not stop a device that registers as a keyboard (BleepingComputer)
BehaviourKeystroke timing checks such as Google's UKIP (USB Keystroke Injection Protection), described on the Google Open Source Blog, 10 March 2020Typing faster than a personInjection tools add random delays (Hak5, Jitter)
LoggingWindows event 6416 for each new external device (Microsoft Learn); MITRE's detection chain (T1200)Silent arrival: the event is recorded and can be correlatedDetection after the fact, unless it triggers a response
Cables and chargersControlled supply of cables; testers and imagingSwapped or gifted cablesA data blocker can itself be an implant (O.MG UnBlocker)
StandardsUSB Type-C AuthenticationUncertified chargers and devices, by certificateFormal analysis found that "BadUSB attacks are still possible" (SoK, 2018)

USBGuard in practice. The daemon scans its rules in order and, if none matches, blocks the device by default "until a decision is made by the user"; the project's own examples include a policy that allows only devices with a single mass-storage interface, a set of rules that rejects flash drives which also expose a keyboard, communications or wireless interface, and a rule that allows a keyboard only if no other keyboard has already been allowed (USBGuard, Rule Language). It relies on the kernel's per-device and per-port authorization switches (Linux kernel documentation).

Windows. Microsoft's device installation policies can allow or prevent devices by hardware ID, compatible ID, device instance ID or device setup class, and the documentation warns that multi-function devices must be matched on every identifier they present (Microsoft Learn, Manage Device Installation with Group Policy). Defender for Endpoint's device control covers removable storage, printers, Bluetooth and other peripherals (Microsoft Learn, Device control). MITRE's mitigation for limiting hardware installation lists allow-listing devices by serial number, device control tools and logging of installation events (MITRE ATT&CK, M1034).

Timing. Google's UKIP daemon measures the interval between keystrokes and either logs or ejects a device that types too fast; Google found a window of five keystrokes effective, presets the threshold for an abnormal interval between keystrokes at 50000 and asks users to tune it to their own typing, and calls the tool "not a silver bullet", meant to protect "a user sitting in front of their unlocked machine" (Google Open Source Blog; UKIP README).

Locked is not safe. PoisonTap's author listed the defences against network-over-USB attacks: HTTPS everywhere with the Secure flag on cookies on the server side, and on the desktop, closing the browser, disabling ports, or an encrypted sleep that stops the browser from making requests, since locking alone "has no effect" (Samy Kamkar, PoisonTap).

Standards. On 2 January 2019 the USB-IF launched its USB Type-C Authentication programme, whose specification "defines cryptographic-based authentication for USB Type-C chargers and devices" (Design & Reuse, USB-IF release). The 2018 formal analysis argued that authentication does not bind a device to its function, so firmware that lies about its descriptors can still sign them, that legacy devices cannot take part, and that a policy refusing them would clash with USB's universality, making the scheme "likely to be trivially bypassable by applying a converter" (SoK, 2018). Research prototypes such as GoodUSB, which asks the user what a newly connected device is meant to be and enforces that answer, point at a different design (Tian, Bates and Butler, GoodUSB, Annual Computer Security Applications Conference 2015).

In Brazil's public sector. The federal Privacy and Information Security Programme (PPSI 2.0) guide names removable media and "pen drives USB" among the ways malware enters, asks agencies to configure antimalware software to scan removable media automatically, and to handle unauthorized assets by removing them from the network, denying them remote connection or quarantining them (Ministério da Gestão e da Inovação em Serviços Públicos, PPSI 2.0 Framework Guide (in Portuguese), version 1.2, 30 January 2026).

What the law says

The devices are legal to sell in most places; what the law reaches is intent and use. In brief, as of 16 November 2026:

JurisdictionProvisionWhat it covers
BrazilPenal Code, article 154-A, paragraph 1, inserted by Law 12.737 of 30 November 2012"The same penalty applies to whoever produces, offers, distributes, sells or spreads a device or computer program with the intent of enabling the conduct defined in the caput" (our translation here and below) (Senado Federal, Lei 12.737/2012)
BrazilLaw 14.155 of 27 May 2021Rewrote the intrusion offence in the caput without the requirement to breach a security mechanism, raised its penalty to one to four years of reclusão, and created aggravated forms of theft by fraud through an electronic or computer device and of electronic fraud ("fraude eletrônica"), each four to eight years (Diário Oficial da União, Lei 14.155/2021)
Brazil and other partiesBudapest Convention on Cybercrime, article 6, "misuse of devices", promulgated by Decree 11.491 of 12 April 2023Producing, selling, importing or possessing a device "designed or adapted primarily" to commit the Convention's offences; paragraph 2 excludes authorized testing and the protection of a system (Câmara dos Deputados, Decreto 11.491/2023)
United States18 U.S.C. 1030 (Computer Fraud and Abuse Act)Among other offences, knowingly causing the transmission of a "program, information, code, or command" that intentionally causes damage without authorization to a protected computer (Cornell Legal Information Institute)
United KingdomComputer Misuse Act 1990, section 3AMaking, adapting, supplying or offering to supply "any article" intending it, or believing it likely, to be used for a computer misuse offence; up to two years on indictment (legislation.gov.uk)
European UnionDirective 2013/40/EU, article 7Intentional production, sale or distribution of tools "without right" and with intent to commit offences, the tools being defined as a computer programme or passwords and access codes (EUR-Lex)

Three points stand out. Brazil's paragraph 1 names the "dispositivo" itself, not only software, and turns on intent; the Lei Carolina Dieckmann entry and the part on bug bounties and disclosure cover the rest of article 154-A, including the 2021 changes and the absence of a research exception. Brazil's ratification came two decades after the Convention was signed in Budapest on 23 November 2001: Congress approved it by Legislative Decree 37 of 16 December 2021, the instrument of ratification was deposited on 30 November 2022, and the Convention entered into force for Brazil on 1 March 2023 (Senado Federal, Decreto 11.491/2023). And the vendors' own terms put the burden on the buyer: Hak5's say the material is for authorized use "where permitted" and that "Users are solely responsible for compliance" (Hak5 documentation), while its code of ethics records the export classification of its products (Hak5, Code of Ethics). Import rules, radio certification and the rules of engagement for red teams belong to a later part on owning hacking gear legally.

What to remember

  • USB keyboards are trusted by default: the HID class has no authentication step, and an eight-byte report is all a computer needs to act on a key press.
  • Keystroke injection devices appeared in 2010, with Crenshaw's Teensy-based PHUKD and Hak5's USB Rubber Ducky; DuckyScript grew from three commands to a structured language in 2022.
  • The Bash Bunny (2017) adds a Linux computer and can present itself as keyboard, storage, serial and network adapter at once; USB network attacks work on locked computers.
  • BadUSB (SRLabs, 2014) is the reprogramming of ordinary USB controllers; the term now also covers purpose-built injectors.
  • The O.MG Cable puts a Wi-Fi-controlled injector and keylogger inside a 1-metre cable, sold by Hak5 since about 2020, and is hard to find without power analysis or CT imaging.
  • FIN7 mailed keyboard-emulating boards to US companies from 2020 to 2021; DarkVishnya planted a Bash Bunny among other devices in banks.
  • Defence is layered and each layer has a known limit: policy, operating-system prompts, USBGuard or Windows device installation rules, timing checks, logging, controlled cables and USB Type-C Authentication.
  • In Brazil, article 154-A paragraph 1 punishes producing or selling a device intended to enable intrusion; the Budapest Convention, in force for Brazil since 1 March 2023, adds the misuse-of-devices offence with a carve-out for authorized testing.

Sources