-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathuserseek.sh
337 lines (262 loc) · 9.99 KB
/
userseek.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
#!/bin/bash
# Coded by: thelinuxchoice
# Github: https://github.com/thelinuxchoice/userseek
# Instagram: @thelinuxchoice
trap 'store;exit 1' 2
dependencies() {
command -v curl > /dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Run ./install.sh. Aborting."; exit 1; }
}
menu() {
printf "\e[1;77m[\e[0m\e[1;92m01\e[0m\e[1;77m] Instagram\e[0m\n"
printf "\e[1;77m[\e[0m\e[1;92m02\e[0m\e[1;77m] Twitter\e[0m\n"
printf "\e[1;77m[\e[0m\e[1;92m03\e[0m\e[1;77m] Facebook\e[0m\n"
#printf "\e[1;77m[\e[0m\e[1;92m01\e[0m\e[1;77m] Github\e[0m\n"
#printf "\e[1;77m[\e[0m\e[1;92m01\e[0m\e[1;77m] Youtube\e[0m\n"
printf "\n"
read -p $'\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Seek available users on: \e[0m' choice
if [[ $choice -eq 1 ]]; then
media="instagram"
start
instagram
elif [[ $choice -eq 2 ]]; then
media="twitter"
start
twitter
elif [[ $choice -eq 3 ]]; then
media="facebook"
start
facebook
else
printf "\e[1;93m [!] Invalid option!\e[0m\n"
sleep 1
menu
fi
}
banner() {
printf "\n"
printf "\e[1;77m888 888 .d8888b. 888 \n"
printf "888 888 d88P Y88b 888 \n"
printf "888 888 Y88b. 888 \n"
printf "888 888 .d8888b .d88b. 888d888 \"Y888b. .d88b. .d88b. 888 888 \n"
printf "888 888 88K d8P Y8b 888P\" \"Y88b. d8P Y8b d8P Y8b 888 .88P \n"
printf "888 888 \"Y8888b. 88888888 888 \"888 88888888 88888888 888888K \n"
printf "Y88b. .d88P X88 Y8b. 888 Y88b d88P Y8b. Y8b. 888 \"88b \n"
printf " \"Y88888P\" 88888P' \"Y8888 888 \"Y8888P\" \"Y8888 \"Y8888 888 888 \e[0m\n"
printf "\n"
printf "\e[1;77m v1.0\e[0m\e[1;92m Author: @thelinuxchoice\e[0m\n"
printf "\n"
}
function start() {
if [[ -e available.txt ]]; then
rm -rf available.txt
fi
default_wl_user="users.txt"
read -p $'\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Username List: \e[0m' wl_user
wl_user="${wl_user:-${default_wl_user}}"
default_threads="10"
read -p $'\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Threads (Default 10): \e[0m' threads
threads="${threads:-${default_threads}}"
#fi
}
checktor() {
check=$(curl --socks5-hostname localhost:9050 -s https://check.torproject.org > /dev/null; echo $?)
if [[ "$check" -gt 0 ]]; then
printf "\e[1;91mPlease, check your TOR Connection! Just type tor or service tor start\n\e[0m"
exit 1
fi
}
function store() {
if [[ -n "$threads" ]]; then
printf "\e[1;91m [*] Waiting threads shutting down...\n\e[0m"
if [[ "$threads" -gt 10 ]]; then
sleep 6
else
sleep 3
fi
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
default_session="Y"
printf "\n\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Save session for media\e[0m\e[1;92m %s \e[0m" $media
read -p $'?\e[1;92m [Y/n]: \e[0m' session
session="${session:-${default_session}}"
if [[ "$session" == "Y" || "$session" == "y" || "$session" == "yes" || "$session" == "Yes" ]]; then
if [[ ! -d sessions ]]; then
mkdir sessions
fi
IFS=$'\n'
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
printf "user=\"%s\"\nwl_user=\"%s\"\ntoken=\"%s\"\nmedia=\"%s\"\n" $user $wl_user $countuser $media > sessions/store.session.$media.$(date +"%FT%H%M")
printf "\e[1;77mSession saved.\e[0m\n"
printf "\e[1;92mUse ./userseek --resume\n"
else
exit 1
fi
else
exit 1
fi
}
function changeip() {
killall -HUP tor
}
function instagram() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
printf "\e[1;92mWordlist:\e[0m\e[1;77m %s (%s)\e[0m\n" $wl_user $count_user
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
token=0
startline=1
endline="$threads"
while [ $token -lt $count_user ]; do
IFS=$'\n'
for user in $(sed -n ''$startline','$endline'p' $wl_user); do
IFS=$'\n'
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
let token++
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
{(trap '' SIGINT && var=$(curl -L -s https://www.instagram.com/$user/ | grep -c "the page may have been removed"); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let startline+=$threads
let endline+=$threads
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
function twitter() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
printf "\e[1;92mWordlist:\e[0m\e[1;77m %s (%s)\e[0m\n" $wl_user $count_user
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
token=0
startline=1
endline="$threads"
while [ $token -lt $count_user ]; do
IFS=$'\n'
for user in $(sed -n ''$startline','$endline'p' $wl_user); do
IFS=$'\n'
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
let token++
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
{(trap '' SIGINT && var=$(curl -s "https://www.twitter.com/$user" -L -H "Accept-Language: en" | grep -c 'page doesn’t exist';); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let startline+=$threads
let endline+=$threads
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
function facebook() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
printf "\e[1;92mWordlist:\e[0m\e[1;77m %s (%s)\e[0m\n" $wl_user $count_user
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
token=0
startline=1
endline="$threads"
while [ $token -lt $count_user ]; do
IFS=$'\n'
for user in $(sed -n ''$startline','$endline'p' $wl_user); do
IFS=$'\n'
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
let token++
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
{(trap '' SIGINT && var=$(curl -s "https://www.facebook.com/$username" -L -H "Accept-Language: en" | grep -c 'not found'); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let startline+=$threads
let endline+=$threads
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
resume_insta() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
while [ $token -lt $count_user ]; do
for user in $(sed -n ''$token','$(($token+threads))'p' $wl_user); do
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
let token++
{(trap '' SIGINT && var=$(curl -L -s https://www.instagram.com/$user/ | grep -c "the page may have been removed"); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let token--
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
resume_face() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
while [ $token -lt $count_user ]; do
for user in $(sed -n ''$token','$(($token+threads))'p' $wl_user); do
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
let token++
{(trap '' SIGINT && var=$(curl -s "https://www.facebook.com/$username" -L -H "Accept-Language: en" | grep -c 'not found'); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let token--
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
resume_twitter() {
count_user=$(wc -l $wl_user | cut -d " " -f1)
while [ $token -lt $count_user ]; do
for user in $(sed -n ''$token','$(($token+threads))'p' $wl_user); do
countuser=$(grep -n -x "$user" "$wl_user" | cut -d ":" -f1)
printf "\e[1;77mChecking user (%s/%s):\e[0m\e[1;92m %s\e[0m\n" $countuser $count_user $user
let token++
{(trap '' SIGINT && var=$(curl -s "https://www.twitter.com/$user" -L -H "Accept-Language: en" | grep -c 'page doesn’t exist';); if [[ $var == "1" ]]; then printf "%s\n" $user >> available.txt ; fi ;) } & done; wait $!;
let token--
done
if [[ -e available.txt ]]; then
result=$(wc -l available.txt | cut -d " " -f1 )
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] available: %s\n" $result
printf "\e[1;77m[\e[0m\e[1;92m+\e[0m\e[1;77m] Saved: available.txt\n"
fi
exit 1
}
function resume() {
counter=1
if [[ ! -d sessions ]]; then
printf "\e[1;91m[*] No sessions\n\e[0m"
exit 1
fi
printf "\e[1;92mFiles sessions:\n\e[0m"
for list in $(ls sessions/store.session*); do
IFS=$'\n'
source $list
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 last: \e[0m\e[1;77m %s, \e[1;92m media:\e[0m\e[1;77m %s )\n\e[0m" "$counter" "$list" "$wl_user" "$token" "$media"
let counter++
done
read -p $'\e[1;92mChoose a session number: \e[0m' fileresume
source $(ls sessions/store.session* | sed ''$fileresume'q;d')
default_threads=10
read -p $'\e[1;92mThreads (Default 10): \e[0m' threads
threads="${threads:-${default_threads}}"
printf "\e[1;92m[*] Resuming session for user:\e[0m \e[1;77m%s\e[0m\n" $user
printf "\e[1;92m[*] Wordlist: \e[0m \e[1;77m%s\e[0m\n" $wl_user
printf "\e[1;91m[*] Press Ctrl + C to stop or save session\n\e[0m"
if [[ $media == "instagram" ]]; then
resume_insta
elif [[ $media == "facebook" ]]; then
resume_face
elif [[ $media == "twitter" ]]; then
resume_twitter
fi
}
case "$1" in --resume) resume ;; *)
banner
menu
esac