Yan-fuzz: 以強化學習優化變異策略排程之模糊測試

Yan-Fuzz: Optimizing Mutation Strategy for Fuzz Testing with Reinforcement Learning

檔案

日期

2023

類型

語言

中文

摘要

在當今的軟體開發環境中,隨著程式碼量的不斷增長和程式邏輯的複雜化,傳統上人工進行如逆向工程和程式碼分析等靜態分析,以及使用 GDB 這類動態分析工具來發現程式碼漏
洞變得日益困難。這些漏洞往往隱藏在不顯眼的位置,或是與非預期格式的輸入數據相關。因此,模糊測試成為了我們發現漏洞的重要工具。

在模糊測試的現代實踐中,特別值得一提的是 AFL(American Fuzzing Lop)。AFL 是一款由 google 開發並開源的自動化測試工具,它從初步的種子輸入出發,通過持續變異這些輸入來揭示新的、尚未發現的漏洞。

本論文基於 AFL 以及多參數模糊測試,提出了一種利用強化學習多臂老虎機優化變異策略的方法。透過將變異器分成不同的群組,我們可以限制每次變異的範圍。在混亂階段,這種方法能夠有效地將變異引導到相同的方向,同時在變異結束後提供了關於方向正確與否的回饋。這個回饋可以指導模糊測試在下一次變異時的方向選擇。

最後,我們透過實驗結果表明,這種方法在多參數模糊測試上能夠非常有效地提高分支覆蓋率並發現原本模糊測試找不到的漏洞。在進行本研究的實驗中,發現了 20 個新的程式崩潰情況以及 6 個未曾被發現的漏洞,並獲得了 4 個 CVE 編號。

關鍵字: 模糊測試、多參數模糊測試、AFL、強化學習、多臂老虎機
In the current software development environment, with the continuous increase in the amount of code and the complexity of program logic, traditional methods such as manual reverse engineering and code analysis for static analysis, as well as the use of dynamic analysis tools like GDB to discover code vulnerabilities, are becoming increasingly difficult. These vulnerabilities often hide in inconspicuous places or are related to inputs in unexpected formats. Therefore, fuzz testing has become an important tool for discovering vulnerabilities.

In the modern practice of fuzz testing, it is particularly worth mentioning AFL (American Fuzzing Lop). AFL is an automated testing tool developed and open-sourced by Google. It starts with initial seed inputs and continuously mutates these inputs to uncover new, previously undiscovered vulnerabilities.

This thesis, based on AFL and multi-argument fuzz testing, proposes a method using reinforcement learning multi-armed bandit to optimize mutation strategies. By dividing mutators into different groups, we can restrict the range of each mutation. During the chaotic phase, this method can effectively guide mutations in the same direction and provide feedback on whether the direction is correct after the mutation. This feedback can guide the fuzz testing in choosing directions for the next mutation.

Finally, our experimental results show that this method is very effective in improving edge coverage and discovering vulnerabilities that were previously undetected by fuzz testing. During the experiments for this research, 20 new crash cases and 6 previously undiscovered vulnerabilities were found, and 4 bugs were assigned CVE IDs.

Keywords: fuzz testing, multi-argument fuzz testing, AFL, reinforcement learning, multi-armed bandit.
顯示完整詮釋資料 統計資料

引用此條目

曾信彥 (2023). Yan-fuzz: 以強化學習優化變異策略排程之模糊測試. https://thesis.lib.nycu.edu.tw/handle/20.500.14371/1009

BibTeX RIS

引用文字依 APA 第 7 版格式自動產生,使用前請再核對。

分享

永久網址:https://thesis.lib.nycu.edu.tw/handle/20.500.14371/1009