-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-bin.sh
More file actions
executable file
·79 lines (64 loc) · 2.7 KB
/
setup-bin.sh
File metadata and controls
executable file
·79 lines (64 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# ============================================================
# SysAI - Setup binari per scan integrati
#
# Questo script scarica e prepara ssh-audit per l'inclusione
# nel pacchetto .deb/.rpm
# ============================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BIN_DIR="$SCRIPT_DIR/bin"
echo "╔══════════════════════════════════════╗"
echo "║ SysAI - Setup scanner binaries ║"
echo "╚══════════════════════════════════════╝"
echo ""
# Crea cartella bin/
mkdir -p "$BIN_DIR"
# ============================================================
# SSH-AUDIT
# ============================================================
echo "[1/2] Scaricamento ssh-audit..."
SSH_AUDIT_VERSION="3.3.0"
SSH_AUDIT_URL="https://github.com/jtesta/ssh-audit/releases/download/v${SSH_AUDIT_VERSION}/ssh-audit-${SSH_AUDIT_VERSION}.tar.gz"
# Scarica e estrai
cd /tmp
if [ -f "ssh-audit-${SSH_AUDIT_VERSION}.tar.gz" ]; then
echo " → File già presente, riuso..."
else
wget -q --show-progress "$SSH_AUDIT_URL" -O "ssh-audit-${SSH_AUDIT_VERSION}.tar.gz"
fi
tar xzf "ssh-audit-${SSH_AUDIT_VERSION}.tar.gz"
# Copia lo script Python (è un singolo file!)
cp "ssh-audit-${SSH_AUDIT_VERSION}/ssh-audit" "$BIN_DIR/ssh-audit"
chmod +x "$BIN_DIR/ssh-audit"
echo " ✓ ssh-audit ${SSH_AUDIT_VERSION} installato"
# Pulizia
rm -rf "/tmp/ssh-audit-${SSH_AUDIT_VERSION}" "/tmp/ssh-audit-${SSH_AUDIT_VERSION}.tar.gz"
# ============================================================
# VERIFICA
# ============================================================
echo ""
echo "[2/2] Verifica installazione..."
echo ""
if [ -x "$BIN_DIR/ssh-audit" ]; then
echo " ✓ bin/ssh-audit $(du -h "$BIN_DIR/ssh-audit" | cut -f1)"
# Test rapido
if python3 "$BIN_DIR/ssh-audit" --help > /dev/null 2>&1; then
echo " → Funziona con python3 ✓"
else
echo " ⚠ python3 non trovato - ssh-audit richiede Python 3.6+"
echo " → Installa con: sudo apt install python3"
fi
else
echo " ✗ ssh-audit non trovato!"
fi
echo ""
echo "════════════════════════════════════════"
echo " Nota: Port scan e TLS check sono"
echo " integrati in Node.js (nessun binario"
echo " esterno necessario)"
echo "════════════════════════════════════════"
echo ""
echo "Fatto! Ora puoi buildare con:"
echo " npm run electron:build:all"
echo ""