Benign linux Download

install.sh

AArch64 (ARM64) architecture stringMentions the /lib64 directory

Evidence

Text contains curl piped to sh lines 1–13
1#!/bin/sh
2#
3# Maltrail installer.
4#
5# curl -fsSL https://raw.githubusercontent.com/stamparm/maltrail/master/install.sh | sh
6#
7# Installs the server, the sensor, or both: dependencies, a shallow git clone, the prebuilt sensor
8# binary for this architecture, an unprivileged user, log and state directories, systemd units, and
9# the capabilities the sensor needs to capture without root. Re-running it is the upgrade path.
10#
11# sh install.sh --role sensor # sensor only (server lives elsewhere)
12# sh install.sh --ref master # track master instead of the latest release
13# sh in …
HTTP or HTTPS URL reference lines 21–60
21:12… r than a release tarball on purpose: an upgrade is a fetch, and `--depth 1` leaves the
22# ~1.8 GB of history behind. The tree and the prebuilt sensor are the SAME release by default.
23#
24# Copyright (c) 2014-present Maltrail developers (https://github.com/stamparm/maltrail/)
25# See the file 'LICENSE' for copying permission
26set -eu
27
28REPO=${MALTRAIL_REPO:-https://github.com/stamparm/maltrail.git}
29RELEASES=${MALTRAIL_RELEASES:-https://github.com/stamparm/maltrail/releases}
30PREFIX=${MALTRAIL_PREFIX:-/opt/maltrail}
31CONF=${MALTRAIL_CONF:-/etc/maltrail.conf}
32REF=${MALTRAIL_REF:-} # empty: the latest release, resolved by resolve_ref
33ROLE=${MALTRAIL_ROLE:-both}
34SENSOR_BIN=${MALTRAIL_SENSOR_BIN:-}
35# Where the sensor is linked so it can be run by name. /usr/local/bin everywhere except NetBSD,
36# whose convention is /usr/pkg/bin and which has no /usr/local/bin to link into.
37case $(uname -s) in
38 NetBSD) SENSOR_LINK=/usr/pkg/bin/maltrail-sensor ;;
39 *) SENSOR_LINK=/usr/local/bin/maltrail-sensor ;;
40esac
41LOG_DIR=${MALTRAIL_LOG_DIR:-/var/log/maltrail}
42STATE_DIR=${MALTRAIL_STATE_DIR:-/var/lib/maltrail}
43RUN_USER=${MALTRAIL_USER:-maltrail}
44UNIT_DIR=${MALTRAIL_UNIT_DIR:-/etc/systemd/system}
45UNIT_DIR_SET=0
46PREFIX_SET=0
⋯5 lines
52UNINSTALL=0
53PYTHON=""
54GENERATED_PASSWORD=""
55PKG=""
56warned=0
57
58say() { printf '\033[1;36m==>\033[0m %s\n' "$*"; }
59info() { printf ' %s\n' "$*"; }
60warn() { warned=$((warned + 1)); printf '\033[1;33m[!]\033[0m %s\n' "$*" >& …
Shell text redirects both output streams lines 61–65
61:7… { printf '\033[1;31m[x]\033[0m %s\n' "$*" >&2; exit 1; }
62have() { command -v "$1" >/dev/null 2>&1; }
63
64# Every mutating command goes through this, which is what makes --dry-run honest rather than a
65# best-effort approximation …
Force-deletes a shell variable target lines 75–100
75:14… s is not information; its error message is.
76run_quiet() {
77 if [ "$DRY" = 1 ]; then
78 printf ' + %s\n' "$*"
79 return 0
80 fi
81 _log=$(mktemp)
82 if "$@" >"$_log" 2>&1; then
83 rm -f "$_log"
84 return 0
85 fi
86 printf '\n--- output of: %s ---\n' "$*" >&2
87 cat "$_log" >&2
88 rm -f "$_log"
89 return 1
90}
91
92usage() {
93 sed -n '3,22p' "$0" | sed 's/^# \{0,1\}//'
94 exit 0
95}
96
⋯4 lines
Pipe to sudo shell command text lines 138–154
138:12… O_SET" = 0 ] || return 0
139 [ -n "${0:-}" ] && [ -f "$0" ] || return 0
140 _dir=$(CDPATH='' cd -- "$(dirname -- "$0")" 2>/dev/null && pwd) || return 0
141 [ -d "$_dir/.git" ] && [ -f "$_dir/server.py" ] && [ -d "$_dir/core" ] || return 0
142 IN_PLACE=1
143 PREFIX=$_dir
144}
145
146need_root() {
147 [ "$(id -u)" = 0 ] && return 0
148 if have sudo; then
149 die "this needs root. Re-run with: curl -fsSL <url> | sudo sh"
150 fi
151 die "this needs root, and sudo is not installed. Run it as root."
152}
153
154# -------------------------------------------- …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.