Skip to content
GPT_Vuln

GPT_Vuln

Sploitus • September 23, 2026

##

これは、AI を使用して脆弱性分析の正確な結果を生成する方法を示す概念実証アプリケーションであり、すでに非常に便利な ChatGPT をさらに活用することもできます。このアプリケーションは、openai-api、python-nmap、dnsresolver の各 Python モジュールを使用し、GUI 版では customtkinter と tkinter も使用して作成されています。このプロジェクトには CLI と GUI の両方のインターフェースがあり、ネットワーク脆弱性分析、DNS 列挙、サブドメイン列挙を実行できます。

3つのパッケージのいずれかを簡単にインポートし、それに応じて変数を追加・定義してください。```python

from GVA.packet_analysis import PacketAnalysis

# KEEP IT BLANK IF YOU HAVE NO CLUE THE WILL ASK TO FILL IT ONCE ACTIVE

threads = 200 # Default INT 200 but can be increased.

target_ip_hostname_or_token = "TARGET IP, HOSTNAME OR TOKEN"

ai_set_args = "" # Keep it blank at any cost

* 最初に、コードの "OPENAI_API_KEY"、"GEOIP_API_KEY"、"BARD_API_KEY" の部分をOpenAI APIキーとIPGeolocation APIキーに変更し、`.env`ファイルに保存します。

* `llama-api`オプション、または特定のllama runpodサーバーレスエンドポイントデプロイメントオプションを使用するには、runpodから`serverless endpoint ID`と`RUNPOD API KEY`を入力する必要があります。```python GEOIP_API_KEY = '' OPENAI_API_KEY = '' BARD_API_KEY = '' RUNPOD_ENDPOINT_ID = '' RUNPOD_API_KEY = ''

* コードを実行してください python3 gpt_vuln.py```bash

python gpt_vuln.py --target \--attack dns/nmap/jwt

python gpt_vuln.py --target \--attack nmap --profile (Default:1)

# Specify target for DNS no profile needed

python gpt_vuln.py --target \--attack dns

# Specify target for Subdomain Enumeration no profile used default list file

python gpt_vuln.py --target \--attack sub

# Specify target for Subdomain Enumeration no profile used custom list file

python gpt_vuln.py --target \--attack sub --sub_list

python gpt_vuln.py --target \--attack geo

python gpt_vuln.py --target \--attack pcap --output \--thread NUM of threads

python gpt_vuln.py --target \--attack nmap --profile \--ai llama /llama-api /bard / openai

python gpt_vuln.py --target \--attack dns --ai llama /llama-api /bard / openai

# Specify the AI to be used for JWT analysis

python gpt_vuln.py --target \--attack jwt --ai llama /llama-api /bard / openai

python gpt_vuln.py --password_hash \--wordlist_file \--algorithm \--parallel --complexity

OpenAI GPT3.5と同じですが、より高速です。同じ回答を2倍の速度で生成できます。

プロファイルは、nmapサブプロセスによって実行されるスキャンのタイプです。IPまたはターゲットはargparseを介して提供されます。最初に、スキャンを続行するための重要な引数をすべて含むカスタムnmapスキャンが実行されます。次に、スキャンデータはnmapによって生成された膨大なデータの山から抽出されます。「scan」オブジェクトには、「tcp」の下にサブデータのリストがあり、それぞれが開いているポートに応じてラベル付けされています。データが抽出されると、プロンプトを介してopenai APIのDavinciモデルに送信されます。プロンプトは特にJSON出力を要求し、データも特定の方法で使用されることを要求します。openai APIに送信する必要があるリクエストの構造全体は、プログラムのcompletionセクションで設計されています。```python class NetworkScanner(): profile_arguments = { 1: '-Pn -sV -T4 -O -F', 2: '-Pn -T4 -A -v', 3: '-Pn -sS -sU -T4 -A -v', 4: '-Pn -p- -T4 -A -v', 5: '-Pn -sS -sU -T4 -A -PE -PP -PY -g 53 --script=vuln', 6: '-Pn -sV -p- -A', 7: '-Pn -sS -sV -O -T4 -A', 8: '-Pn -sC', 9: '-Pn -p 1-65535 -T4 -A -v', 10: '-Pn -sU -T4', 11: '-Pn -sV --top-ports 100', 12: '-Pn -sS -sV -T4 --script=default,discovery,vuln', 13: '-Pn -F' }

def scanner(self, ip: Optional[str], profile: int, akey: Optional[str],

bkey: Optional[str], lkey, lendpoint, AI: str) -> str:

nm.scan(ip, arguments=self.profile_arguments.get(profile))

'openai': lambda: AIModels.GPT_AI(akey, analyze),

'bard': lambda: AIModels.BardAI(bkey, analyze),

'llama': lambda: AIModels.Llama_AI(analyze, "local", lkey, lendpoint),

'llama-api': lambda: AIModels.Llama_AI(analyze, "runpod", lkey, lendpoint)

raise ValueError("Invalid AI type or missing keys")

提供されたカスタムプロンプトから重要な情報のみを抽出するためにRegexを使用します。これにより、不要なデータの総量が削減されます。

AIコードは出力フォーマットを定義し、AIにいくつかの事前定義されたルールに従うように指示することで精度を向上させます。正規表現抽出コードが抽出を行い、さらにメイン関数がそれらをテーブルに整理します。

Bard AIを使用するには、MakerSuit Palm APIにデベロッパーアクセス用にサインアップし、そこからAPIキーを生成する必要があります。リンクや仕組みについては、この動画[MakerSuit](

LLama2を使用することは、オフラインで無料の最良の選択肢の一つです。現在改善中で、AIによりサイバーセキュリティの視点を取り入れるプロンプトに取り組んでいます。

**@thisserand**氏と彼の[llama2_local]( API機能を追加しただけです。

オフラインおよびコードのテスト外でのAIの精度は素晴らしく、OpenAIやBardと同等の精度でしたが、コード内ではプロンプトなどの理由でいくつかの問題に直面していました。修正に努めます。

速度はシステムとお持ちのGPUおよびCPU構成に依存します。現在、`TheBloke/Llama-2-7B-Chat-GGML`モデルを使用しており、`portscanner`および`dnsrecon`ファイルで変更できます。

現時点では、llamaのコードとスキャンは別々に処理されています。いくつかのテストの結果、llamaを意図したように動作させるには少しトレーニングが必要であることがわかったため、時間がかかります。その方法についての提案があれば、このリポジトリのディスカッション[Discussions Link](

[INST] > {user_instruction} > NMAP Data to be analyzed: {user_message} [/INST]

指示は次のようになります:```prompt Do a NMAP scan analysis on the provided NMAP scan information. The NMAP output must return in a asked format accorging to the provided output format. The data must be accurate in regards towards a pentest report. The data must follow the following rules: 1) The NMAP scans must be done from a pentester point of view 2) The final output must be minimal according to the format given. 3) The final output must be kept to a minimal. 4) If a value not found in the scan just mention an empty string. 5) Analyze everything even the smallest of data. 6) Completely analyze the data provided and give a confirm answer using the output format. 7) mention all the data you found in the output format provided so that regex can be used on it. 8) avoid unnecessary explaination. 9) the critical score must be calculated based on the CVE if present or by the nature of the services open 10) the os information must contain the OS used my the target. 11) the open ports must include all the open ports listed in the data[tcp] and varifying if it by checking its states value. you should not negect even one open port. 12) the vulnerable services can be determined via speculation of the service nature or by analyzing the CVE's found. The output format: critical score: \- Give info on the criticality "os information": \- List out the OS information "open ports and services": \- List open ports \- List open ports services "vulnerable service": \- Based on CVEs or nature of the ports opened list the vulnerable services "found cve": \- List the CVE's found and list the main issues.

プロンプトを介して提供された指示セットとデータを使用して、llama AIがその出力を生成します。

最も使いやすい方法として、runpodのサーバーレスエンドポイントデプロイメントを作成することをお勧めします。それについては、このチュートリアルを参照してください [tutorial](

この最新のアップデートでは、ollama Dockerイメージを使用してローカライズされたllamaシステムを実装しており、これにより出力の精度が何らかの理由で向上しています。より良い設定などが理由かもしれません。これについて詳しくは説明しませんが、GPU統合部分のコードに取り組んでおり、処理にGPUパワーを追加して効率を高める予定です。議論を開始してくれた@andr6に感謝します。この実装についてより詳しい方がいれば、自由に改善してPRを作成してください。

┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

┃ Variables ┃ Results ┃

┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩

│ Algorithm Used │ HS256 │

│ Header │ eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9 │

│ Payload │ eyJzdWIiOiAiMTIzNDU2Nzg5MCIsICJuYW1lIjogIkpvaG4gRG9lIiwgImlhdCI6IDE1MTYyMzkwMjJ9 │

│ Signature │ │

│ PossibleAttacks │ None identified │

│ VulnerableEndpoints │ Unable to determine without additional information │

└─────────────────────┴──────────────────────────────────────────────────────────────────────────────────┘

┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Elements ┃ Results ┃ ┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ critical score │ High │ │ os information │ Microsoft Windows 11 21H2 │ │ open ports │ 80, 22, 445, 902, 912 │ │ open services │ http, ssh, microsoft-ds, vmware-auth, vmware-auth │ │ vulnerable service │ OpenSSH │ │ found cve │ CVE-2023-28531 │ └────────────────────┴─────────────────────────────────────────────────────┘

╭───────────────────────────────────────────── The GVA LLama2 ──────────────────────────────────────────────╮

│ │

│ │

│ │

│ Based on the provided NMAP data, I have conducted a thorough analysis of the target system's open ports │

│ and services, vulnerabilities, and operating system information. Here is my findings: Critical Score: │

│ The critical score for this target system is 7 out of 10. The system has several open ports that could │

│ potentially be exploited, including port 80 (HTTP), port 135 (RPC), and port 445 (Microsoft DS). While │

│ These ports are not necessarily vulnerable, they do indicate that the system is running services that │

│ could be targeted by attackers. Additionally, the system has an outdated version of Microsoft IIS │

│ running on port 80, which could be a potential vulnerability. OS Information: The target system is │

│ running Microsoft Windows 10 1607. Open Ports and Services: The target system has the following open │

│ ports: │

│ │

│ • Port 80: HTTP (Microsoft IIS httpd) │

│ • Port 135: RPC (Microsoft Windows RPC) │

│ • Port 445: Microsoft DS │

│ • Port 8000: Splunkd httpd All of these ports are currently open and have a state of "open". │

│ Vulnerable Services: Based on the CVEs found in the NMAP data, there are several potential │

│ vulnerabilities in the target system's services. These include: │

│ • CVE-2019-1489: An elevation of privilege vulnerability in Microsoft IIS that could be exploited by │

│ an attacker to gain control of the system. This vulnerability is related to the outdated version of │

│ Microsoft IIS running on port 80. │

│ • CVE-2017-0143: A remote code execution vulnerability in Microsoft Windows RPC that could be │

│ exploited by an attacker to execute arbitrary code on the target system. This vulnerability is │

│ related to the outdated version of Microsoft Windows RPC running on port 135. │

│ • CVE-2020-1362: A remote code execution vulnerability in Microsoft DS that could be exploited by an │

│ attacker to execute arbitrary code on the target system. This vulnerability is related to the │

│ outdated version of Microsoft DS running on port 445. Found CVEs: The following C │

│ │

╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯

ターゲットは jainuniversity.ac.in```table ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Elements ┃ Results ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ A │ 172.67.147.95", "104.21.41.132 │ │ AAA │ │ │ NS │ mia.ns.cloudflare.com.","paul.ns.cloudflare.com. │ │ MX │ 30 aspmx5.googlemail.com.","30 aspmx4.googlemail.com.","20 alt2.aspmx.l.google.com.","30 │ │ │ aspmx3.googlemail.com.","30 aspmx2.googlemail.com.","20 alt1.aspmx.l.google.com.","10 aspmx.l.google.com. │ │ PTR │ │ │ SOA │ mia.ns.cloudflare.com. dns.cloudflare.com. 2309618668 10000 2400 604800 3600 │ │ TXT │ atlassian-sending-domain-verification=5b358ce4-5ad3-404d-b4b4-005bf933603b","include:_spf.atlassian.net │ └──────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓

┃ Identifiers ┃ Data ┃

┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩

│ ip │ █████████████ │

│ continent_code │ AS │

│ continent_name │ Asia │

│ country_code2 │ IN │

│ country_code3 │ IND │

│ country_name │ India │

│ country_capital │ New Delhi │

│ state_prov │ Haryana │

│ state_code │ IN-HR │

│ district │ │

│ city │ Gurugram │

│ zipcode │ 122003 │

│ latitude │ 28.44324 │

│ longitude │ 77.05501 │

│ is_eu │ False │

│ calling_code │ +91 │

│ country_tld │ .in │

│ languages │ en-IN,hi,bn,te,mr,ta,ur,gu,kn,ml,or,pa,as,bh,sat,ks,ne,sd,kok,doi,mni,… │

│ country_flag │ │

│ geoname_id │ 9148991 │

│ isp │ Bharti Airtel Limited │

│ connection_type │ │

│ organization │ Bharti Airtel Limited │

│ currency.code │ INR │

│ currency.name │ Indian Rupee │

│ currency.symbol │ ₹ │

│ time_zone.name │ Asia/Kolkata │

│ time_zone.offset │ 5.5 │

│ time_zone.current_time │ 2023-07-11 17:08:35.057+0530 │

│ time_zone.current_time_unix │ 1689075515.057 │

│ time_zone.is_dst │ False │

│ time_zone.dst_savings │ 0 │

└─────────────────────────────┴─────────────────────────────────────────────────────────────────────────┘

Collecting Json Data Extracting IP details... Extracting DNS details... Extracting EAPOL details... Extracting TCP STREAMS details... TCP streams can take some time.. Total Streams combination: 252 Number of workers in progress: 250 Completed GVA Report for PCAP ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Identifiers ┃ Data ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ PacketAnalysis.Services │ ['49943', '49958', '49934', '49944', '49931', '443', '49957'] │ │ PacketAnalysis.TCP Streams │ ['1', '4', '5', '2', '0', '3'] │ │ PacketAnalysis.Sources Address │ ['█████████████', '1.1.1.1', '█████████████', '█████████████', '█████████████', '█████████████'] │ │ PacketAnalysis.Destination Address │ ['█████████████', '1.1.1.1', '█████████████', '█████████████', '█████████████', '█████████████'] │ │ PacketAnalysis.DNS Resolved │ [] │ │ PacketAnalysis.DNS Query │ ['oneclient.sfx.ms'] │ │ PacketAnalysis.DNS Response │ ['oneclient.sfx.ms.edgekey.net', 'e9659.dspg.akamaiedge.net', 'oneclient.sfx.ms'] │ │ PacketAnalysis.EAPOL Data │ [] │ │ PacketAnalysis. Total Streams Data │ 126 │ └────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘

Cracking... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

╭────────────────────────────────────────────── The GVA Password Cracker ──────────────────────────────────────────────╮ │ │ │ │

│ Password Cracked! Password: legion │

│ │

╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

GUIはコードの実行にcustomtkinterを使用しています。インターフェースはシンプルで、覚えておくべきことは以下だけです:

* dns attackを使用する際は、プロファイルを指定しないでください```bash python GVA_gui.py

![init](

![nmap](

![dns](

![geoip](

![pcap](

![subdomain](

![jwt](