Strip SSH key comments on deploy; add preconfig_sd.sh

Copying authorized_keys verbatim onto a drop implant leaks internal hostnames,
usernames, and tool names in key comments. preconfig_sd.sh now strips all
comments (awk '{print $1,$2}') when writing keys to SD card. deploy.sh adds
the same strip step on the live device as a safety net.
This commit is contained in:
Cobra
2026-04-07 13:41:44 -04:00
parent 8037462276
commit 77aac72d31
2 changed files with 96 additions and 1 deletions
+7 -1
View File
@@ -75,7 +75,13 @@ if [[ $SETUP_EXIT -ne 0 ]]; then
exit $SETUP_EXIT
fi
# ── 4. Final status ──────────────────────────────────────────────────────────
# ── 4. Strip key comments from authorized_keys ───────────────────────────────
step "Stripping SSH key comments (OPSEC)..."
ssh -o StrictHostKeyChecking=no "$TARGET" \
"awk '{print \$1, \$2}' /root/.ssh/authorized_keys > /tmp/.ak_clean && mv /tmp/.ak_clean /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys" 2>/dev/null || true
info "Key comments stripped"
# ── 5. Final status ──────────────────────────────────────────────────────────
echo ""
step "Deployment status"
ssh -o StrictHostKeyChecking=no "$TARGET" \