LLMs as Hackers: Autonomous Linux Privilege Escalation Attacks

Andreas Happe, Aaron Kaplan, Juergen Cito
10/17/2023
68 citations
cs.CRcs.AI

Official code: ipa-lab/hackingBuddyGPT (1,341 stars, Python, MIT, last commit 2026-03-26).

Abstract

Penetration-testing is crucial for identifying system vulnerabilities, with privilege-escalation being a critical subtask to gain elevated access to protected resources. Language Models (LLMs) presents new avenues for automating these security practices by emulating human behavior.

Show full abstract

However, a comprehensive understanding of LLMs' efficacy and limitations in performing autonomous Linux privilege-escalation attacks remains under-explored. To address this gap, we introduce hackingBuddyGPT, a fully automated LLM-driven prototype designed for autonomous Linux privilege-escalation. We curated a novel, publicly available Linux privilege-escalation benchmark, enabling controlled and reproducible evaluation. Our empirical analysis assesses the quantitative success rates and qualitative operational behaviors of various LLMs -- GPT-3.5-Turbo, GPT-4-Turbo, and Llama3 -- against baselines of human professional pen-testers and traditional automated tools. We investigate the impact of context management strategies, different context sizes, and various high-level guidance mechanisms on LLM performance. Results show that GPT-4-Turbo demonstrates high efficacy, successfully exploiting 33-83% of vulnerabilities, a performance comparable to human pen-testers (75%). In contrast, local models like Llama3 exhibited limited success (0-33%), and GPT-3.5-Turbo achieved moderate rates (16-50%). We show that both high-level guidance and state-management through LLM-driven reflection significantly boost LLM success rates. Qualitative analysis reveals both LLMs' strengths and weaknesses in generating valid commands and highlights challenges in common-sense reasoning, error handling, and multi-step exploitation, particularly with temporal dependencies. Cost analysis indicates that GPT-4-Turbo can achieve human-comparable performance at competitive costs, especially with optimized context management.

View on arXivView PDF

Code Implementations(1)

MIT

Helping Ethical Hackers use LLMs in 50 Lines of Code or less..

1,341235Python, ShellAug 2, 20238 months agoMIT
large-language-modelsllmpenetration-testingpentesting

Similar Papers

Cite this paper

@article{happe2023llms,
  title  = {LLMs as Hackers: Autonomous Linux Privilege Escalation Attacks},
  author = {Andreas Happe and Aaron Kaplan and Juergen Cito},
  year   = {2023},
  eprint = {2310.11409},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.11409v7}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.11409.svg)](https://codeofpaper.com/paper/2310.11409)

Discussion