Skip to content

Commit ce44ec8

Browse files
committed
Bug fixes
1 parent 76b451d commit ce44ec8

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

emptyphish.sh

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Emptyphish : Automated Phishing Tool
44
## Author : Waseem Akram
5-
## Version : 3.0
5+
## Version : 3.0.1
66
## Github : https://github.com/evildevill/EmptyPhish
77

88
## Version
9-
__version__="3.0"
9+
__version__="3.0.1"
1010

1111
## DEFAULT HOST & PORT
1212
HOST='127.0.0.1'
@@ -69,28 +69,54 @@ kill_pid() {
6969
pkill -f "php|ngrok|cloudflared|loclx"
7070
}
7171

72-
# Check for a newer release
7372
check_update() {
74-
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Checking for update : "
75-
latest_version=$(curl -s "https://api.github.com/repos/evildevill/emptyphish/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
76-
if [[ $latest_version != "" ]]; then
77-
if [[ $latest_version != $__version__ ]]; then
78-
echo -e "${GREEN}New version available : ${ORANGE}$latest_version${WHITE}"
79-
echo -e "${GREEN}[${WHITE}+${GREEN}]${CYAN} Updating to latest version..."
80-
git pull
81-
echo -e "${GREEN}[${WHITE}+${GREEN}]${CYAN} Update successful."
82-
echo -e "${GREEN}[${WHITE}+${GREEN}]${CYAN} Restarting tool..."
83-
bash emptyphish.sh
84-
exit 0
85-
else
86-
echo -e "${GREEN}No update available."
87-
sleep 1
88-
fi
89-
else
90-
echo -e "${RED}Failed to check for update."
91-
fi
73+
74+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Checking for update : "
75+
relase_url='https://api.github.com/repos/evildevill/EmptyPhish/releases/latest'
76+
new_version=$(curl -s "${relase_url}" | grep '"tag_name":' | awk -F\" '{print $4}')
77+
tarball_url="https://github.com/evildevill/EmptyPhish/archive/refs/tags/${new_version}.tar.gz"
78+
79+
if [[ $new_version != $__version__ ]]; then
80+
echo -ne "${ORANGE}new update found\n"${WHITE}
81+
sleep 2
82+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${ORANGE} Downloading Update..."
83+
pushd "$HOME" >/dev/null 2>&1
84+
curl --silent --insecure --fail --retry-connrefused \
85+
--retry 3 --retry-delay 2 --location --output ".EmptyPhish.tar.gz" "${tarball_url}"
86+
87+
if [[ -e ".EmptyPhish.tar.gz" ]]; then
88+
tar -xf .EmptyPhish.tar.gz -C "$BASE_DIR" --strip-components 1 >/dev/null 2>&1
89+
[ $? -ne 0 ] && {
90+
echo -e "\n\n${RED}[${WHITE}!${RED}]${RED} Error occured while extracting."
91+
reset_color
92+
exit 1
93+
}
94+
rm -f .EmptyPhish.tar.gz
95+
popd >/dev/null 2>&1
96+
{
97+
sleep 3
98+
clear
99+
banner_small
100+
}
101+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}] Successfully updated! Run EmptyPhish again\n\n"${WHITE}
102+
{
103+
reset_color
104+
exit 1
105+
}
106+
else
107+
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error occured while downloading."
108+
{
109+
reset_color
110+
exit 1
111+
}
112+
fi
113+
else
114+
echo -ne "${GREEN}EmptyPhish is already up to date\n${WHITE}"
115+
sleep .5
116+
fi
92117
}
93118

119+
94120
## Check Internet Status
95121
check_status() {
96122
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Internet Status : "

0 commit comments

Comments
 (0)