Monday, March 17, 2025
Homecyber securityDeepSeek R1 Jailbreaked to Create Malware, Including Keyloggers and Ransomware

DeepSeek R1 Jailbreaked to Create Malware, Including Keyloggers and Ransomware

Published on

SIEM as a Service

Follow Us on Google News

The increasing popularity of generative artificial intelligence (GenAI) tools, such as OpenAI’s ChatGPT and Google’s Gemini, has attracted cybercriminals seeking to exploit these technologies for malicious purposes.

Despite the guardrails implemented by traditional GenAI platforms to prevent misuse, cybercriminals have circumvented these restrictions by developing their own malicious large language models (LLMs), including WormGPT, FraudGPT, Evil-GPT, and GhostGPT.

The recent open-source release of DeepSeek’s local LLMs, such as DeepSeek V3 and DeepSeek R1, has raised concerns about their potential misuse by cybercriminals due to their accessibility and lack of safeguards.

Tenable Research has been conducting an in-depth analysis of DeepSeek R1 to evaluate its ability to generate malware.

This investigation focused on two scenarios: creating a Windows keylogger and developing a simple ransomware program.

We think with a more inconspicuous name, this wouldn’t be a huge issue for most use cases.

Keylogger Creation: Challenges and Vulnerabilities

When prompted to write a Windows-based keylogger in C++, DeepSeek initially refused, citing ethical and legal concerns.

However, researchers were able to bypass its guardrails by framing the request as being for “educational purposes.”

Using its reasoning capabilities—enabled by Chain-of-Thought (CoT) prompting—DeepSeek outlined the steps required to create a keylogger.

The initial code generated by DeepSeek was buggy and required manual corrections. For instance:

  • Incorrect use of WS_EX_TOOLBAR was replaced with WS_EX_TOOLWINDOW.
  • Errors in thread monitoring parameters were fixed.
  • Formatting issues with logging keystrokes were addressed.

After these adjustments, the keylogger successfully captured keystrokes and stored them in a hidden file.

Researchers further improved the malware by implementing encryption for the log file and using hidden file attributes to make detection more difficult.

A Python script was also developed to decrypt the encrypted log file.

Despite these improvements, DeepSeek struggled with implementing advanced stealth techniques, such as hiding processes from Windows Task Manager.

The research highlighted how DeepSeek could provide basic frameworks for malware development but required significant manual intervention for functionality.

Ransomware Development: Ethical Implications

Researchers then tested DeepSeek’s ability to generate ransomware—a type of malware that encrypts files and demands payment for decryption keys.

Through CoT reasoning, DeepSeek identified key steps for ransomware development, including file enumeration, AES encryption, and persistence mechanisms via registry modifications.

While the generated code required manual edits to compile successfully, researchers were able to produce functional ransomware samples.

These samples included features such as:

  • A persistence mechanism that added entries to the Windows registry.
  • A dialog box notifying victims of file encryption.
  • File encryption using AES128-CBC with randomly generated keys.

DeepSeek also identified potential challenges in ransomware development, such as cross-platform compatibility, handling file permissions, optimizing performance for large files, and avoiding detection by antivirus software.

However, it concluded that creating ransomware is a complex task requiring expertise in cryptography and secure key management while raising significant ethical and legal concerns.

Tenable Research’s analysis revealed that DeepSeek has the capability to create basic malware structures but lacks the sophistication to produce fully functional malicious programs without extensive manual intervention.

Its vulnerabilities to jailbreaking techniques make it a potential tool for cybercriminals seeking to develop malware with minimal expertise.

The findings underscore the need for stricter safeguards in AI systems to prevent misuse.

As AI-generated malicious code becomes more accessible, cybersecurity professionals must remain vigilant in addressing emerging threats fueled by advancements in generative AI technologies.

Are you from SOC/DFIR Teams?: Analyse Malware Incidents & get live Access with ANY.RUN -> Start Now for Free

Kaaviya
Kaaviya
Kaaviya is a Security Editor and fellow reporter with Cyber Security News. She is covering various cyber security incidents happening in the Cyber Space.

Latest articles

Hackers Rapidly Adopt ClickFix Technique for Sophisticated Attacks

In recent months, a sophisticated social engineering technique known as ClickFix has gained significant...

Supply Chain Attack Targets 23,000 GitHub Repositories

A critical security incident has been uncovered involving the popular GitHub Action tj-actions/changed-files, which...

Beware! Malware Hidden in Free Word-to-PDF Converters

The FBI has issued a warning about a growing threat involving free file conversion...

MassJacker Clipper Malware Targets Users Installing Pirated Software

A recent investigation has uncovered previously unknown cryptojacking malware, dubbed MassJacker, which primarily targets...

Supply Chain Attack Prevention

Free Webinar - Supply Chain Attack Prevention

Recent attacks like Polyfill[.]io show how compromised third-party components become backdoors for hackers. PCI DSS 4.0’s Requirement 6.4.3 mandates stricter browser script controls, while Requirement 12.8 focuses on securing third-party providers.

Join Vivekanand Gopalan (VP of Products – Indusface) and Phani Deepak Akella (VP of Marketing – Indusface) as they break down these compliance requirements and share strategies to protect your applications from supply chain attacks.

Discussion points

Meeting PCI DSS 4.0 mandates.
Blocking malicious components and unauthorized JavaScript execution.
PIdentifying attack surfaces from third-party dependencies.
Preventing man-in-the-browser attacks with proactive monitoring.

More like this

Hackers Rapidly Adopt ClickFix Technique for Sophisticated Attacks

In recent months, a sophisticated social engineering technique known as ClickFix has gained significant...

Supply Chain Attack Targets 23,000 GitHub Repositories

A critical security incident has been uncovered involving the popular GitHub Action tj-actions/changed-files, which...

Beware! Malware Hidden in Free Word-to-PDF Converters

The FBI has issued a warning about a growing threat involving free file conversion...