自動化推測後端邏輯以進行網頁滲透測試
Retrieving Backend Logic with Automata Learning for Penetration Tests
摘要
隨著網路蓬勃發展,許多企業以及服務會選擇以網頁應用程式來當作與使用者互動的介面,因此企業往往掌握了許多人的資料甚至是隱私,資安的問題也越來越受到重視。但是隨著網頁應用程式越來越龐大,人工針對每個網頁進行測試已經變得不足以滿足資安檢測的需求,因此產生了許多自動化滲透測試的工具以彌補快速成長的需求。然而現今的測試方式多是以預先定義的輸入逐條測試,但是預先定義的輸入的測試覆蓋率可能不會太高,且無法系統性的產生對於新的語言或是變形技巧的攻擊輸入。並且我們觀察到,專業滲透測試人員在測試過程中會根據網頁端的回應決定之後要進行或是取消的測試,但是現今的自動化滲透測試工具並沒有蒐集網頁端的回應,導致丟失了許多可能有幫助的資訊。
本研究中,我們提出結合上下文無關文法及變形技巧產生攻擊輸入的模糊測試器。雖然透過文法可以有效率的產生攻擊輸入,但是都是合法語句,容易被防火牆或是函式庫檢測出來。因此透過結合變形技巧模組,增加產生的攻擊輸入的多樣性以更容易檢測出漏洞。同時我們也利用自動狀態機來紀錄及分析網頁回應,能一定程度的獲取後端資訊,以提升滲透測試的效率。本研究以URL Grammar作為實驗對象,對Python之知名URL函式庫進行實驗,並且透過自動狀態機記錄下的資訊避免重複測試無意義的輸入,在不降低程式覆蓋率的情況下縮減產生的攻擊輸入提高效率。
本研究中,我們提出結合上下文無關文法及變形技巧產生攻擊輸入的模糊測試器。雖然透過文法可以有效率的產生攻擊輸入,但是都是合法語句,容易被防火牆或是函式庫檢測出來。因此透過結合變形技巧模組,增加產生的攻擊輸入的多樣性以更容易檢測出漏洞。同時我們也利用自動狀態機來紀錄及分析網頁回應,能一定程度的獲取後端資訊,以提升滲透測試的效率。本研究以URL Grammar作為實驗對象,對Python之知名URL函式庫進行實驗,並且透過自動狀態機記錄下的資訊避免重複測試無意義的輸入,在不降低程式覆蓋率的情況下縮減產生的攻擊輸入提高效率。
As internet grows, most companies decide to provide their services through the web applications. Thus, web security issue become more severe these days. However, the scale of the web application is getting larger, and it would be impractical to test all the entry points manually. Automated tools become an essential part of the testing process. With our observation, modern automated tools use predefined payload list for testing. It is unable to systematically generate attacking payload for other language or new attacking type. Moreover, we notice that professionals will decide their next move based on the responses from the target while the tools nowadays usually ignore it.
In this paper, we combine the mutation strategy with grammar fuzzer to systematically generate attacking payload. The mutation strategy can help grammar fuzzer to mutate some part of payload to trigger the vulnerability but still remaining the structure of the payload to pass the syntax check. We also leverage the automata learner to collect and analyze the server responses, in this way, we can extract the behavior of the target in some level and feedback to the fuzzer to reduce the redundant payload to improve the efficiency of the testing process. We use URL grammar as or target, test it on several well-known python URL libraries. We show that we are able to find vulnerability by rediscover the CVE and the inconsistent behavior between libraries. And show the benefit of feedbacking the automata by reducing redundant payload.
In this paper, we combine the mutation strategy with grammar fuzzer to systematically generate attacking payload. The mutation strategy can help grammar fuzzer to mutate some part of payload to trigger the vulnerability but still remaining the structure of the payload to pass the syntax check. We also leverage the automata learner to collect and analyze the server responses, in this way, we can extract the behavior of the target in some level and feedback to the fuzzer to reduce the redundant payload to improve the efficiency of the testing process. We use URL grammar as or target, test it on several well-known python URL libraries. We show that we are able to find vulnerability by rediscover the CVE and the inconsistent behavior between libraries. And show the benefit of feedbacking the automata by reducing redundant payload.