Kuboid
Open Luck·Kuboid.in

Regenerating Passwords from RoboForm's Password Generator

DEFCONConference2,241 views43:16over 1 year ago

The speakers demonstrate a technique to recover passwords generated by the RoboForm password manager by exploiting a poorly seeded pseudo-random number generator (PRNG) that relies on system time. By identifying the specific system time used as a seed, they can precompute and regenerate the generated passwords. The research highlights the risks of using predictable seeds in cryptographic functions and provides a practical example of reverse engineering a closed-source application to extract sensitive data. The talk includes a demonstration using Cheat Engine and x64dbg to manipulate the application's memory and state.

How Predictable PRNG Seeds Let Researchers Recover Encrypted Bitcoin Wallets

TLDR: Researchers at DEF CON 32 demonstrated how to recover passwords generated by the RoboForm password manager by exploiting a poorly seeded pseudo-random number generator (PRNG) that relies on system time. By identifying the specific system time used as a seed, they were able to precompute and regenerate the generated passwords. This research highlights the critical risk of using predictable seeds in cryptographic functions and provides a practical example of reverse engineering a closed-source application to extract sensitive data.

Security researchers often assume that established password managers handle entropy correctly, but this assumption can lead to catastrophic failures. When a password manager uses a PRNG seeded with a predictable value like system time, the entire security model collapses. This is exactly what happened with RoboForm, where a flaw in the password generation process allowed researchers to recover passwords by brute-forcing a significantly reduced keyspace.

The Mechanics of the Vulnerability

The core issue lies in how the application generates random numbers. A PRNG is deterministic by nature. If you know the seed, you know the output. In this case, the application used the system time—specifically the number of seconds since the Unix epoch—as the seed for its PRNG.

During their research, the team identified that the application called a system time function before invoking the PRNG. By using Cheat Engine to monitor memory and x64dbg to debug the process, they observed that the application was not just using the time, but was also performing additional, predictable manipulations on that value.

Because the seed was tied to a specific, narrow window of time, the total number of possible passwords was reduced from a massive, computationally infeasible space to a range that could be brute-forced in a matter of hours on a standard machine. This is a classic example of CWE-335: Incorrect Usage of Seeds in Pseudo-Random Number Generator (PRNG), a vulnerability that falls squarely under OWASP A02:2021-Cryptographic Failures.

Reverse Engineering the Logic

The team used Ghidra to decompile the binary and locate the password generation routine. They found that the application was not using a cryptographically secure source of entropy. Instead, it was calling a standard time function and then applying a fixed offset.

// Simplified representation of the flawed seeding logic
time_t seed = time(NULL);
seed = seed - offset; // The predictable manipulation
srand(seed);

By identifying this offset, the researchers could synchronize their own password generation tool with the target's internal clock. They built a custom wrapper in C that mimicked the application's generation logic. This allowed them to generate millions of potential passwords per second, effectively turning a "random" password into a deterministic sequence based on the time of creation.

Real-World Impact for Pentesters

For a pentester or bug bounty hunter, this research is a reminder to look beyond the surface of an application. When you encounter a feature that generates sensitive data—like tokens, keys, or passwords—always investigate the source of randomness. If you can influence or predict the seed, you can bypass the security controls entirely.

In a real-world engagement, you might encounter this when auditing thick-client applications or embedded devices that lack access to high-quality entropy sources. If you see an application generating credentials, check if those credentials exhibit patterns or if they can be reproduced by manipulating the system clock. The impact of such a flaw is total compromise of the protected data, as demonstrated by the recovery of a Bitcoin wallet encrypted with a RoboForm-generated password.

Defensive Recommendations

Developers must stop using system time as a seed for any security-sensitive operation. Instead, use cryptographically secure PRNGs provided by the operating system, such as /dev/urandom on Linux or BCryptGenRandom on Windows. These sources gather entropy from hardware noise and other unpredictable system events, making them resistant to the type of time-based prediction shown here.

If you are a developer, audit your codebase for any instance of srand() or similar functions that take a time-based seed. If you find them, replace them immediately with modern, secure alternatives. For those of us on the offensive side, keep digging into these implementations. The next time you see a "random" password generator, don't just assume it's secure—test the entropy, verify the seed, and see if you can break the determinism. The most interesting bugs are often hidden in the parts of the code that developers thought were "random enough."

Talk Type
research presentation
Difficulty
intermediate
Has Demo Has Code Tool Released


DEF CON 32

260 talks · 2024
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in