2025 沙崙資安新秀大賽
基於強化學習的工控網路資安防禦系統
基於強化學習的工控網路資安防禦系統
這是我們第一次參加技能競賽網路安全職類
隨著網路應用日益普及,網站安全威脅持續升高,滲透測試成為評估系統安全性的重要手段。近年大型語言模型(Large Language Model, LLM)的快速發展為自動化滲透測試帶來新契機,MAPTA(Multi-Agent Penetration Testing AI)、AWE(Adaptive Agents for Dynamic Web Penetration Testing)等系統已在 XBOW-104 基準上展現可觀的漏洞捕獲率;然而這些系統均以高階昂貴模型(GPT-5、Claude Sonnet 4)為核心,伴隨顯著的 API(Application Programming Interface)推論成本。若直接改用成本最低的弱模型(gpt-5-nano),實驗顯示弱模型雖能在約六成的題目被導航至正確的漏洞端點,全基準卻僅捕獲約 3% 的旗標。可見其瓶頸不在於發現漏洞,而在於利用漏洞。本研究因此主張,對最便宜的弱模型而言,利用才是比導航更關鍵的瓶頸。 基於此,本研究設計一套導航、偵察、利用三方協作架構:以階層式 Thompson Sampling 搭配四層評分進行導航、以弱模型負責偵察、以端點綁定(endpoint-bound)的 Playbook 引擎負責確定性的漏洞利用。在 XBOW-104 基準上以最弱的 gpt-5-nano 評估,純大型語言模型僅捕獲 2.9%,加入 Playbook 後提升至 30.8%,而完整評估的推論成本僅約 4.16 美元,約為 AWE(7.73 美元)的 54%、MAPTA(21.38 美元)的五分之一。據我們所知,本研究首次證明,即使是成本最低的 nano 級弱模型,只要以端點綁定的 Playbook 補足其欠缺的利用能力,也能完成具實用價值的網站自動化滲透。此外,於相同架構下改用能力更強的模型可進一步提升捕獲率,claude-haiku-4-5 達 33.7%、glm-5.2 達 43.3%,顯示端點綁定架構具良好的跨模型泛化性。
大型語言模型(LLM)驅動的自主代理在網路安全領域展現潛力,但長序列推理容易因對話累積造成上下文溢出與資訊遺失,進而影響推理品質。本研究提出一種工作記憶管理機制:在工具輸出寫入記憶前,先由分析者代理進行蒸餾與結構化 摘要,僅保留與當前攻擊階段相關的關鍵資訊,以控制上下文規模並維持資訊完整性。實驗以 CTF 網頁安全題目為場景,在統一的 ReAct [1] 推理框架下 , 與三種記憶策略比較( ReAct[1] 、 HiAgent[2]、CHAP[3]),所有方法共用相同提示、 工具與模型。並於 picoCTF 題目上重複測試,以奪旗成功率、工具呼叫次數、token 消耗量作為指標。結果顯示,所提方法於簡單題目成功率達 100%,平均 token 消耗降低 13%~36%;困難題目成功率為 40%(其餘 0%~20%),token 消耗降低 6%~50%。
Large Language Models (LLMs) have demonstrated exceptional potential in cybersecurity tasks in recent years. However, existing research is limited to single-agent systems, which struggle to address the diverse and cross-domain challenges inherent in realworld penetration testing. This limitation is particularly evident in Capture The Flag (CTF) competitions, where challenges include multiple domains such as web exploitation, binary vulnerability exploitation, cryptography, and reverse engineering. Each domain requires specialized knowledge, tools, and strategies. This research proposes a multi-agent penetration testing framework that employs a hierarchical architecture. The system utilizes a Classification Agent to analyze the type and complexity of input challenges. The agent then dispatches tasks to domain-specialized agents: the Web Agent focusing on application security, the PWN Agent handling binary attacks, and the REV Agent performing reverse engineering analysis. These agents are capable of crossdomain communication and integrated with Kali Linux toolsets to generate targeted attack scripts for capturing the flag in the competitions. Implementation and testing results show that the proposed system effectively coordinates among the agents and generates attack scripts automatically. The experiment validates promising performance across multiple challenge scenarios. Further evaluation indicates that the framework possesses the potential to scale to complex and multi-domain applications. Overall, this research establishes a novel framework that integrates intelligent task classification, cross-agent collaboration, and empirical tool integration capabilities. Compared to single-agent approaches, proposed system can achieve significant improvements in both efficiency and adaptability, providing a viable pathway for implementing LLMs in automated penetration testing and cybersecurity applications.