-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbot.sh
executable file
·479 lines (421 loc) · 15.4 KB
/
bot.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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
#!/bin/bash
source ShellBot.sh
ShellBot.init --token $token --monitor --flush --return map
ShellBot.username
#_____ _ _ _ _ ____ ___ _____ ____
#| ___| | | | \ | |/ ___/ _ \| ____/ ___|
#| |_ | | | | \| | | | | | | _| \___ \
#| _| | |_| | |\ | |__| |_| | |___ ___) |
#|_| \___/|_| \_|\____\___/|_____|____/
unset btn_all
btn_all='
["/set-targert","/nmap","/inurl"],
["/theharvester","/shodan","/whois"],
["/karma","/sherlok","/pwnedornot"],
["/dorks","/admin","/commands","/showinfra","/showpeople"]
'
btn_people='
["/karma","/sherlok","/pwnedornot"]
'
btn_infrastructure='
["/nmap","/inurl","/theharvester"],
["/shodan","/whois"]
'
btn_target='["People 👨💻","Infrastructure 🖥"]'
btn_cleam='
["Cleam Target - People"],
["Cleam Target - Infrastructure"],
["Cleam All","Cleam Args"]
'
keyboard="$(ShellBot.ReplyKeyboardMarkup --button 'btn_all' --one_time_keyboard true)"
keyboard_infrastructure="$(ShellBot.ReplyKeyboardMarkup --button 'btn_infrastructure' --one_time_keyboard true)"
keyboard_people="$(ShellBot.ReplyKeyboardMarkup --button 'btn_people' --one_time_keyboard true)"
while :
do
ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
for id in $(ShellBot.ListUpdates)
do
(
[[ ${message_chat_type[$id]} != private ]] && continue
mkdir /tmp/${message_from_id[$id]}
target_dir=/tmp/${message_from_id[$id]}/target
target_dir_p=/tmp/${message_from_id[$id]}/target_people
target=$(< $target_dir)
target_p=$(< $target_dir_p)
arg_nmap_dir=/tmp/${message_from_id[$id]}/nmap-agr
case ${message_text[$id]} in
'/start')
msg="Hi *$message_from_username* , Let's do a recon ? ?\n"
msg+="Your frist time ? Go to /readme"
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msg)" \
--parse_mode markdown
ShellBot.sendAnimation --chat_id ${message_from_id[$id]} \
--animation CgADBAADZwEAAjChrFDUjQYY3y3knBYE
;;
'/readme')
msg=""
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msg)" \
--parse_mode markdown
;;
'/help')
msg="Salve *$message_from_username* , Bora fazer um recon ?\n"
msg+="Da uma olhada nas info em /comandos."
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msg)" \
--parse_mode markdown
;;
"/nmap "*)
message_text=$(echo "$message_text" | awk '{print $2}')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *NMAP* \\n Target = *$message_text* Wait =)"
nmap_result=$(nmap $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$nmap_result"
;;
'/nmap')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *NMAP* \\n Target = *$target* Wait =)"
nmap_result=$(nmap $target)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$nmap_result"
;;
"/theharvester "*)
message_text=$(echo "$message_text" | awk '{print $2}')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *The Harvester* \\n Target = *$message_text* Wait =)"
theharvester_result=$(theHarvester.py -d $message_text -l 50 -b google)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$theharvester_result"
;;
'/theharvester')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *The Harvester* \\n Target = *$target* Wait =)"
theharvester_result=$(theHarvester.py -d $target -l 50 -b google)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$theharvester_result"
;;
"/inurl "*)
message_text=$(echo "$message_text" | awk '{print $2}')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Dork - $message_text Aguarde =)"
inurl_result=$(inurl $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$inurl_result"
;;
"/whois "*)
message_text=$(echo "$message_text" | awk '{print $2}')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Whois* \\n Target = *$message_text* Wait =)"
whois_result=$(whois $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$whois_result"
;;
'/whois')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Whois* \\n Target = *$target* Wait =)"
whois_result=$(whois $target)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$whois_result"
;;
'/shodan')
if [ ! -f target_dir=/tmp/${message_from_id[$id]}/shodan.init ] ; then
shodan init $shodan_key
> /tmp/${message_from_id[$id]}/shodan.init
fi
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Shodan* \\n Target = *$target* Wait =)"
shodan_result=$(shodan host $target)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$shodan_result"
;;
"/shodan "*)
shodan init $shodan_key
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Shodan* \\n Target = *$message_text* Wait =)"
shodan_result=$(shodan host $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$shodan_result"
;;
'/karma')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Starting *TOR*"
service tor start && sleep 15
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Karma* \\nTarget = *$target_p* Wait =)"
karma target $target_p > /tmp/karma.log
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "\`\`\`$(cat /tmp/karma.log) \\n \`\`\`" \
--parse_mode markdown
pkill tor && service tor stop
;;
"/karma "*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Karma* \\n Target = *$message_text* Wait =)"
service tor start
karma_result=$(karma target $message_text)
service tor stop
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$karma_result"
;;
'/sherlok')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Sherlok* \\nTarget = *$target_p* Wait =)"
sherlock $target_p | grep + > /tmp/sheklok.log
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "\`\`\`$(cat /tmp/sheklok.log) \`\`\`" \
--parse_mode markdown
;;
"/sherlok "*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Sherlok* \\n Target = *$message_text* Wait =)"
sherlock_result=$(sherlock $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$sherlock_result"
;;
'/pwnedornot')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Pwnedornot* \\n Target = *$target_p* Wait =)"
pwnedornot_result=$(pwnedornot.py -e $target)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$pwnedornot_result"
;;
"/pwnedornot "*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Executing *Pwnedornot* \\n Target = *$message_text* Wait =)"
pwnedornot_result=$(pwnedornot.py -e $message_text)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$pwnedornot_result"
;;
'/dorks')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Lista TOP DORKS"
dorks_result=$(cat dorks.list)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$dorks_result"
;;
'/commands')
msgp="For *People* \n"
msgp+="/theharvester - E-mails, subdomains and names Harvester - OSINT\n"
msgp+="/karma - Find leaked emails with your passwords\n"
msgp+="/pwnedornot - pwnedornot passwords hacked-emails\n"
msgp+="/sherlok - Find Usernames Across Social Networks\n"
msgi="For *Infrastructure* \n"
msgi+="/nmap - Open-source network scanner \n"
msgi+="/shodan - Shodan is the world's first search engine for Internet-connected devices\n"
msgi+="/inurl - Advanced search in search engines, enables analysis provided to exploit\n"
msgi+="/dorks - \n"
msgi+="/whois - Research domain ownership with Whois Lookup\n"
msgt="To define your target \n"
msgt+="/settarget - Define Target\n"
msgt+="/showinfra - Define Target Infra\n"
msgt+="/showpeople - Define Target People\n"
msgs="Alsos *Shotcuts* \n"
msgs+="/btninfra - Keyboard to infra\n"
msgs+="/btnpeople - Keyboard to people\n"
msgs+="/btnall - Keyboard all\n"
msga="Set your args 4 commands \n"
msga+="/advanced (beta)\n"
msgc="Cleam confis \n"
msgc+="/cleam"
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msgp)" \
--parse_mode markdown
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msgi)" \
--parse_mode markdown
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msgt)" \
--parse_mode markdown
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msgs)" \
--parse_mode markdown
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msga)" \
--parse_mode markdown
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "$(echo -e $msgc)" \
--parse_mode markdown
;;
'/admin')
message_text=$(echo "$message_text" | awk '{print $2,$3}')
$message_text > log 2> log
ShellBot.sendMessage --chat_id $message_chat_id \
--text "Comando executado"
ShellBot.sendMessage --chat_id $message_chat_id \
--text "$(echo -e "<b>log do comando $message_text</b>\n\n")" \
--parse_mode html
ShellBot.sendMessage --chat_id $message_chat_id \
--text "$(cat log)"
> log
;;
'/btnall')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "All shortcuts" \
--reply_markup "$keyboard" \
--parse_mode markdown
;;
'/btnpeople')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Shortcuts for peoples" \
--reply_markup "$keyboard_people" \
--parse_mode markdown
;;
'/btninfra')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Shortcurts for Infrastructure" \
--reply_markup "$keyboard_infrastructure" \
--parse_mode markdown
;;
'/advanced')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "For what command ?" \
--reply_markup "$(ShellBot.ForceReply)"
;;
'/settarget')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "What target?" \
--reply_markup "$(ShellBot.ReplyKeyboardMarkup --button 'btn_target')"
;;
"/setpeople "*)
message_text=$(echo "$message_text" | awk '{print $2}')
echo $message_text > $target_dir_p
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target = $message_text" \
--reply_markup "$keyboard_people" \
--parse_mode markdown
;;
"/setinfra "*)
message_text=$(echo "$message_text" | awk '{print $2}')
echo $message_text > $target_dir
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target = $message_text" \
--reply_markup "$keyboard_infrastructure" \
--parse_mode markdown
;;
'/showinfra')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Target = *$target*"
;;
'/showpeople')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--parse_mode markdown \
--text "Target = *$target_p*"
;;
*"People 👨💻"*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text 'PEOPLE - What email or Username?' \
--reply_markup "$(ShellBot.ForceReply)"
unset btn_target
;;
*"Infrastructure 🖥"*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text 'INFRASTRUCTURE - What IP or domain?' \
--reply_markup "$(ShellBot.ForceReply)"
unset btn_target
;;
'/cleam')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "What do you want to clean ?" \
--reply_markup "$(ShellBot.ReplyKeyboardMarkup --button 'btn_cleam')"
;;
'Cleam Target - People')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target People cleam" \
--reply_markup "$(ShellBot.ReplyKeyboardRemove)" \
--parse_mode markdown
> $target_dir_p
;;
'Cleam Target - Infrastructure')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target Infrastructure cleam" \
--reply_markup "$(ShellBot.ReplyKeyboardRemove)" \
--parse_mode markdown
> $target_dir
;;
'Cleam All')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "All clear" \
--reply_markup "$(ShellBot.ReplyKeyboardRemove)" \
--parse_mode markdown
> $target_dir_p
> $target_dir
> $arg_nmap_dir
;;
'Cleam Args')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Args cleam" \
--reply_markup "$(ShellBot.ReplyKeyboardRemove)" \
--parse_mode markdown
> $arg_nmap_dir
;;
'/keyoff')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Removed" \
--reply_markup "$(ShellBot.ReplyKeyboardRemove)" \
--parse_mode markdown
;;
/*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Invalid commands try /commands"
esac
if [[ ${message_reply_to_message_message_id[$id]} ]]; then
case $message_text in
"nmap"*)
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "What args to NMAP" \
--reply_markup "$(ShellBot.ForceReply)"
;;
'theharvester')
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text 'What args to HARVESTER' \
--reply_markup "$(ShellBot.ForceReply)"
;;
esac
case ${message_reply_to_message_text[$id]} in
*"NMAP"*)
echo $message_text > $arg_nmap_dir
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "seus args são $message_text" \
;;
*"target"*)
echo $message_text > $target_dir
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target = $message_text" \
;;
'PEOPLE - What email or Username?')
echo $message_text > $target_dir_p
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target = $message_text" \
--reply_markup "$keyboard_people" \
--parse_mode markdown
;;
'INFRASTRUCTURE - What IP or domain?')
echo $message_text > $target_dir
ShellBot.sendMessage --chat_id ${message_from_id[$id]} \
--text "Target = $message_text" \
--reply_markup "$keyboard_infrastructure" \
--parse_mode markdown
;;
esac
fi
) &
done
done