bug.cf 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. reset
  3. echo -e "\e[1;33m==============================================================="
  4. echo -e "\e[1;36m AutoScriptVPS by Badboy "
  5. echo -e "\e[1;36m Redfox VPN "
  6. echo -e "\e[1;33m==============================================================="
  7. read -p "bug : " bughost
  8. IP=$(wget -qO- icanhazip.com);
  9. sleep 1
  10. echo Ping Host
  11. echo Cek Hak Akses...
  12. sleep 0.5
  13. echo Permission Accepted
  14. clear
  15. sleep 0.5
  16. clear
  17. apt install jq curl -y
  18. DOMAIN=aidan.my
  19. Bug=$bughost
  20. sub=$(</dev/urandom tr -dc a-z0-9 | head -c4)
  21. SUB_DOMAIN=${Bug}.${sub}.aidan.my
  22. CF_ID=irwan@aidan.my
  23. CF_KEY=ff3d540666c202facbd936ba3d0d0110
  24. set -euo pipefail
  25. IP=$(wget -qO- icanhazip.com);
  26. echo "Updating DNS for ${SUB_DOMAIN}..."
  27. ZONE=$(curl -sLX GET "https://api.cloudflare.com/client/v4/zones?name=${DOMAIN}&status=active" \
  28. -H "X-Auth-Email: ${CF_ID}" \
  29. -H "X-Auth-Key: ${CF_KEY}" \
  30. -H "Content-Type: application/json" | jq -r .result[0].id)
  31. RECORD=$(curl -sLX GET "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records?name=${SUB_DOMAIN}" \
  32. -H "X-Auth-Email: ${CF_ID}" \
  33. -H "X-Auth-Key: ${CF_KEY}" \
  34. -H "Content-Type: application/json" | jq -r .result[0].id)
  35. sleep 0.2
  36. clear
  37. if [[ "${#RECORD}" -le 10 ]]; then
  38. RECORD=$(curl -sLX POST "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records" \
  39. -H "X-Auth-Email: ${CF_ID}" \
  40. -H "X-Auth-Key: ${CF_KEY}" \
  41. -H "Content-Type: application/json" \
  42. --data '{"type":"A","name":"'${SUB_DOMAIN}'","content":"'${IP}'","ttl":120,"proxied":false}' | jq -r .result.id)
  43. fi
  44. RESULT=$(curl -sLX PUT "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records/${RECORD}" \
  45. -H "X-Auth-Email: ${CF_ID}" \
  46. -H "X-Auth-Key: ${CF_KEY}" \
  47. -H "Content-Type: application/json" \
  48. --data '{"type":"A","name":"'${SUB_DOMAIN}'","content":"'${IP}'","ttl":120,"proxied":false}')
  49. echo "Host : $SUB_DOMAIN"
  50. echo $SUB_DOMAIN > /root/domain
  51. rm -f /root/cf.sh