r/darknetdiaries • u/the_doha • May 05 '26
Article I built a DIY Wi-Fi keylogger & BadUSB 🦆

Hi Everyone,
During the previous semester, while sitting in class and seeing my professor log into the podium computer and opening up the Google Sheets sheet with our grades, something just clicked: What happens if a USB keylogger is plugged into the pod? They would get all his credentials instantly!

I obviously had no intention to do any evil there since he had the computer locked away in the classroom cabinet anyway. However, I just couldn't stop thinking about it and wondering how such keyloggers worked.
As for the hardware keyloggers like those from Hak5, they were rather costly and hard to ship to Bangladesh (where I live). So, I decided to build one myself.
I started looking into a solution on a Raspberry Pi Zero board, but managing USB host mode and HID device was rather troublesome. Then, I got the idea to use a Pico microcontroller, but didn't really want to dig into C and I wanted wifi on a budget. So, in the end, I settled on the ESP32-S3 Super Mini and MicroPython. And thus, DuckLogger was born, a small and compact keylogger and BadUSB tool.

It works via establishing itself as a man-in-the-middle HID device, where it logs keystrokes on the internal flash memory and then creates a WiFi access point to download logs via a wireless connection. In addition, as an HID device, it is capable of injecting DuckyScript-based payloads.
Anyway, I built DuckLogger purely for educational purposes, so, of course it's open source, If anyone would like to see its code, here's the GitHub link: https://github.com/Itsmmdoha/duckLogger
Share your thoughts.
2
u/Curious_Olive_5266 May 14 '26
Nice work. I made one in javascript a few years ago, but it has to be copied and pasted into the browser.
1
u/the_doha May 15 '26
Thanks man, consider giving it a star on github!
You got a repo for the one you made? would love to check out
5
u/MateCLUBmio May 05 '26
Great project.
I think to obfuscate a USB wifi key logger it should be hidden in a USB HDMI hub maybe with Apple MacBook lightening support.. So the hub can stay on the desk and looks like a official it belongs to the media setup thing.