everything-gemini 2.2.0 → 2.7.0
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.
- package/BENCHMARK.md +33 -33
- package/CHANGELOG.md +84 -0
- package/README.md +91 -6
- package/agents/cross-repo-orchestrator.md +33 -0
- package/agents/darwin-prompt-engineer.md +35 -0
- package/agents/resilience-engineer.md +36 -0
- package/agents/swarm-coordinator.md +35 -0
- package/bin/everything-gemini +1175 -13
- package/docs/LAUNCH_KIT_PHP2SHELL.md +240 -0
- package/docs/LAUNCH_KIT_v2.4.0.md +164 -0
- package/docs/LAUNCH_KIT_v2.5.0.md +187 -0
- package/docs/LAUNCH_KIT_v2.6.0.md +174 -0
- package/docs/index.html +32 -14
- package/examples/python-sdk/cross_repo_swarm_and_compaction.py +175 -0
- package/examples/python-sdk/ephemeral_swarm_orchestration.py +169 -0
- package/examples/python-sdk/resilience_and_telemetry_pipeline.py +183 -0
- package/hooks/context-compactor/hooks.json +16 -0
- package/hooks/context-compactor/scripts/compact-context.sh +40 -0
- package/hooks/drift-detector/hooks.json +16 -0
- package/hooks/drift-detector/scripts/detect-drift.sh +50 -0
- package/hooks/thinking-budget/hooks.json +16 -0
- package/hooks/thinking-budget/scripts/budget-thinking.sh +56 -0
- package/package.json +1 -1
- package/skills/adversarial-fuzz-generator/SKILL.md +95 -0
- package/skills/context-distillation-compressor/SKILL.md +109 -0
- package/skills/cost-oracle-finops/SKILL.md +142 -0
- package/skills/cross-repo-swarm-sync/SKILL.md +122 -0
- package/skills/cve-remediation-orchestrator/SKILL.md +111 -0
- package/skills/cve-remediation-orchestrator/scripts/verify-host-hardening.sh +72 -0
- package/skills/dynamic-thinking-allocation/SKILL.md +105 -0
- package/skills/ebpf-microvm-sandbox/SKILL.md +113 -0
- package/skills/ebpf-sandbox-enforcer/SKILL.md +101 -0
- package/skills/envoy-ai-gateway/SKILL.md +175 -0
- package/skills/ephemeral-swarm-orchestrator/SKILL.md +124 -0
- package/skills/gemini-live-multimodal/SKILL.md +149 -0
- package/skills/gemini-live-screen-vision/SKILL.md +109 -0
- package/skills/genetic-prompt-cross-pollinator/SKILL.md +110 -0
- package/skills/harness3-mutation-testing/SKILL.md +120 -0
- package/skills/instinct-distillation-compiler/SKILL.md +103 -0
- package/skills/opentelemetry-agent-observability/SKILL.md +139 -0
- package/skills/php2shell-version-auditor/SKILL.md +95 -0
- package/skills/phpcheck-server/SKILL.md +102 -0
- package/skills/phpcheck-server/scripts/audit-server.sh +112 -0
- package/skills/phpcheck-url/SKILL.md +72 -0
- package/skills/phpcheck-url/scripts/phpcheck.js +160 -0
- package/skills/quantum-safe-cryptography/SKILL.md +84 -0
- package/skills/spanner-change-streams/SKILL.md +88 -0
- package/skills/speculative-decoding-orchestrator/SKILL.md +108 -0
- package/skills/vertex-ai-feature-store/SKILL.md +110 -0
- package/skills/webrtc-agent-gateway/SKILL.md +199 -0
- package/tests/cli.test.js +253 -14
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: php2shell-version-auditor
|
|
3
|
+
description: >-
|
|
4
|
+
Orchestrates end-to-end vulnerability auditing, fleet triage, and patch verification for PHP2Shell (CVE-2026-109618 and CVE-2026-109619). Use when assessing infrastructure exposure, performing non-intrusive remote banner audits, verifying local OS vendor backports, or validating web worker restarts.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PHP2Shell Vulnerability & Patch Auditor (`php2shell-version-auditor`)
|
|
8
|
+
|
|
9
|
+
An enterprise-grade, non-intrusive security auditor and fleet triage runbook for **PHP2Shell** (**CVE-2026-109618** and **CVE-2026-109619**), rated CVSS 9.2 (Critical Remote Code Execution and Memory Exposure).
|
|
10
|
+
|
|
11
|
+
## Vulnerability Overview
|
|
12
|
+
On October 21, 2026, the PHP core security team and upstream maintainers disclosed two critical vulnerabilities affecting standard PHP runtimes across all unpatched branches:
|
|
13
|
+
- **CVE-2026-109618**: Remote memory corruption and execution vulnerability in stream handling and buffer boundaries.
|
|
14
|
+
- **CVE-2026-109619**: Out-of-bounds read and memory disclosure enabling authorization bypass or remote execution.
|
|
15
|
+
|
|
16
|
+
Upstream patched releases: **8.2.35**, **8.3.36**, **8.4.27**, and **8.5.12**. Older unmaintained branches (5.4–5.6, 7.0–7.4, 8.0, 8.1) are inherently vulnerable unless protected by vendor enterprise backports (Ubuntu Pro, Red Hat ELS).
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Defensive Triage Lifecycle
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
graph TD
|
|
24
|
+
A[Triage Target Identified] --> B{Server Access Available?}
|
|
25
|
+
B -- No / External Audit --> C[Run phpcheck-url Remote Audit]
|
|
26
|
+
C --> D{Disclosed PHP Version?}
|
|
27
|
+
D -- Version < Fixed --> E[POTENTIALLY VULNERABLE Flagged]
|
|
28
|
+
D -- Version >= Fixed --> F[OK - Remote Banner Patched]
|
|
29
|
+
D -- Hidden / Stripped --> G[UNKNOWN - Inspect Server Internals]
|
|
30
|
+
|
|
31
|
+
B -- Yes / Host Access --> H[Run phpcheck-server Deep Audit]
|
|
32
|
+
H --> I[Check OS Vendor Package Revisions]
|
|
33
|
+
H --> J[Inspect Active /proc/*/exe for Deleted Binaries]
|
|
34
|
+
I --> K{Vendor Advisory Met?}
|
|
35
|
+
K -- Yes --> L{Workers Restarted?}
|
|
36
|
+
K -- No --> M[CRITICAL: Upgrade Packages Immediately]
|
|
37
|
+
L -- Yes --> N[VERIFIED SECURE]
|
|
38
|
+
L -- No --> O[HIGH RISK: Restart PHP-FPM / Apache Daemons]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Sub-Skills & Components
|
|
44
|
+
This skill coordinates two specialized audit sub-skills:
|
|
45
|
+
1. [phpcheck-url](file:///Users/salmanshaikh/development/github/everything-gemini/skills/phpcheck-url/SKILL.md): Fast, non-intrusive HTTP header scanner for remote websites and API gateways.
|
|
46
|
+
2. [phpcheck-server](file:///Users/salmanshaikh/development/github/everything-gemini/skills/phpcheck-server/SKILL.md): Host and container scanner checking `dpkg`/`rpm` package revisions and running memory process states.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Zero-Install Audit Commands
|
|
51
|
+
|
|
52
|
+
### Remote Target Audit
|
|
53
|
+
```bash
|
|
54
|
+
# Terminal execution via Everything Gemini CLI
|
|
55
|
+
everything-gemini phpcheck "https://example.com"
|
|
56
|
+
|
|
57
|
+
# JSON telemetry output for automated CI/CD pipelines
|
|
58
|
+
everything-gemini phpcheck "https://example.com" --json
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Server / Container Fleet Audit
|
|
62
|
+
```bash
|
|
63
|
+
# Run server audit
|
|
64
|
+
everything-gemini phpcheck --server
|
|
65
|
+
|
|
66
|
+
# Or run the native shell script
|
|
67
|
+
bash skills/phpcheck-server/scripts/audit-server.sh
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Remediation Checklist
|
|
73
|
+
|
|
74
|
+
1. **Update Packages**:
|
|
75
|
+
- Ubuntu / Debian: `sudo apt update && sudo apt install --only-upgrade php*-fpm php*-cli libapache2-mod-php*`
|
|
76
|
+
- RHEL / Rocky / Alma: `sudo dnf update php\*`
|
|
77
|
+
2. **Restart Daemons (Mandatory)**:
|
|
78
|
+
```bash
|
|
79
|
+
sudo systemctl restart 'php*-fpm'
|
|
80
|
+
sudo systemctl restart apache2 || sudo systemctl restart nginx
|
|
81
|
+
```
|
|
82
|
+
3. **Verify Active Process RAM**:
|
|
83
|
+
```bash
|
|
84
|
+
ls -l /proc/*/exe 2>/dev/null | grep -E '(php|apache|httpd).*\(deleted\)'
|
|
85
|
+
# Must return 0 lines!
|
|
86
|
+
```
|
|
87
|
+
4. **Harden HTTP Headers**:
|
|
88
|
+
In `php.ini`, set:
|
|
89
|
+
```ini
|
|
90
|
+
expose_php = Off
|
|
91
|
+
```
|
|
92
|
+
In `nginx.conf`:
|
|
93
|
+
```nginx
|
|
94
|
+
server_tokens off;
|
|
95
|
+
```
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: phpcheck-server
|
|
3
|
+
description: >-
|
|
4
|
+
Audits local server, host OS, containers, and running PHP-FPM or Apache processes for PHP2Shell vulnerabilities (CVE-2026-109618 and CVE-2026-109619). Use when verifying host packages, distribution backports, and active web worker process restarts across Debian, Ubuntu, RHEL, or Alpine.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PHP2Shell Server-Side Patch Auditor (`phpcheck-server`)
|
|
8
|
+
|
|
9
|
+
Provides comprehensive host-level and container-level auditing runbooks to verify remediation of the critical PHP2Shell vulnerabilities (**CVE-2026-109618** and **CVE-2026-109619**).
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
- When you have SSH, terminal, or container access to web servers running PHP.
|
|
13
|
+
- When verifying whether an `apt upgrade` or `dnf update` actually remediated the vulnerability or if running PHP-FPM / Apache workers are still executing vulnerable unlinked binaries in RAM.
|
|
14
|
+
- When validating vendor-specific security backports on LTS distributions (Debian, Ubuntu Pro, RHEL).
|
|
15
|
+
|
|
16
|
+
## Automated Server Audit Script
|
|
17
|
+
Execute the included server audit helper:
|
|
18
|
+
```bash
|
|
19
|
+
bash skills/phpcheck-server/scripts/audit-server.sh
|
|
20
|
+
bash skills/phpcheck-server/scripts/audit-server.sh --json
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or via Everything Gemini CLI:
|
|
24
|
+
```bash
|
|
25
|
+
everything-gemini phpcheck --server
|
|
26
|
+
everything-gemini phpcheck --server --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step-by-Step Triage Runbook
|
|
32
|
+
|
|
33
|
+
### Step 1: Identify the Active Serving Runtime
|
|
34
|
+
Do not rely solely on the CLI binary (`php -v`), as the CLI binary often differs from the active worker pool (PHP-FPM, Apache `mod_php`, or Docker container).
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Check running FPM or web server processes
|
|
38
|
+
ps aux | grep -E 'php-fpm|apache2|httpd'
|
|
39
|
+
|
|
40
|
+
# Identify exact binary path for running worker
|
|
41
|
+
ls -l /proc/$(pgrep -f php-fpm | head -n1)/exe
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 2: Check for the "Unlinked Worker" RAM Trap
|
|
45
|
+
If packages were upgraded on disk while daemons remained running, worker processes continue executing vulnerable code from RAM:
|
|
46
|
+
```bash
|
|
47
|
+
# Detect processes holding deleted shared libraries or binaries
|
|
48
|
+
ls -l /proc/*/exe 2>/dev/null | grep -E '(php|apache|httpd).*\(deleted\)'
|
|
49
|
+
```
|
|
50
|
+
If output is returned, you **must immediately restart the worker pool**:
|
|
51
|
+
```bash
|
|
52
|
+
sudo systemctl restart 'php*-fpm' || sudo systemctl restart apache2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Vendor Fixed Package Matrix
|
|
58
|
+
|
|
59
|
+
### 1. Debian
|
|
60
|
+
Use `dpkg-query -W -f='${Package} ${Version}\n' 'php*'` to inspect installed packages.
|
|
61
|
+
|
|
62
|
+
| Debian Release | PHP Package | Fixed Package Version | Advisory |
|
|
63
|
+
| :--- | :--- | :--- | :--- |
|
|
64
|
+
| Debian 12 (bookworm) | `php8.2-fpm` | `8.2.35-1~deb12u1` | [DLA-4848-1](https://security-tracker.debian.org/tracker/DLA-4848-1) |
|
|
65
|
+
| Debian 13 (trixie) | `php8.4-fpm` | `8.4.27-1~deb13u1` | [DSA-6574-1](https://security-tracker.debian.org/tracker/DSA-6574-1) |
|
|
66
|
+
|
|
67
|
+
### 2. Ubuntu
|
|
68
|
+
Use `dpkg-query` to verify package revisions against Canonical Security Notices:
|
|
69
|
+
|
|
70
|
+
| Ubuntu Release | PHP Package | Fixed Package Version | Advisory |
|
|
71
|
+
| :--- | :--- | :--- | :--- |
|
|
72
|
+
| Ubuntu 26.10 | `php8.5` | `8.5.9-0ubuntu2.1` | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
|
|
73
|
+
| Ubuntu 26.04 LTS | `php8.5` | `8.5.4-0ubuntu1.5` | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
|
|
74
|
+
| Ubuntu 24.04 LTS | `php8.3` | `8.3.6-0ubuntu0.24.04.13` | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
|
|
75
|
+
| Ubuntu 22.04 LTS | `php8.1` | `8.1.2-1ubuntu2.28` | [USN-8948-1](https://ubuntu.com/security/notices/USN-8948-1) |
|
|
76
|
+
| Ubuntu 20.04 LTS (Pro) | `php7.4` | `7.4.3-4ubuntu2.29+esm5` | [USN-8948-2](https://ubuntu.com/security/notices/USN-8948-2) |
|
|
77
|
+
| Ubuntu 18.04 LTS (Pro) | `php7.2` | `7.2.24-0ubuntu0.18.04.17+esm14`| [USN-8948-2](https://ubuntu.com/security/notices/USN-8948-2) |
|
|
78
|
+
| Ubuntu 16.04 LTS (Pro) | `php7.0` | `7.0.33-0ubuntu0.16.04.16+esm22`| [USN-8948-2](https://ubuntu.com/security/notices/USN-8948-2) |
|
|
79
|
+
| Ubuntu 14.04 LTS (Pro) | `php5` | `5.5.9+dfsg-1ubuntu4.29+esm18` | [USN-8948-2](https://ubuntu.com/security/notices/USN-8948-2) |
|
|
80
|
+
|
|
81
|
+
### 3. Red Hat Enterprise Linux (RHEL / CentOS / Rocky)
|
|
82
|
+
Use `rpm -q --queryformat '%{NAME} %{EPOCHNUM}:%{VERSION}-%{RELEASE}.%{ARCH} %{VENDOR}\n' <package>`:
|
|
83
|
+
|
|
84
|
+
| RHEL Release & Stream | Fixed Package Version | Advisory |
|
|
85
|
+
| :--- | :--- | :--- |
|
|
86
|
+
| RHEL 8.10 (PHP 7.4 stream) | `7.4.33-8.module+el8.10.0+25117+30337cca` | [RHSA-2026:87080](https://access.redhat.com/errata/RHSA-2026:87080) |
|
|
87
|
+
| RHEL 9.8 (PHP 8.0 stream) | `8.0.30-8.el9_8.1` | [RHSA-2026:87151](https://access.redhat.com/errata/RHSA-2026:87151) |
|
|
88
|
+
|
|
89
|
+
### 4. Upstream Source Builds & Docker Images
|
|
90
|
+
For custom builds or official Docker containers (`php:8.3-fpm`, `php:8.2-apache`), ensure the source release meets:
|
|
91
|
+
- **PHP 8.2**: `8.2.35+`
|
|
92
|
+
- **PHP 8.3**: `8.3.36+`
|
|
93
|
+
- **PHP 8.4**: `8.4.27+`
|
|
94
|
+
- **PHP 8.5**: `8.5.12+`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Post-Remediation Verification Checklist
|
|
99
|
+
- [ ] Operating system packages updated to or above vendor advisory revision.
|
|
100
|
+
- [ ] Web worker service (`php-fpm`, `apache2`, `caddy`) cleanly restarted.
|
|
101
|
+
- [ ] No `(deleted)` references remain in `/proc/*/exe` or `lsof`.
|
|
102
|
+
- [ ] Remote banner verified using [phpcheck-url](file:///Users/salmanshaikh/development/github/everything-gemini/skills/phpcheck-url/SKILL.md) or sanitized to omit verbose version disclosures.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# PHP2Shell Server-Side Audit Script
|
|
4
|
+
# Audits local server, host OS, containers, and running PHP-FPM / Apache processes
|
|
5
|
+
# for CVE-2026-109618 and CVE-2026-109619.
|
|
6
|
+
|
|
7
|
+
set -eo pipefail
|
|
8
|
+
|
|
9
|
+
JSON_MODE=false
|
|
10
|
+
if [[ "$1" == "--json" ]]; then
|
|
11
|
+
JSON_MODE=true
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
# Detect OS
|
|
15
|
+
OS_NAME="unknown"
|
|
16
|
+
OS_VERSION="unknown"
|
|
17
|
+
if [ -f /etc/os-release ]; then
|
|
18
|
+
# shellcheck source=/dev/null
|
|
19
|
+
. /etc/os-release
|
|
20
|
+
OS_NAME="${ID:-unknown}"
|
|
21
|
+
OS_VERSION="${VERSION_ID:-unknown}"
|
|
22
|
+
elif command -v sw_vers >/dev/null 2>&1; then
|
|
23
|
+
OS_NAME="macos"
|
|
24
|
+
OS_VERSION="$(sw_vers -productVersion)"
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Check PHP binary on PATH
|
|
28
|
+
PHP_CLI_VERSION="none"
|
|
29
|
+
if command -v php >/dev/null 2>&1; then
|
|
30
|
+
PHP_CLI_VERSION="$(php -r 'echo PHP_VERSION;' 2>/dev/null || php -v 2>/dev/null | head -n1 | awk '{print $2}' || echo "unknown")"
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Check running processes
|
|
34
|
+
RUNNING_PHP_PROCS=""
|
|
35
|
+
if command -v pgrep >/dev/null 2>&1; then
|
|
36
|
+
RUNNING_PHP_PROCS="$(pgrep -a -f 'php-fpm|apache2|httpd|php' 2>/dev/null || true)"
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
# Check for un-restarted upgraded binaries (deleted from disk but in RAM)
|
|
40
|
+
DELETED_PROCESSES=""
|
|
41
|
+
if [ -d /proc ]; then
|
|
42
|
+
DELETED_PROCESSES="$(ls -l /proc/*/exe 2>/dev/null | grep -E '(php|apache|httpd).*\(deleted\)' || true)"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
STATUS="unknown"
|
|
46
|
+
DETAILS="No active PHP packages or processes detected on server."
|
|
47
|
+
|
|
48
|
+
if [ "$PHP_CLI_VERSION" != "none" ]; then
|
|
49
|
+
# Parse major.minor.patch
|
|
50
|
+
MAJOR="$(echo "$PHP_CLI_VERSION" | cut -d. -f1)"
|
|
51
|
+
MINOR="$(echo "$PHP_CLI_VERSION" | cut -d. -f2)"
|
|
52
|
+
PATCH="$(echo "$PHP_CLI_VERSION" | cut -d. -f3 | sed 's/[^0-9].*//')"
|
|
53
|
+
BRANCH="${MAJOR}.${MINOR}"
|
|
54
|
+
|
|
55
|
+
if [[ "$BRANCH" =~ ^(5\.|7\.|8\.0|8\.1) ]]; then
|
|
56
|
+
STATUS="potentially_vulnerable"
|
|
57
|
+
DETAILS="PHP $PHP_CLI_VERSION belongs to an EOL branch. Check if vendor security backports (USN/RHSA) are installed."
|
|
58
|
+
elif [[ "$BRANCH" == "8.2" && "$PATCH" -ge 35 ]]; then
|
|
59
|
+
STATUS="ok"
|
|
60
|
+
DETAILS="PHP $PHP_CLI_VERSION meets or exceeds upstream fixed release 8.2.35."
|
|
61
|
+
elif [[ "$BRANCH" == "8.3" && "$PATCH" -ge 36 ]]; then
|
|
62
|
+
STATUS="ok"
|
|
63
|
+
DETAILS="PHP $PHP_CLI_VERSION meets or exceeds upstream fixed release 8.3.36."
|
|
64
|
+
elif [[ "$BRANCH" == "8.4" && "$PATCH" -ge 27 ]]; then
|
|
65
|
+
STATUS="ok"
|
|
66
|
+
DETAILS="PHP $PHP_CLI_VERSION meets or exceeds upstream fixed release 8.4.27."
|
|
67
|
+
elif [[ "$BRANCH" == "8.5" && "$PATCH" -ge 12 ]]; then
|
|
68
|
+
STATUS="ok"
|
|
69
|
+
DETAILS="PHP $PHP_CLI_VERSION meets or exceeds upstream fixed release 8.5.12."
|
|
70
|
+
elif [[ "$BRANCH" =~ ^8\.[2345] ]]; then
|
|
71
|
+
STATUS="potentially_vulnerable"
|
|
72
|
+
DETAILS="PHP $PHP_CLI_VERSION is below upstream fix for branch $BRANCH."
|
|
73
|
+
fi
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
if [ -n "$DELETED_PROCESSES" ]; then
|
|
77
|
+
DETAILS="$DETAILS [CRITICAL WARNING: Running processes reference unlinked/deleted binaries. Web workers must be restarted: systemctl restart php*-fpm]"
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
if [ "$JSON_MODE" = true ]; then
|
|
81
|
+
cat <<EOF
|
|
82
|
+
{
|
|
83
|
+
"cves": ["CVE-2026-109618", "CVE-2026-109619"],
|
|
84
|
+
"os_id": "$OS_NAME",
|
|
85
|
+
"os_version": "$OS_VERSION",
|
|
86
|
+
"php_cli_version": "$PHP_CLI_VERSION",
|
|
87
|
+
"patch_status": "$STATUS",
|
|
88
|
+
"details": "$DETAILS",
|
|
89
|
+
"stale_memory_workers_detected": $([ -n "$DELETED_PROCESSES" ] && echo true || echo false)
|
|
90
|
+
}
|
|
91
|
+
EOF
|
|
92
|
+
else
|
|
93
|
+
echo "🛡️ PHP2Shell Server Security Audit"
|
|
94
|
+
echo "=================================="
|
|
95
|
+
echo "OS Distribution: $OS_NAME $OS_VERSION"
|
|
96
|
+
echo "PHP CLI Version: $PHP_CLI_VERSION"
|
|
97
|
+
echo "Patch Status: $STATUS"
|
|
98
|
+
echo "Audit Details: $DETAILS"
|
|
99
|
+
if [ -n "$DELETED_PROCESSES" ]; then
|
|
100
|
+
echo ""
|
|
101
|
+
echo "⚠️ ALERT: Un-restarted worker processes detected!"
|
|
102
|
+
echo "Run: sudo systemctl restart 'php*-fpm' or sudo systemctl restart apache2"
|
|
103
|
+
fi
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
if [ "$STATUS" = "ok" ]; then
|
|
107
|
+
exit 0
|
|
108
|
+
elif [ "$STATUS" = "potentially_vulnerable" ]; then
|
|
109
|
+
exit 1
|
|
110
|
+
else
|
|
111
|
+
exit 3
|
|
112
|
+
fi
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: phpcheck-url
|
|
3
|
+
description: >-
|
|
4
|
+
Inspects remote website HTTP headers (Server, X-Powered-By) to audit advertised PHP versions for PHP2Shell vulnerabilities (CVE-2026-109618 and CVE-2026-109619). Use when assessing external web endpoints or public URLs without server access.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PHP2Shell URL Version Checker (`phpcheck-url`)
|
|
8
|
+
|
|
9
|
+
A non-intrusive, zero-exploit defensive auditing skill that verifies whether a remote HTTP/HTTPS target advertises a PHP runtime affected by the critical PHP2Shell vulnerabilities (**CVE-2026-109618** and **CVE-2026-109619**).
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
- When auditing public web assets, domains, or client applications for exposed, unpatched PHP versions.
|
|
13
|
+
- When performing pre-flight security reconnaissance prior to full credentialed server audits.
|
|
14
|
+
- When verifying if reverse proxy headers (`Server`, `X-Powered-By`) expose outdated PHP banners.
|
|
15
|
+
|
|
16
|
+
## How It Works
|
|
17
|
+
1. Issues a non-intrusive `HEAD` request (falling back to `GET` only on HTTP 405 Method Not Allowed or 501 Not Implemented).
|
|
18
|
+
2. Parses `Server` and `X-Powered-By` response headers for PHP version strings.
|
|
19
|
+
3. Compares the advertised version against upstream patch releases and known end-of-life branches:
|
|
20
|
+
- **Fixed Upstream Releases**: `8.2.35`, `8.3.36`, `8.4.27`, `8.5.12`
|
|
21
|
+
- **Vulnerable EOL Branches**: `5.4`, `5.5`, `5.6`, `7.0`, `7.1`, `7.2`, `7.3`, `7.4`, `8.0`, `8.1`
|
|
22
|
+
4. Returns standardized exit codes and diagnostic JSON reports.
|
|
23
|
+
|
|
24
|
+
> [!IMPORTANT]
|
|
25
|
+
> This skill is strictly defensive and does **not** send exploit payloads, memory-corrupting packets, or crash probes. An `OK` header status indicates an advertised patched version, but server-side verification using [phpcheck-server](file:///Users/salmanshaikh/development/github/everything-gemini/skills/phpcheck-server/SKILL.md) is necessary to confirm active worker binaries.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Run via Everything Gemini CLI
|
|
30
|
+
```bash
|
|
31
|
+
everything-gemini phpcheck "https://example.com"
|
|
32
|
+
everything-gemini phpcheck "https://example.com" --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Run Script Directly
|
|
36
|
+
```bash
|
|
37
|
+
node skills/phpcheck-url/scripts/phpcheck.js "https://example.com"
|
|
38
|
+
node skills/phpcheck-url/scripts/phpcheck.js "https://example.com" --json --timeout 15
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Exit Codes & Output Contract
|
|
42
|
+
|
|
43
|
+
| Exit Code | Result | Meaning |
|
|
44
|
+
| :--- | :--- | :--- |
|
|
45
|
+
| `0` | `OK` | Advertised version meets or exceeds an upstream fixed release (`8.2.35`, `8.3.36`, `8.4.27`, `8.5.12`). |
|
|
46
|
+
| `1` | `POTENTIALLY VULNERABLE` | Advertised version is lower than upstream fix or belongs to an EOL branch (5.x, 7.x, 8.0, 8.1). |
|
|
47
|
+
| `2` | `ERROR` | Invalid arguments, syntax error, or unsupported scheme. |
|
|
48
|
+
| `3` | `UNKNOWN` | Headers do not disclose a PHP version, headers are stripped/hidden, or request timed out. |
|
|
49
|
+
|
|
50
|
+
## JSON Output Structure
|
|
51
|
+
When executed with `--json`, the script returns structured telemetry:
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"cves": ["CVE-2026-109618", "CVE-2026-109619"],
|
|
55
|
+
"target": "https://example.com",
|
|
56
|
+
"patch_status": "potentially_vulnerable",
|
|
57
|
+
"php_version": "8.1.2",
|
|
58
|
+
"reason": "PHP 8.1.2: Potentially vulnerable. HTTP headers cannot verify whether backported security patches exist. Check server package directly.",
|
|
59
|
+
"fixed_upstream_releases": {
|
|
60
|
+
"8.2": 35,
|
|
61
|
+
"8.3": 36,
|
|
62
|
+
"8.4": 27,
|
|
63
|
+
"8.5": 12
|
|
64
|
+
},
|
|
65
|
+
"exit_code": 1
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Related Skills
|
|
70
|
+
- [phpcheck-server](file:///Users/salmanshaikh/development/github/everything-gemini/skills/phpcheck-server/SKILL.md) - Deep server-side package, worker, and container patch verification.
|
|
71
|
+
- [php2shell-version-auditor](file:///Users/salmanshaikh/development/github/everything-gemini/skills/php2shell-version-auditor/SKILL.md) - Master triage runbook for enterprise fleets.
|
|
72
|
+
- [security-audit](file:///Users/salmanshaikh/development/github/everything-gemini/skills/security-audit/SKILL.md) - General code, dependency, and vulnerability analysis.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PHP2Shell Version Checker Script
|
|
5
|
+
* Non-intrusive banner and version auditor for PHP2Shell (CVE-2026-109618 / CVE-2026-109619)
|
|
6
|
+
* Based on OpenAI php2shell-checker (Apache-2.0)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { parseArgs } = require('node:util');
|
|
10
|
+
|
|
11
|
+
const VERSION = '1.0.0';
|
|
12
|
+
// Official PHP upstream releases fixing both CVE-2026-109618 and CVE-2026-109619 (published 2026-10-21)
|
|
13
|
+
const FIXED_IN = { '8.2': 35, '8.3': 36, '8.4': 27, '8.5': 12 };
|
|
14
|
+
const OLDER_BRANCHES = new Set(['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']);
|
|
15
|
+
const USAGE = 'Usage: node phpcheck.js URL [--timeout SECONDS] [--json]\n' +
|
|
16
|
+
' node phpcheck.js --version\n' +
|
|
17
|
+
' node phpcheck.js --help';
|
|
18
|
+
|
|
19
|
+
function versionStatus(version) {
|
|
20
|
+
const match = /^(\d+)\.(\d+)\.(\d+)([-+~].*)?$/.exec(version || '');
|
|
21
|
+
if (!match) return 'unknown';
|
|
22
|
+
if (/(?:^|[-+~.])(?:dev|alpha|beta|rc)/i.test(match[4] || '')) return 'unknown';
|
|
23
|
+
const branch = `${Number(match[1])}.${Number(match[2])}`;
|
|
24
|
+
if (OLDER_BRANCHES.has(branch)) return 'potentially_vulnerable';
|
|
25
|
+
const fixed = FIXED_IN[branch];
|
|
26
|
+
if (fixed === undefined) return 'unknown';
|
|
27
|
+
if (Number(match[3]) < fixed) return 'potentially_vulnerable';
|
|
28
|
+
return 'ok';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function urlHeaders(address, timeout) {
|
|
32
|
+
if (/[\x00-\x20\x7f]/.test(address)) throw new Error('URL contains spaces or control characters');
|
|
33
|
+
let targetUrl = address;
|
|
34
|
+
if (!/^https?:\/\//i.test(targetUrl)) {
|
|
35
|
+
targetUrl = 'https://' + targetUrl;
|
|
36
|
+
}
|
|
37
|
+
const url = new URL(targetUrl);
|
|
38
|
+
if (!['http:', 'https:'].includes(url.protocol)) throw new Error('Use an http:// or https:// URL');
|
|
39
|
+
if (url.username || url.password || url.hash) throw new Error('URL credentials and fragments are not supported');
|
|
40
|
+
|
|
41
|
+
const headers = [];
|
|
42
|
+
for (const method of ['HEAD', 'GET']) {
|
|
43
|
+
try {
|
|
44
|
+
const response = await fetch(url, {
|
|
45
|
+
method,
|
|
46
|
+
redirect: 'manual',
|
|
47
|
+
signal: AbortSignal.timeout(Math.ceil(timeout * 1000)),
|
|
48
|
+
headers: {
|
|
49
|
+
'User-Agent': 'everything-gemini-phpcheck/1.0 (+https://github.com/salmandev/everything-gemini)'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
headers.push(response.headers.get('server') || '', response.headers.get('x-powered-by') || '');
|
|
53
|
+
await response.body?.cancel();
|
|
54
|
+
if (![405, 501].includes(response.status)) break;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
if (method === 'HEAD') continue;
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return headers.join('\n');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function runPhpCheck(argv = process.argv.slice(2)) {
|
|
64
|
+
let values, address, timeout;
|
|
65
|
+
try {
|
|
66
|
+
const args = parseArgs({
|
|
67
|
+
args: argv,
|
|
68
|
+
allowPositionals: true,
|
|
69
|
+
options: {
|
|
70
|
+
timeout: { type: 'string', default: '10' },
|
|
71
|
+
json: { type: 'boolean' },
|
|
72
|
+
version: { type: 'boolean' },
|
|
73
|
+
help: { type: 'boolean', short: 'h' },
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
values = args.values;
|
|
77
|
+
if (values.version) {
|
|
78
|
+
console.log(VERSION);
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
if (values.help) {
|
|
82
|
+
console.log(USAGE);
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
address = args.positionals[0];
|
|
86
|
+
if (!address || args.positionals.length !== 1) {
|
|
87
|
+
throw new Error('Provide exactly one URL or hostname');
|
|
88
|
+
}
|
|
89
|
+
timeout = Number(values.timeout);
|
|
90
|
+
if (!(timeout > 0 && timeout <= 60)) {
|
|
91
|
+
throw new Error('--timeout must be greater than 0 and at most 60 seconds');
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error(error.message + '\n' + USAGE);
|
|
95
|
+
process.exitCode = 2;
|
|
96
|
+
return 2;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let version = null;
|
|
100
|
+
let error = null;
|
|
101
|
+
let status = 'unknown';
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const text = await urlHeaders(address, timeout);
|
|
105
|
+
for (const match of text.matchAll(/\bPHP[ /]([^\s,;)]+)/gi)) {
|
|
106
|
+
const candidateStatus = versionStatus(match[1]);
|
|
107
|
+
if (version === null || candidateStatus === 'potentially_vulnerable' || status === 'ok') {
|
|
108
|
+
version = match[1];
|
|
109
|
+
status = candidateStatus;
|
|
110
|
+
}
|
|
111
|
+
if (status === 'potentially_vulnerable') break;
|
|
112
|
+
}
|
|
113
|
+
} catch (exc) {
|
|
114
|
+
error = exc.message;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let result = { patch_status: 'unknown', reason: error || 'PHP version not found in HTTP response headers (Server, X-Powered-By)' };
|
|
118
|
+
if (version && !error) {
|
|
119
|
+
result = {
|
|
120
|
+
patch_status: status,
|
|
121
|
+
reason: status === 'ok'
|
|
122
|
+
? `PHP ${version}: Advertised version meets an upstream fixed release (8.2.35, 8.3.36, 8.4.27, 8.5.12). Installed binary build not verified.`
|
|
123
|
+
: `PHP ${version}: ${status === 'potentially_vulnerable' ? 'Potentially vulnerable. ' : ''}` +
|
|
124
|
+
'HTTP headers cannot verify whether backported security patches exist. Check server package directly.',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const code = { ok: 0, potentially_vulnerable: 1, unknown: 3 }[result.patch_status];
|
|
129
|
+
const report = {
|
|
130
|
+
cves: ['CVE-2026-109618', 'CVE-2026-109619'],
|
|
131
|
+
target: address,
|
|
132
|
+
patch_status: result.patch_status,
|
|
133
|
+
php_version: version,
|
|
134
|
+
reason: result.reason,
|
|
135
|
+
fixed_upstream_releases: FIXED_IN,
|
|
136
|
+
exit_code: code
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
if (values.json) {
|
|
140
|
+
console.log(JSON.stringify(report, null, 2));
|
|
141
|
+
} else {
|
|
142
|
+
const statusLabel = result.patch_status.replace('_', ' ').toUpperCase();
|
|
143
|
+
console.log(`${statusLabel}: ${result.reason}`);
|
|
144
|
+
if (result.patch_status === 'potentially_vulnerable') {
|
|
145
|
+
console.log('\nRemediation: Upgrade PHP to a patched vendor release or upstream (8.2.35+, 8.3.36+, 8.4.27+, 8.5.12+), and restart php-fpm or web server.');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
process.exitCode = code;
|
|
150
|
+
return code;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (require.main === module) {
|
|
154
|
+
runPhpCheck().catch(err => {
|
|
155
|
+
console.error('Fatal error:', err.message);
|
|
156
|
+
process.exit(2);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
module.exports = { runPhpCheck, versionStatus, FIXED_IN, OLDER_BRANCHES };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quantum-safe-cryptography
|
|
3
|
+
description: Implements NIST FIPS 203/204 Post-Quantum Cryptography (PQC) algorithms, hybrid TLS 1.3 key exchange, and quantum-resistant API authentication.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Quantum-Safe Cryptography & Post-Quantum Cryptography (PQC)
|
|
7
|
+
|
|
8
|
+
Implements NIST Post-Quantum Cryptography standards (FIPS 203 ML-KEM / Kyber, FIPS 204 ML-DSA / Dilithium), hybrid classical-quantum TLS 1.3 key exchanges, and quantum-resistant authentication token signing for enterprise Gemini agent communications.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Architecture: Post-Quantum Security for AI Agents
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
16
|
+
│ HYBRID POST-QUANTUM SECURITY PIPELINE │
|
|
17
|
+
│ │
|
|
18
|
+
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
19
|
+
│ │ 1. Agent Handshake & Mutual Authentication (mTLS 1.3) │ │
|
|
20
|
+
│ │ • Classical: X25519 or ECDH (P-256) │ │
|
|
21
|
+
│ │ • Post-Quantum: ML-KEM-768 (Module-Lattice KEM / Kyber) │ │
|
|
22
|
+
│ │ • Combined Shared Secret = KDF(Classical_SS || PQC_SS) │ │
|
|
23
|
+
│ └──────────────────────────────────┬──────────────────────────────────┘ │
|
|
24
|
+
│ │ │
|
|
25
|
+
│ ▼ │
|
|
26
|
+
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
27
|
+
│ │ 2. Quantum-Resistant Agent Token Signing (ML-DSA / Dilithium) │ │
|
|
28
|
+
│ │ • Ephemeral agent delegation tokens signed via FIPS 204 │ │
|
|
29
|
+
│ │ • Immune to Shor's algorithm and "Harvest Now, Decrypt Later" │ │
|
|
30
|
+
│ └──────────────────────────────────┬──────────────────────────────────┘ │
|
|
31
|
+
│ │ │
|
|
32
|
+
│ ▼ │
|
|
33
|
+
│ ┌─────────────────────────────────────────────────────────────────────┐ │
|
|
34
|
+
│ │ 3. Cloud KMS & Google Cloud Hybrid Integration │ │
|
|
35
|
+
│ │ • Google Cloud Certificate Authority Service (CAS) PQC roots │ │
|
|
36
|
+
│ │ • Vertex AI / Cloud Run encrypted ingress via X25519Kyber768 │ │
|
|
37
|
+
│ └─────────────────────────────────────────────────────────────────────┘ │
|
|
38
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 2. NIST Standardized PQC Specifications
|
|
44
|
+
|
|
45
|
+
| Standard | Algorithm Name | Purpose | Classical Equivalent | Key/Sig Sizes |
|
|
46
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
47
|
+
| **FIPS 203** | **ML-KEM-768** (Kyber) | Key Encapsulation (KEM) | RSA 3072 / ECDH P-256 | Public Key: 1,184 B, Ciphertext: 1,088 B |
|
|
48
|
+
| **FIPS 204** | **ML-DSA-65** (Dilithium) | Digital Signatures | ECDSA P-256 / Ed25519 | Public Key: 1,952 B, Signature: 3,309 B |
|
|
49
|
+
| **FIPS 205** | **SLH-DSA-128s** (SPHINCS+) | Stateless Hash-Based Signatures | Fallback Digital Signatures | Public Key: 32 B, Signature: 7,856 B |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 3. Node.js & Web Cryptography Implementation
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import crypto from 'node:crypto';
|
|
57
|
+
|
|
58
|
+
// Verify runtime supports hybrid post-quantum cipher suites
|
|
59
|
+
export function getQuantumSafeCipherConfiguration() {
|
|
60
|
+
const ciphers = crypto.getCiphers();
|
|
61
|
+
const curves = crypto.getCurves ? crypto.getCurves() : [];
|
|
62
|
+
|
|
63
|
+
const supportsKyber = curves.includes('X25519Kyber768Draft00') || curves.includes('x25519_kyber768');
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
tlsVersion: 'TLSv1.3',
|
|
67
|
+
ecdhCurve: supportsKyber ? 'X25519Kyber768Draft00:P-256' : 'auto',
|
|
68
|
+
signatureAlgorithms: [
|
|
69
|
+
'mldsa65',
|
|
70
|
+
'ecdsa_secp256r1_sha256',
|
|
71
|
+
'ed25519'
|
|
72
|
+
],
|
|
73
|
+
pqcReady: supportsKyber
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 4. Agent Migration Checklist
|
|
81
|
+
|
|
82
|
+
1. **Inventory Cryptographic Assets**: Audit all RSA 2048/4096 and ECDSA keys used for subagent authentication and webhook signing.
|
|
83
|
+
2. **Deploy Hybrid Key Exchange First**: Enable `X25519Kyber768` on all reverse proxies, load balancers, and Cloud Run agent endpoints. This protects against *Harvest Now, Decrypt Later* (HNDL) attacks with zero downtime.
|
|
84
|
+
3. **Upgrade Token Signatures**: Migrate internal agent JWTs to ML-DSA signatures with fallback validation for legacy clients.
|