New Mac backdoor program steals keychain contents

The Keydnap malware uses creative ways to infect computers and gain root access

Researchers have identified a new Mac backdoor program that's designed to steal credentials stored in the OS-encrypted keychain and give attackers control over the system.

Dubbed OSX/Keydnap by researchers from antivirus vendor ESET, this is the second backdoor program targeting Macs found by antivirus firms in the past few days.

It's not clear how Keydnap is distributed, but it arrives on computers in the form of a zip archive. Inside there's an executable file with an apparently benign extension such as .txt or .jpg that actually has a space character at the end. The file also has an icon indicating an image or text file.

Opening this malicious file in Finder actually executes its code in the Terminal application. The execution happens really fast, with the Terminal window just flashing for a bit. The good news is that if the file is downloaded from the internet and the Gatekeeper security feature is turned on on the latest versions of OS X, the file won't be executed automatically and the user will see a security warning.

However, if the code is executed, it will download and install the backdoor component, called icloudsyncd, which connects to a command-and-control channel over the Tor anonymity network. If it has root access, this component also configures itself to start every time the Mac is rebooted.

The way it tries to obtain root access is also interesting. It will wait until the user runs a different application and it will immediately spawn a window asking for the user’s credentials, exactly like the window OS X users usually see when an application requires admin privileges.

The backdoor can receive commands from the control server to update itself, to download and execute files and scripts, to execute shell commands and to send back the output. It also includes a component that steals the contents of the OS X keychain.

This component seems to be based on open-source, proof-of-concept code published on GitHub. It reads the memory of the securityd OS X service, which handles the keychain access, and searches for the keychain decryption key. Once it has this key, it can exfiltrate user credentials stored inside.

While infecting Macs with malware is arguably more difficult than PCs, especially in the latest version of OS X with all the security features turned on, Keydnap shows that attackers can still come up with creative ways to trick users and exploit their habits.

Join the PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Lucian Constantin

IDG News Service
Show Comments

Most Popular Reviews

Latest News Articles


GGG Evaluation Team

Kathy Cassidy


First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni


For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell


The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi


The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott


My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?