diff --git a/.gitignore b/.gitignore index a14a341..5a15080 100644 --- a/.gitignore +++ b/.gitignore @@ -11,10 +11,6 @@ Thumbs.db *.swp *.swo -# Binaries -*.exe -*.bin - # Config — never commit real credentials **/config.yaml diff --git a/aasd/AGENT.md b/aasd/AGENT.md index 1f96e0f..9ca99c8 100644 --- a/aasd/AGENT.md +++ b/aasd/AGENT.md @@ -41,7 +41,7 @@ gitex2026/ - **Wordlist**: `/opt/aasd/subdomains.txt` (5000 names from SecLists) - **Frontend**: `/opt/aasd/static/` - **Service**: `aasd.service` (systemd, runs as `engineer`, WorkingDir `/opt/aasd`) -- **Build**: `cd ~/gitex2026/aasd/src && go build -o /opt/aasd/aasd ./cmd/aasd/` +- **Build**: `cd ~/gitex2026/aasd/src && go build -o ../bin/aasd ./cmd/aasd/` (outputs to `bin/`) - **Restart**: `sudo systemctl restart aasd` ## Architecture — Pipeline Flow @@ -111,7 +111,7 @@ executeScanPhase() discoverSubdomains() ```bash # Build and deploy -cd ~/gitex2026/aasd/src && go build -o /opt/aasd/aasd ./cmd/aasd/ +cd ~/gitex2026/aasd/src && go build -o ../bin/aasd ./cmd/aasd/ && sudo cp ../bin/aasd /opt/aasd/aasd sudo systemctl restart aasd # Check service diff --git a/aasd/README.md b/aasd/README.md index e1c48bf..9f3dab0 100644 --- a/aasd/README.md +++ b/aasd/README.md @@ -9,11 +9,12 @@ Enter domain → Discover subdomains → Pick target → GoTestWAF scan → AI r ## Quick Start ```bash -# Build +# Build (from source) cd ~/gitex2026/aasd/src -go build -o /opt/aasd/aasd ./cmd/aasd/ +go build -o ../bin/aasd ./cmd/aasd/ -# Deploy +# Quick deploy (pre-built binary in bin/) +sudo cp bin/aasd /opt/aasd/aasd sudo systemctl restart aasd # Monitor @@ -36,19 +37,28 @@ sudo journalctl -u aasd -f ### Structure ``` -/opt/aasd/ -├── aasd # Compiled binary (31M) +gitex2026/aasd/ +├── bin/ # Pre-built binaries +│ ├── aasd # Compiled Go binary (31M) +│ └── gotestwaf # WAF scanner binary (27M) +├── src/ # Go source code +├── docs/ # Documentation +├── install.sh # Production installer (creates /opt/aasd/) +├── sample.config.yaml # Config template (copy to /opt/aasd/config.yaml) +├── sample.env # Environment variable template +├── README.md # This file +└── VERSION + +/opt/aasd/ # Deployed runtime (created by install.sh) +├── aasd # Compiled binary (from bin/) ├── config.yaml # Server URL, admin credentials, AI key ├── prompt.txt # DeepSeek system prompt -├── subdomains.txt # 5000 common subdomain names (SecLists) -├── gotestwaf # WAF scanner binary (27M) +├── subdomains.txt # Subdomain wordlist +├── gotestwaf # WAF scanner binary (from bin/) ├── gotestwaf-config.yaml # HTTP headers for scans ├── testcases/ # GoTestWAF attack payloads ├── static/ # Frontend files -│ ├── index.html # Landing page -│ └── simulation.html # Selection + progress page -├── templates/ -│ └── admin.html # Consultant dashboard +├── templates/ # Admin dashboard template ├── reports/ # Generated scan reports └── logs/ # Server logs ``` @@ -148,11 +158,12 @@ src/ # Repository cd ~/gitex2026 # aasd/src/ — Go source +# aasd/bin/ — Pre-built binaries # aasd/docs/ — Documentation -# Build +# Build (outputs to bin/) cd ~/gitex2026/aasd/src -go build -o /opt/aasd/aasd ./cmd/aasd/ +go build -o ../bin/aasd ./cmd/aasd/ go vet ./... # Update wordlist (optional, defaults to built-in 40 names) diff --git a/aasd/bin/aasd b/aasd/bin/aasd new file mode 100755 index 0000000..7d1328f Binary files /dev/null and b/aasd/bin/aasd differ diff --git a/aasd/bin/gotestwaf b/aasd/bin/gotestwaf new file mode 100755 index 0000000..12deba4 Binary files /dev/null and b/aasd/bin/gotestwaf differ diff --git a/aasd/install.sh b/aasd/install.sh index fa6c6d2..3ad3017 100644 --- a/aasd/install.sh +++ b/aasd/install.sh @@ -93,11 +93,12 @@ else fi # ────────────────────────────────────────────── -# Determine source of dist/ +# Determine source of binaries + assets # ────────────────────────────────────────────── RELEASE_URL="${AASD_RELEASE_URL:-}" SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" LOCAL_DIST="$SCRIPT_DIR/dist" +LOCAL_BIN="$SCRIPT_DIR/bin" if [[ -n "$RELEASE_URL" ]]; then # Download from URL @@ -113,13 +114,22 @@ if [[ -n "$RELEASE_URL" ]]; then rm -rf "$TMP_DIR" pass "Release downloaded and extracted" elif [[ -d "$LOCAL_DIST" ]]; then - # Copy from local dist/ + # Copy from local dist/ (full release bundle) info "Copying local dist/ to $APP_HOME ..." mkdir -p "$APP_HOME" cp -r "$LOCAL_DIST"/* "$APP_HOME/" pass "Local dist/ copied" +elif [[ -d "$LOCAL_BIN" ]]; then + # Copy from local bin/ + source directory (dev workflow) + info "Deploying from local bin/ and source files ..." + mkdir -p "$APP_HOME" + cp "$LOCAL_BIN"/aasd "$LOCAL_BIN"/gotestwaf "$APP_HOME/" 2>/dev/null || true + cp "$SCRIPT_DIR/src/gotestwaf-config.yaml" "$APP_HOME/" 2>/dev/null || true + cp -r "$SCRIPT_DIR/src/static" "$SCRIPT_DIR/src/templates" "$APP_HOME/" 2>/dev/null || true + cp -r "$SCRIPT_DIR/src/gotestwaf/testcases" "$APP_HOME/" 2>/dev/null || true + pass "Local binaries and assets deployed" else - fail "No release URL set (AASD_RELEASE_URL) and no local dist/ found at $LOCAL_DIST" + fail "No release URL set (AASD_RELEASE_URL) and no local dist/ or bin/ found at $SCRIPT_DIR" fi # ──────────────────────────────────────────────