Guest User

Untitled

a guest
Oct 21st, 2026
81
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1.  
  2. #!/bin/bash
  3.  
  4. distrust() {
  5. echo "Rejecting local certificate trust chain"
  6.  
  7. local config="/etc/ca-certificates.conf"
  8. local cert
  9. local found=0
  10. local changed=0
  11.  
  12. if [ "$(id -u)" -ne 0 ]; then
  13. echo "Must run as root to update the system CA trust store" >&2
  14. return 1
  15. fi
  16.  
  17. for cert in \
  18. "mozilla/Comodo_AAA_Services_root.crt" \
  19. "mozilla/emSign_ECC_Root_CA_-_G3.crt"
  20. do
  21. if [ ! -f "/usr/share/ca-certificates/$cert" ]; then
  22. echo "Certificate not found: $cert" >&2
  23. continue
  24. fi
  25.  
  26. found=1
  27.  
  28. if ! grep -Fxq "!$cert" "$config"; then
  29. if grep -Fxq "$cert" "$config"; then
  30. sed -i "s|^$cert\$|!$cert|" "$config" || return 1
  31. changed=1
  32. else
  33. echo "Certificate is not enabled in $config: $cert"
  34. fi
  35. fi
  36. done
  37.  
  38. if [ "$found" -eq 0 ]; then
  39. echo "Neither certificate was found in the Debian CA store" >&2
  40. return 1
  41. fi
  42.  
  43. if [ "$changed" -eq 0 ]; then
  44. echo "No enabled certificates needed disabling"
  45. return 1
  46. fi
  47.  
  48. update-ca-certificates || return 1
  49. }
  50.  
  51. if [ ! -f /etc/debian_version ]; then
  52. echo "Script designed for Debian-based systems" >&2
  53. exit 1
  54. fi
  55.  
  56. if [ ! -x /usr/bin/curl ] || ! command -v update-ca-certificates >/dev/null 2>&1; then
  57. echo "Missing curl or update-ca-certificates" >&2
  58. exit 1
  59. fi
  60.  
  61. urls="https://dv-g3b-emudhra.we-have-a-problem.com/
  62. https://dv-g3c-emudhra.we-have-a-problem.com/
  63. https://ov-g3b-emudhra.we-have-a-problem.com/
  64. https://ov-g3c-emudhra.we-have-a-problem.com/
  65. https://ev-g3b-emudhra.we-have-a-problem.com/
  66. https://ev-g3c-emudhra.we-have-a-problem.com/
  67. https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
  68. https://dv-g3c-aaa-emudhra.we-have-a-problem.com/
  69. https://ov-g3b-aaa-emudhra.we-have-a-problem.com/
  70. https://ov-g3c-aaa-emudhra.we-have-a-problem.com/
  71. https://ev-g3b-aaa-emudhra.we-have-a-problem.com/
  72. https://ev-g3c-aaa-emudhra.we-have-a-problem.com/
  73. "
  74.  
  75. vulnerable=0
  76. fixed=0
  77. fix_attempted=0
  78.  
  79. for url in $urls; do
  80. echo "Trying $url"
  81.  
  82. /usr/bin/curl "$url" -o /dev/null 2>/dev/null
  83. rc=$?
  84.  
  85. if [ "$rc" -eq 0 ]; then
  86. vulnerable=1
  87.  
  88. if [ "$fix_attempted" -eq 0 ]; then
  89. fix_attempted=1
  90. if distrust; then
  91. fixed=1
  92. fi
  93. fi
  94. elif [ "$rc" -eq 60 ]; then
  95. echo "Curl refused because of SSL - this is good."
  96. else
  97. echo "Some other network problem (curl exit $rc) - try again later."
  98. fi
  99. done
  100.  
  101. if [ "$vulnerable" -eq 0 ]; then
  102. echo "Your system was not vulnerable"
  103. else
  104. echo "Your system was vulnerable"
  105. fi
  106.  
  107. verified=0
  108. if [ "$fixed" -eq 1 ]; then
  109. verified=1
  110. for url in $urls; do
  111. echo "Verifying $url"
  112. /usr/bin/curl "$url" -o /dev/null 2>/dev/null
  113. rc=$?
  114.  
  115. if [ "$rc" -ne 60 ]; then
  116. verified=0
  117. if [ "$rc" -eq 0 ]; then
  118. echo "Certificate verification still succeeds for $url"
  119. else
  120. echo "Could not verify $url (curl exit $rc)"
  121. fi
  122. fi
  123. done
  124. fi
  125.  
  126. if [ "$fixed" -eq 0 ]; then
  127. echo "No fix was applied"
  128. elif [ "$verified" -eq 1 ]; then
  129. echo "System certificate fix was applied and verified"
  130. else
  131. echo "Trust-store update succeeded, but the certificate fix could not be verified"
  132. fi
  133.  
  134.  
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment