-
Notifications
You must be signed in to change notification settings - Fork 159
Expand file tree
/
Copy pathsetup_ruby.sh
More file actions
57 lines (41 loc) · 1.37 KB
/
Copy pathsetup_ruby.sh
File metadata and controls
57 lines (41 loc) · 1.37 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
#!/usr/bin/env bash
set -euo pipefail
msg(){ echo "[*] $*"; }
ok(){ echo "[OK] $*"; }
RUBY_PREFIX="/opt/darkmoon/ruby"
RUBY_BIN="$RUBY_PREFIX/bin/ruby"
GEM_BIN="$RUBY_PREFIX/bin/gem"
BUNDLE_BIN="$RUBY_PREFIX/bin/bundle"
BIN_OUT="/out/bin"
# whatweb
msg "Installing WhatWeb (Ruby)…"
WHATWEB_DIR="/opt/darkmoon/whatweb"
git clone --depth=1 https://github.com/urbanadventurer/WhatWeb "$WHATWEB_DIR"
# Validation que le fichier principal existe
test -f "$WHATWEB_DIR/whatweb" || { echo "ERROR: whatweb script not found in $WHATWEB_DIR"; exit 1; }
# Bundler
"$GEM_BIN" install bundler --no-document
cd "$WHATWEB_DIR"
"$BUNDLE_BIN" install
# wrapper
cat >"$BIN_OUT/whatweb" <<'EOF'
#!/bin/sh
exec /opt/darkmoon/ruby/bin/ruby /opt/darkmoon/whatweb/whatweb "$@"
EOF
chmod +x "$BIN_OUT/whatweb"
# Vérification finale
test -x "$BIN_OUT/whatweb" || { echo "ERROR: whatweb wrapper not created"; exit 1; }
ok "WhatWeb installed"
# ------------------------------------------------------------
# WPScan — DOC OFFICIELLE: gem install
# ------------------------------------------------------------
msg "Installing WPScan (Ruby)…"
"$GEM_BIN" install wpscan --no-document
# wrapper
cat >"$BIN_OUT/wpscan" <<'EOF'
#!/bin/sh
exec /opt/darkmoon/ruby/bin/wpscan "$@"
EOF
chmod +x "$BIN_OUT/wpscan"
test -x "$BIN_OUT/wpscan" || { echo "ERROR: wpscan wrapper not created"; exit 1; }
ok "WPScan installed"