August 7, 2015 By Douglas Bonderud 2 min read

Man-in-the-middle (MitM) attacks have become commonplace; most organizations now deploy strong authentication strategies and encryption tactics to combat this problem. Malicious actors, however, are getting more sophisticated. According to CSO Online, cybercriminals are launching man-in-the-cloud (MitC) attacks that leverage popular file sync services to gain complete and persistent access to stored files, all without the need for user credentials.

File Sync Gains Token Appreciation

For many companies, cloud-based file services are the ideal way to accommodate increasingly mobile employees — when workers can sync files from any device, anywhere, increased productivity is the natural result. As noted by SecurityWeek, however, there’s a problem: Popular options like Dropbox, Google Drive, Microsoft OneDrive and Box are all vulnerable to cybercriminal hijackings.

To streamline file sync, these services rely on access tokens generated after users log in for the first time. These tokens are then stored in the Windows registry or Windows Credential Manager. The result is that employees aren’t required to continually re-authenticate, but as discovered by researchers from Imperva, tokens provide an ideal access point for attackers.

The Imperva team created a tool called Switcher that infects a system via email or drive-by download. A copy is made of the user’s access token, which is then replaced by one from an attacker-controlled account. After an app restart, the file service is synchronized with the attacker’s account and then the process happens in reverse — a copy of the original token is copied to the sync folder and the app is restarted again, giving cybercriminals total access to user files.

Even more worrisome? The ten lines of code needed for Switcher don’t look like malware, meaning it’s unlikely the program would get caught by current threat detection software. There’s no need for malicious actors to go after user credentials, either, since the token does all the work.

Persistent Problems

While Imperva CTO Amichai Shulman said file sync solutions “aren’t dangerous or insecure,” he noted that “it’s kind of a trade-off between usability and security.” According to ZDNet, the kind of persistent tokenization used by cloud services comes with a number of security concerns. First is the problem of passwords. Since most tokens are linked to a device rather than a session, even changing passwords won’t prevent attacker access. Users need to fully log out and change devices — or delete their accounts entirely — to get ahead of criminals.

In addition to the risks of stolen or ransomed files, there’s the problem of persistent access. It’s possible for programs like Switcher to create scheduled tasks or Windows Management Instrumentation (WMI) events triggered by specific files in the sync folder, giving them both ongoing access and the ability to leverage systems as cloud command-and-control (C&C) servers.

Ultimately, file sync services offer a huge advantage for businesses looking to leverage the power of both mobile workers and devices. Tokenization is a necessary evil here. It’s a way to simplify user access without leaving files vulnerable to standard attack vectors, but MitC attacks are a natural evolution of the medium. Bottom line? There’s no quick fix, but if companies do better than token security investments — for example, deploying file- and database-monitoring tools — it’s possible to minimize the risks of hijacked cloud accounts.

More from

SoaPy: Stealthy enumeration of Active Directory environments through ADWS

10 min read - Introduction Over time, both targeted and large-scale enumeration of Active Directory (AD) environments have become increasingly detected due to modern defensive solutions. During our internship at X-Force Red this past summer, we noticed FalconForce’s SOAPHound was becoming popular for enumerating Active Directory environments. This tool brought a new perspective to Active Directory enumeration by performing collection via Active Directory Web Services (ADWS) instead of directly through Lightweight Directory Access Protocol (LDAP) as other AD enumeration tools had in the past.…

Smoltalk: RCE in open source agents

26 min read - Big shoutout to Hugging Face and the smolagents team for their cooperation and quick turnaround for a fix! Introduction Recently, I have been working on a side project to automate some pentest reconnaissance with AI agents. Just after I started this project, Hugging Face announced the release of smolagents, a lightweight framework for building AI agents that implements the methodology described in the ReAct paper, emphasizing reasoning through iterative decision-making. Interestingly, smolagents enables agents to reason and act by generating…

4 ways to bring cybersecurity into your community

4 min read - It’s easy to focus on technology when talking about cybersecurity. However, the best prevention measures rely on the education of those who use technology. Organizations training their employees is the first step. But the industry needs to expand the concept of a culture of cybersecurity and take it from where it currently stands as an organizational responsibility to a global perspective.When every person who uses technology — for work, personal use and school — views cybersecurity as their responsibility, it…

Topic updates

Get email updates and stay ahead of the latest threats to the security landscape, thought leadership and research.
Subscribe today