f90a686626
- setup.sh: Idempotent bootstrap for OPi Zero 3 / RPi Zero 2W / Debian Platform detection, system packages, Pi optimizations (gpu_mem, swap, sysctl), directory structure, Python venv, bettercap binary install, external tools (Responder, NetExec, Chisel, Ligolo, kerbrute, etc), data database creation, systemd service install, permissions, verification. Supports --reinstall, --jumpbox, --no-tools, --verify-only flags. - scripts/build_data.py: Creates 5 SQLite databases innocuous_macs.db (51 consumer device profiles with OUI/DHCP/TCP fingerprints), oui.db (50 seed OUIs), os_sigs.db (16 p0f-style signatures), dhcp_fingerprints.db (19 option-55 fingerprints), ja3_fingerprints.db (13 hashes) - scripts/build_lkm.sh: LKM rootkit compiler wrapper - scripts/rotate_pcap.sh: tcpdump post-rotation handler with zstd compression, optional AES-256-GCM encryption, disk space monitoring, and auto-purge
55 lines
1.5 KiB
Bash
Executable File
55 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build the BigBrother LKM rootkit module (Debian host only)
|
|
# Requires kernel headers: apt install linux-headers-$(uname -r)
|
|
set -euo pipefail
|
|
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m'
|
|
|
|
LKM_DIR="$(cd "$(dirname "$0")/../templates/lkm" && pwd)"
|
|
|
|
if [[ ! -d "$LKM_DIR" ]]; then
|
|
echo -e "${RED}[-]${NC} LKM source directory not found: $LKM_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -f "$LKM_DIR/Makefile" ]]; then
|
|
echo -e "${RED}[-]${NC} No Makefile found in $LKM_DIR"
|
|
exit 1
|
|
fi
|
|
|
|
# Check for kernel headers
|
|
KVER=$(uname -r)
|
|
if [[ ! -d "/lib/modules/${KVER}/build" ]]; then
|
|
echo -e "${RED}[-]${NC} Kernel headers not found for ${KVER}"
|
|
echo -e "${YELLOW}[!]${NC} Install with: apt install linux-headers-${KVER}"
|
|
exit 1
|
|
fi
|
|
|
|
# Check for build tools
|
|
for tool in make gcc; do
|
|
if ! command -v "$tool" &>/dev/null; then
|
|
echo -e "${RED}[-]${NC} Required tool not found: $tool"
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
echo -e "${GREEN}[+]${NC} Building LKM rootkit for kernel ${KVER}..."
|
|
cd "$LKM_DIR"
|
|
make clean 2>/dev/null || true
|
|
make
|
|
|
|
if [[ -f "$LKM_DIR/bb_hide.ko" ]]; then
|
|
echo -e "${GREEN}[+]${NC} LKM built: $LKM_DIR/bb_hide.ko"
|
|
echo -e "${GREEN}[+]${NC} Size: $(stat -c '%s' "$LKM_DIR/bb_hide.ko") bytes"
|
|
echo ""
|
|
echo -e "${YELLOW}[!]${NC} Load with: insmod $LKM_DIR/bb_hide.ko"
|
|
echo -e "${YELLOW}[!]${NC} Verify: lsmod | grep bb_hide"
|
|
echo -e "${YELLOW}[!]${NC} Unload: rmmod bb_hide"
|
|
else
|
|
echo -e "${RED}[-]${NC} Build failed -- bb_hide.ko not found"
|
|
exit 1
|
|
fi
|