ptn1411/skill/pentest-script-generator
Claude Code and agent skill by ptn1411/skill
- community
Checking that the SKILL.md file is still in the repository.
Tự động tạo pentest script và verify script từ báo cáo lỗ hổng Strix (vuln-XXXX.md). Kích hoạt khi người dùng đưa vào file vuln-XXXX.md, mô tả lỗ hổng bằng văn bản, dán raw HTTP request từ Burp Suite, hoặc nói 'viết script test', 'tạo pentest script', 'tạo verify script', 'generate test từ vuln'. Output: pentest_TYPE_vulnXXXX.py (TC-01..TC-N, cleanup, JSON export, dry-run) và verify_vulnXXXX.py (exit 0/1/2). Dùng cho authorized security research và bug bounty.
Install
npx vskill@latest install ptn1411/skill/pentest-script-generatorSKILL.md
Pentest Script Generator — SOP (Strix-native v2)
Generate two professional Python scripts for each vuln-XXXX.md report. Updated from analysis of 196 real-world vulnerabilities.
Language rule: All skill instructions and generated script code use English.Final summary presented to the user must be in Vietnamese.
Step 1 — Parse vuln-XXXX.md (Strix schema)
Schema produced by tracer.py → create_vulnerability_report():
Code Analysis ← optional, whitebox
Remediation
#!/usr/bin/env python3 """ ============================================================================ Penetration Test Script — vuln-XXXX — <title> Target : <target> Severity : <SEVERITY> | CVSS: <score> CWE : <CWE-NNN> ============================================================================ Description: <1-2 sentences>
Test Cases: TC-01: ... TC-0N: Cleanup
Usage: pip install requests colorama python pentest_TYPE_vulnXXXX.py [--base-url URL] [--dry-run] [--output-dir DIR]
⚠️ RUN ONLY ON AUTHORIZED TEST TARGETS ⚠️ ============================================================================ """ import argparse, json, os, time, sys from dataclasses import dataclass, field from datetime import datetime, timezone from enum import Enum from typing import Any, Optional
try: import requests; from requests.exceptions import RequestException except ImportError: print("[!] pip install requests"); sys.exit(1)
try: from colorama import Fore, Style, init as colorama_init; colorama_init(autoreset=True) except ImportError: class _Stub: def __getattr__(self, _): return "" Fore = Style = _Stub()
class Verdict(Enum): VULN="VULNERABLE"; SAFE="SAFE"; ERROR="ERROR"; INFO="INFO"; SKIP="SKIPPED"
@dataclass class TestResult: test_id: str; name: str; verdict: Verdict status_code: Optional[int]=None; detail: str="" response_preview: str=""; raw_response: Any=None timestamp: str=field(default_factory=lambda: datetime.now(timezone.utc).isoformat())
def _print_result(r: TestResult): c={Verdict.VULN:Fore.RED,Verdict.SAFE:Fore.GREEN,Verdict.ERROR:Fore.YELLOW, Verdict.INFO:Fore.BLUE,Verdict.SKIP:Fore.WHITE}.get(r.verdict,"") i={Verdict.VULN:"✗ VULNERABLE",Verdict.SAFE:"✓ SAFE",Verdict.ERROR:"⚠ ERROR", Verdict.INFO:"ℹ INFO",Verdict.SKIP:"⊘ SKIPPED"}.get(r.verdict,"?") print(f"\n{c}[{r.test_id}] {r.name}\n Result : {i}") if r.status_code: print(f" HTTP : {r.status_code}") if r.detail: print(f" Detail : {r.detail}") if r.response_preview: print(f" Response: {r.response_preview[:300]}")
def _summary(results, vuln_id): v=sum(1 for r in results if r.verdict==Verdict.VULN) s=sum(1 for r in results if r.verdict==Verdict.SAFE) e=sum(1 for r in results if r.verdict==Verdict.ERROR) print(f"\n{'═'*68}\n SUMMARY — {vuln_id}") for r in results: c=Fore.RED if r.verdict==Verdict.VULN else Fore.GREEN if r.verdict==Verdict.SAFE \ else Fore.YELLOW if r.verdict==Verdict.ERROR else Fore.BLUE print(f" {c}[{r.verdict.value:12s}] {r.test_id}: {r.name}") print(f"\n Vulnerable: {v} | Safe: {s} | Error: {e}") if v: print(f"\n {Fore.RED}⚠ CONCLUSION: VULNERABILITY CONFIRMED ({v} endpoint(s))")
def _export(results, vuln_id, target, output_dir): os.makedirs(output_dir, exist_ok=True) p = os.path.join(output_dir, f"pentest_{vuln_id}_report.json") with open(p,"w",encoding="utf-8") as f: json.dump({"vulnerability_id":vuln_id,"target":target, "timestamp":datetime.now(timezone.utc).isoformat(), "summary":{"total":len(results), "vulnerable":sum(1 for r in results if r.verdict==Verdict.VULN), "safe":sum(1 for r in results if r.verdict==Verdict.SAFE)}, "results":[{"test_id":r.test_id,"name":r.name,"verdict":r.verdict.value, "status_code":r.status_code,"detail":r.detail, "raw_response":r.raw_response,"timestamp":r.timestamp} for r in results]},f,indent=2,ensure_ascii=False,default=str) print(f"\n {Fore.CYAN}📄 Report: {p}")
TC-01: Register test account (recaptchaToken="" if bypass available) TC-02: Login → capture JWT access_token TC-03: Decode JWT → confirm role = "user" TC-04: Call admin endpoint with user token → expect 403; 200 = VULNERABLE TC-05: Control: call properly-enforced endpoint → confirm 403 TC-06: (IDOR) Swap resource ID to another user's resource TC-07: Cleanup
TC-01: GET endpoint with NO Authorization header → expect 401/403; 200 = VULNERABLE TC-02: GET with valid token → expect 200 (confirm endpoint functions) TC-03: GET with invalid token → expect 401
Supabase variant:
TC-01: GET /rest/v1/{table} with header "apikey: <anon_key>" → inspect returned data TC-02: No apikey header → expect 401
TC-01: Create order with original price → expect success (baseline) TC-02: Create order with price=1 (tampered) → if success = VULNERABLE TC-03: Create order with price=-1 (negative) → observe response TC-04: Cleanup — cancel created orders
TC-01: Check if confirm-payment endpoint requires valid payment token TC-02: POST confirm with arbitrary order_id → expect 403/404; 200 = VULNERABLE TC-03: Check order status after confirm TC-04: Cleanup
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcowork/pentest-script-generator/SKILL.md
Popularity
- Repository stars
- 150
- Repository forks
- 90
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ptn1411/skill/pentest-script-generator)