導入
MBSDさんのブログより、LLMをペンテストに使用している例を見てローカルLLMで試してみました。
https://www.mbsd.jp/research/20241210/ai/
内容
今回の対象マシンはVulnHubのToppo:1で、実行環境はKalilinuxです。
有名なツールであるLinpeasを対象マシンで実行し、その結果をローカルLLM(ollama,qwen2.5:3b)が分析し、ツール名を抜き出し、GTFOBinsにて検索を行い、コマンドを出力します。Webサイトのリクエストは一度きりで二回目以降は保存されたものが使われます。
プロンプト
Instructions: The following is the result of running the elevation of authority investigation script. Please output
the name of the tool or command that may be promoted.
Input:
Output://Only the command or tool is output, no explanations, explanatory notes, or other aids are needed.
Temperature=0
結果
このようになり、権限昇格用のコマンドを出力させることができました。コーディングはGPTなので素人でも数十分で作成できました。このような脆弱性自体存在する場合が少ないと思いますので娯楽ツールですね。