Your headphones can become a microphone: the step-by-step breakdown
From Adam Rosler, AI engineer. The one you commented JACK for.
What's happening
A speaker is a microphone in reverse. Sound pushes the membrane, the membrane moves a coil past a magnet, and that induces a tiny current: the same parts that make sound can pick it up.
What makes that a security problem is jack retasking. The audio chips on many PC motherboards let software switch a jack's job, for example from headphone output to microphone input. It's in the chip's documented specification and is meant for flexibility (turning a mic jack into a second headphone jack, say), but it can also be used to listen.
In 2017, Mordechai Guri, Yosef Solewicz, Andrey Daidakulov and Yuval Elovici at Ben-Gurion University of the Negev showed how ("SPEAKE(a)R: Turn Speakers to Microphones for Fun and Profit", USENIX WOOT 2017):
- They built a malware prototype that silently retasks the headphone jack to an input, with software alone.
- With a pair of ordinary wired headphones (Sennheiser HD 25-1 II) as the microphone, they recorded speech that was still intelligible from nine meters away.
- At one meter, the headphone recording scored 2.6 on PESQ, a standard speech-quality score out of 5. A real microphone at the same distance scored 2.5.
- It works when the PC has no microphone, or the microphone is muted, switched off or taped over: all the attack needs is headphones (or passive speakers) plugged in.
The paper describes 2016-17 hardware and drivers (it names Realtek chips, which were in a wide range of PC motherboards then). How much of it still applies depends on your machine.
Step 1: lock it down
- Unplug headphones and passive speakers you're not using. No plugged-in speaker, nothing to retask.
- Switch off onboard audio you don't need. If you use a USB headset, a USB DAC or your monitor's audio, disable the motherboard's audio in the UEFI/BIOS settings (the paper's first countermeasure).
- Watch for apps that change your sound settings. A new, unexpected recording device is the tell:
- Windows: Settings → System → Sound → All sound devices; look at the input list.
- macOS: System Settings → Sound → Input.
- Linux:
pactl list short sources(or your sound settings' input list).
Step 2 (build it yourself): turn your own headphones into a microphone
Do this only on your own computer, and record only yourself. You need a Linux PC with an HD Audio codec (most desktops
with onboard audio), a pair of cheap wired headphones you don't mind, and root access. This is the tool the paper
cites: hdajackretask, by Linux audio developer David Henningsson.
- Install it. It ships in
alsa-tools(Arch, Fedora) oralsa-tools-gui(Debian, Ubuntu). - Find your headphone jack. Run
sudo hdajackretask, pick your codec at the top, and look at the pin list: each pin is named by its colour and location ("Green Line Out, Rear side", "Black Headphone, Front side"). - Retask it. On the headphone jack's pin, tick Override and choose Microphone. Click Apply now. (The sound driver restarts, so close audio apps first.)
- Plug the headphones in and record. Turn the input gain up (
alsamixer, F4 for capture, or your sound settings), then record ten seconds while you talk at the headphones:arecord -f cd -d 10 me.wav && aplay me.wav(play it back through other speakers). It'll be quiet and thin, but it's your voice, picked up by a speaker. - Undo it. In hdajackretask, untick the override and click Apply now again (or just reboot: "Apply now" doesn't survive a reboot unless you choose "Install boot override").
Labels and pin names vary by codec and distribution; if your codec has no retaskable pins, that's step 1 working for you.
The short version
Tape stops a camera, not a speaker.
Source: M. Guri, Y. Solewicz, A. Daidakulov, Y. Elovici, "SPEAKE(a)R: Turn Speakers to Microphones for Fun and Profit", USENIX WOOT 2017 (arXiv 1611.07350). Tool: D. Henningsson, "Turn your mic jack into a headphone jack!" (2011), the paper's reference [15].
Unlock the full JACK breakdown
Drop your email once to read the complete step-by-step guide, grab the files, and unlock all 96 Reel breakdowns on this device forever.