基於快照與重播之可回溯式在線模糊測試
Retrospective In-Vivo Fuzz Testing with Process Checkpoint and System Call Replay
摘要
軟體測試是確保資訊安全不可或缺的技術,而模糊測試是近年來相當熱門的測試手法之一。為了減緩過往測試網路服務程式時的繁雜程序,W.Y. Lai在 2020 年提出 了 In-Vivo 在線式的網路服務程式模糊測試機制,其引入測試進入點選擇以及運行時種子搜集兩大機制,讓測試者可以藉由在線運行程式既有的程式狀態以及真實的網路封包資料對網路程式進行模糊測試,無須仰賴測試者對不同的網路程式撰寫專用的測試器具(test harness)或是具備網路協議相關的領域知識(domain knowledge)。
然而,過往的 In-Vivo 測試要求測試者事先指定期望測試的程式狀態或區塊,再假定目標程式有招一日會執行到指定的位置以發起測試,但這樣被動等待的方式除了無法確定發生的時機以外也會已經出現異常行為的服務程式持續暴露在風險當中。因此,為了讓測試者可以用更主動的方式發起模糊測試,本研究提出「基於快照與重播之可回溯式在線模糊測試」系統,其結合 In-Vivo 測試與程序的記錄與重播機制,讓測試者可以主動且有效的重現網路程式過往的執行狀態,並且能夠利用容器化的運行環境達到跨主機重播以及異地模糊測試的效果。實驗結果證實,透過回溯機制的輔助能夠完整的發揮 In-Vivo 測試機制帶來的優勢,讓模糊測試引擎在相對短的時間觸發目標程式潛在的漏洞。
然而,過往的 In-Vivo 測試要求測試者事先指定期望測試的程式狀態或區塊,再假定目標程式有招一日會執行到指定的位置以發起測試,但這樣被動等待的方式除了無法確定發生的時機以外也會已經出現異常行為的服務程式持續暴露在風險當中。因此,為了讓測試者可以用更主動的方式發起模糊測試,本研究提出「基於快照與重播之可回溯式在線模糊測試」系統,其結合 In-Vivo 測試與程序的記錄與重播機制,讓測試者可以主動且有效的重現網路程式過往的執行狀態,並且能夠利用容器化的運行環境達到跨主機重播以及異地模糊測試的效果。實驗結果證實,透過回溯機制的輔助能夠完整的發揮 In-Vivo 測試機制帶來的優勢,讓模糊測試引擎在相對短的時間觸發目標程式潛在的漏洞。
Software testing is an indispensable technique to ensure information security, and fuzz testing is one of the most popular testing methods in recent years. To streamline the complex procedures traditionally involved in testing network service programs, W.Y. Lai proposed the In-Vivo testing mechanism for online network service in 2020, which introduces two key mechanisms, namely test entry point selection and runtime seed collection, to allow testers to conduct fuzz testing of network programs by using the existing program state of the online application and the real network packet data. This technique eliminates the need for testers to write specialized test harnesses or possess domain knowledge related to network protocols.
However, previous In-Vivo testing required testers to pre-specify the desired program states or code blocks for testing and assume that the target program would eventually reach the target location to initiate testing. Therefore, in order to allow testers to initiate testing in a more proactive way, this thesis proposes a "Retrospective In-Vivo Fuzz Testing with Process Checkpoint and System Call Replay" system, which combines the In-Vivo testing with process record and replay mechanism to allow testers to proactively and efficiently reproduce the past execution state of the network program, and utilize the containerized running environment to achieve cross-machine replay and off-site fuzz testing. Experiments show that the assistance of the replay mechanism can fully utilize the advantages brought by the In-Vivo testing, allowing the fuzz engine to trigger potential vulnerabilities in the target program in a relatively short period of time.
However, previous In-Vivo testing required testers to pre-specify the desired program states or code blocks for testing and assume that the target program would eventually reach the target location to initiate testing. Therefore, in order to allow testers to initiate testing in a more proactive way, this thesis proposes a "Retrospective In-Vivo Fuzz Testing with Process Checkpoint and System Call Replay" system, which combines the In-Vivo testing with process record and replay mechanism to allow testers to proactively and efficiently reproduce the past execution state of the network program, and utilize the containerized running environment to achieve cross-machine replay and off-site fuzz testing. Experiments show that the assistance of the replay mechanism can fully utilize the advantages brought by the In-Vivo testing, allowing the fuzz engine to trigger potential vulnerabilities in the target program in a relatively short period of time.