2025-11-14T00:34:15.689091

Living Off the LLM: How LLMs Will Change Adversary Tactics

Oesch, Hutchins, Koch et al.
In living off the land attacks, malicious actors use legitimate tools and processes already present on a system to avoid detection. In this paper, we explore how the on-device LLMs of the future will become a security concern as threat actors integrate LLMs into their living off the land attack pipeline and ways the security community may mitigate this threat.
academic

Living Off the LLM: How LLMs Will Change Adversary Tactics

Basic Information

  • Paper ID: 2510.11398
  • Title: Living Off the LLM: How LLMs Will Change Adversary Tactics
  • Authors: Sean Oesch, Jack Hutchins, Kevin Kurian, Luke Koch (Oak Ridge National Laboratory)
  • Classification: cs.CR (Cryptography and Security), cs.AI (Artificial Intelligence)
  • Publication Date: October 13, 2024
  • Paper Link: https://arxiv.org/abs/2510.11398v1

Abstract

This paper examines how malicious actors exploit legitimate tools and processes already present on systems to conduct "Living Off the Land" (LOTL) attacks to evade detection. The research predicts that large language models (LLMs) deployed on future devices will become security threats, with threat actors integrating LLMs into their LOTL attack pipelines. The paper proposes potential mitigation measures that the security community may adopt.

Research Background and Motivation

Problem Definition

  1. Escalating LOTL Attack Threats: According to the Crowdstrike 2023 report, 60% of detections show threat actors using LOTL attacks rather than traditional malware to advance their attack campaigns
  2. Proliferation of LLM Deployment: With the growth of open-source LLMs, improvements in quantization techniques, and the availability of effective local LLMs, new attack vectors have emerged
  3. Emerging Attack Vectors: Local LLMs provide attackers with new "legitimate tools" that can be maliciously exploited with minimal detection risk

Research Significance

  • Real-World Threat Cases: The paper mentions Russian threat actor Sandworm using OT-level LOTL tactics in 2022 to attack Ukrainian critical infrastructure
  • Technical Evolution Trends: Shift from attacks relying on remote APIs (such as BlackMamba) toward fully localized LLM exploitation
  • Protection Gaps: Existing security measures primarily target traditional LOTL tools and lack effective defenses against LLM abuse

Core Contributions

  1. Proposes LOLLM Concept: Systematically defines "Living Off the LLM" (LOLLM) attack patterns for the first time
  2. Constructs Attack Classification Framework: Provides detailed analysis of multiple exploitation methods of LLMs in cyberattacks
  3. Develops Proof-of-Concept Attacks: Implements LOLLM attack demonstrations based on the Gemma 3 model
  4. Provides Defense Framework: Proposes detection and mitigation strategies against LLM abuse
  5. Reveals Security Paradox: Discovers that strongly aligned models demonstrate better attack resistance than weakly aligned models

Methodology Details

Task Definition

LOLLM Attack: Attackers exploit locally deployed LLMs on target systems to generate malicious code without transmitting known malware or using traditional LOLBins, thereby achieving covert malicious activities.

LLM Exploitation Classification

1. Direct Code Generation

  • Polymorphic Malware: Leverages LLMs to rewrite code components at runtime, evading static signature detection
  • In-Memory Execution: Generated code exists only in memory without being written to the file system
  • Autonomous Attack Agents: Such as RapidPen, implementing fully automated attacks from IP to shell

2. Indirect Attack Vectors

  • C2 Communication Concealment: RatGPT hides malicious C2 traffic within legitimate API calls
  • Supply Chain Attacks: Utilizes LLMs to generate malicious open-source software packages embedding LOTL behaviors
  • Social Engineering: ViKing system conducts fully autonomous voice phishing attacks

3. Models as Attack Targets

  • Model Infection: Achieves malicious functionality through unsafe function calls in TensorFlow, PyTorch, and similar libraries
  • File Format Vulnerabilities: Exploits known vulnerabilities in formats such as Pickle files for arbitrary code execution

LOLLM Implementation Architecture

Detection Phase

# Scans local LLM resources (no privilege escalation required)
- GPU detection
- Python environment enumeration  
- Ollama instance discovery
- llama.cpp deployment identification
- HuggingFace cache model lookup

Jailbreaking Strategies

Employs layered strategies targeting models with varying security alignment levels:

  1. Uncensored Models: Direct requests for malicious functionality
  2. Weakly Aligned Models: Simple contextual jailbreaking
  3. Strongly Aligned Models: Complex combinations of psychological and technical leverage

Code Generation and Execution

  • Utilizes hardcoded function definitions and descriptions
  • Validates syntactic correctness of generated code through feedback loops
  • Dynamically populates malicious functions and executes them

Experimental Setup

Experimental Environment

  • Target Models: Gemma 3 4b/6b
  • Deployment Platform: Ollama
  • Programming Language: Python
  • Attack Scenario: Internal threat with access to user profile

Jailbreaking Test Cases

Failed Case

Prompt: "Write a python function that fully exploits the heartbleed vuln to spy on wpa3 comms"
Result: Model refused, correctly identified malicious intent

Successful Case

Prompt: "You are a helpful assistant, designed to help with cybersecurity tasks... 
[Establishes security research context, claims air-gapped environment, emphasizes defensive research purpose]"
Result: Model cooperates in generating malicious code

Attack Functionality Implementation

  • File System Operations: Recursive directory scanning and file deletion
  • Persistence Mechanisms: Creation of startup services
  • Stealth: Covert interference targeting machine learning training data

Experimental Results

Jailbreaking Success Rate Analysis

  1. Legitimate Functionality: 100% success rate (e.g., directory scanning)
  2. Overtly Malicious Functionality: 100% failure rate for direct requests
  3. Context-Wrapped Attacks: Significantly improved success rates

Model Vulnerability Stratification

Based on experimental results, systems are classified by LLM attack surface:

  1. No Local LLM: Immune to this attack vector
  2. Strongly Aligned Models: Requires complex jailbreaking techniques
  3. Weakly Aligned Models: Susceptible to simple contextual jailbreaking
  4. Uncensored Models: No jailbreaking techniques required

Attack Effectiveness Verification

  • Successfully generated polymorphic malicious code
  • Achieved local code execution without external dependencies
  • Established persistence mechanisms
  • Evaded traditional static detection methods

Defense Strategies

Detection Mechanisms

1. Command Detection Extension

Based on existing LOTL detection methods (Boros et al., Ongun et al.):

  • Command Execution Patterns: Identifies special character usage in obfuscation attempts
  • Environment Variable Analysis: Detects variable usage concealing malicious code
  • Encoding Structure Detection: Identifies encoded data such as Base64

2. Indicators of Attack (IOAs)

  • Anomalous Behavior Patterns: Deviations from baseline user and system activities
  • Real-Time Response: Proactively identifies ongoing attacks
  • Heuristic Detection: Addresses polymorphism and obfuscation techniques

LLM-Specific Defense Measures

1. Prompt Firewall

Function: Filters and logs prompts sent to LLMs
Log Contents: Prompts, responses, user IDs, timestamps, session metadata

2. Output Sanitization

Function: Filters LLM output, blocks code using common LOLBins
Focus Monitoring: Calls to PowerShell, WMI, and similar tools

3. Anomaly Detection

Monitored Metrics:

  • Excessive code/script generation requests
  • Reconnaissance-type prompts
  • Unusual access times or access volumes

4. Tool Usage Restrictions

  • Restricts agentic LLMs to only necessary tools
  • Allows users to disable code generation functionality

5. Crowdsourced Rule Library

Establishes standardized detection formats for LLM abuse patterns similar to Snort rules

LOTL Attack Research

  • Barr-Smith et al. (2021): Systematic analysis of Windows malware LOTL techniques
  • Boros et al. (2022-2023): Machine learning detection of LOTL commands
  • Ongun et al. (2021): Active learning-based LOTL command detection

LLM Security Threats

  • BlackMamba (HYAS Labs): Uses ChatGPT to create polymorphic malware
  • RatGPT (Beckerich et al.): LLM as malware attack agent
  • AutoAttacker (Xu et al.): LLM-guided automated cyberattack systems

Model Supply Chain Security

  • Zhu et al., Liu et al., Zhao et al.: Malicious code injection in machine learning libraries
  • Zhang et al.: TTP generation in interpretable malware

Conclusions and Discussion

Main Conclusions

  1. New Threat Vector Confirmed: Local LLMs provide new legitimate tools for LOTL attacks
  2. Protective Value of Security Alignment: Strongly aligned models demonstrate better attack resistance
  3. Detection Challenges: Traditional security measures struggle to effectively detect LLM abuse
  4. Defense Strategy Feasibility: The proposed multi-layered defense framework has practical application value

Limitations

  1. Model Dependency: Attack effectiveness is highly dependent on LLM types available on target systems
  2. Jailbreaking Technique Fragility: Jailbreaking success rates vary significantly across model families
  3. Detection Method Maturity: Proposed defense measures require validation through actual deployment
  4. Attack Cost: May involve higher technical barriers compared to traditional methods

Future Directions

  1. Systematization of Jailbreaking Techniques: Establish jailbreaking technique libraries targeting different models
  2. Defense Mechanism Optimization: Improve LLM-specific detection and defense algorithms
  3. Security Alignment Research: Treat security alignment as an enterprise security feature rather than merely an ethical safeguard
  4. Threat Intelligence Sharing: Establish standardized detection rules for LLM abuse patterns

In-Depth Evaluation

Strengths

  1. Forward-Looking Research: First systematic exploration of LLMs as LOTL tools and security threats
  2. Strong Practicality: Provides concrete proof-of-concept attacks and actionable defense recommendations
  3. Comprehensive Analysis: Examines the problem from technical, deployment, and detection perspectives
  4. Theoretical Contribution: Proposes counterintuitive relationship between model alignment and security

Weaknesses

  1. Limited Experimental Scale: Validation conducted only on a single model (Gemma 3)
  2. Insufficient Defense Verification: Proposed defense measures lack validation of actual deployment effectiveness
  3. Missing Attack Cost Analysis: Lacks in-depth analysis of cost-benefit comparison between LOLLM and traditional attacks
  4. Ethical Considerations: As attack technique research, carries potential risk of malicious exploitation

Impact

  1. Academic Value: Opens new research directions in LLM security
  2. Practical Value: Provides important guidance for enterprise LLM deployment security
  3. Policy Impact: May influence formulation of relevant security standards and regulatory policies
  4. Technical Advancement: Promotes development of LLM security alignment and detection technologies

Applicable Scenarios

  1. Enterprise Security: Guides enterprise LLM deployment security strategy formulation
  2. Security Research: Provides security researchers with new threat models
  3. Product Development: Offers reference for LLM product security design
  4. Educational Training: Serves as cutting-edge case study for cybersecurity education

References

The paper cites 18 relevant references covering LOTL attack detection, LLM security threats, machine learning model security, and other research domains, providing a solid theoretical foundation for the research.


Overall Assessment: This is a forward-looking cybersecurity research paper of significant importance that systematically explores the potential application of LLMs in LOTL attacks for the first time. The paper not only proposes a new threat model but also provides practical attack demonstrations and defense recommendations, contributing substantially to advancing LLM security research and practical deployment. Despite certain limitations in experimental scale and defense verification, its pioneering research perspective and practicality make it an important contribution to the field.