Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challenges

  • Zimo JI
  • , Daoyuan WU*
  • , Wenyuan JIANG
  • , Pingchuan MA
  • , Zongjie LI
  • , Shuai WANG*
  • *Corresponding author for this work

Research output: Book Chapters | Papers in Conference ProceedingsConference paper (refereed)Researchpeer-review

2 Citations (Scopus)

Abstract

Capture-the-Flag (CTF) competitions are crucial for cybersecurity education and training. With the evolution of large language models (LLMs), there is growing interest in their ability to automate CTF challenge solving, with DARPA's AIxCC competition (since 2023) being a notable example. However, this demands a combination of multiple abilities of LLMs, from knowledge to reasoning and further to actions. In this paper, we highlight the importance of technical knowledge in solving CTF problems and deliberately construct a focused benchmark, CTFKnow, with 3,992 questions to measure LLMs' performance in this core aspect. Our study offers a focused and innovative measurement of LLMs' capability in understanding CTF knowledge and applying it to solve CTF challenges. Our key findings reveal that while LLMs possess substantial technical knowledge, they struggle to apply it accurately to specific scenarios and adapt based on feedback from CTF environments. Based on insights derived from this measurement study, we propose CTFAgent, a novel LLM-driven framework for advancing CTF problem-solving. CTFAgent introduces two new modules: two-stage Retrieval Augmented Generation (RAG) and interactive Environmental Augmentation, which enhance LLMs' technical knowledge and vulnerability exploitation on CTF, respectively. Experiments on two popular CTF datasets show that CTFAgent both achieves over 80% performance improvement. Moreover, in the picoCTF2024 hosted by CMU, CTFAgent ranked in the top 23.6% of nearly 7,000 participating teams. This reflects the benefit of our measurement study and the potential of our framework in advancing LLMs' capabilities in CTF problem-solving.

Original languageEnglish
Title of host publicationCCS '25: Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security
EditorsChun-Ying HUANG, Jyh-Cheng CHEN, Shiuhpyng SHIEH
PublisherAssociation for Computing Machinery, Inc
Pages603-617
Number of pages15
ISBN (Electronic)9798400715259
DOIs
Publication statusPublished - 22 Nov 2025
Event32nd ACM SIGSAC Conference on Computer and Communications Security - Taipei, Taiwan, China
Duration: 13 Oct 202517 Oct 2025

Conference

Conference32nd ACM SIGSAC Conference on Computer and Communications Security
Abbreviated titleCCS 2025
Country/TerritoryTaiwan, China
CityTaipei
Period13/10/2517/10/25

Bibliographical note

Publisher Copyright:
© 2025 Copyright held by the owner/author(s).

Keywords

  • Capture-the-Flag
  • Large Language Model

Fingerprint

Dive into the research topics of 'Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challenges'. Together they form a unique fingerprint.

Cite this