Skip to content

Commit

Permalink
Add HTTP Server
Browse files Browse the repository at this point in the history
  • Loading branch information
01rabbit committed Mar 9, 2023
1 parent b7602a3 commit c604817
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
65 changes: 65 additions & 0 deletions modules/auxiliary/53_kp_httpserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

source kp.conf
source $MODULES_PATH/misc_module.sh

function menu_httpserver(){
clear
figlet Python HTTP Server
num5 0 "Auxiliary"
num3 5 "Python HTTP Server"
num1 10 "Execute"
num9 10 "Back"
read -n 1 -s NUM
case $NUM in
1)
cmd_httpserver
;;
9)
menu_auxiliary
;;
*)
;;
esac
}

function cmd_httpserver(){
clear
figlet Python HTTP Server
printf "┌─(${PURPLE}$TITLE${NC})${RED}${USERNAME}@${HOSTNAME}${NC}:${PURPLE}[5]Auxiliary${NC} > ${YELLOW}[3]Python HTTP Server${NC} > ${RED}[1]Execute${NC}\n"
printf "+${BLUE}positional arguments${NC}:\n"
printf "| ${YELLOW}port${NC}: specify alternate port (default: 8000)\n"
echo "|"
printf "+${BLUE}options${NC}:\n"
printf "| ${YELLOW}-h, --help${NC}: show this help message and exit\n"
printf "| ${YELLOW}--cgi${NC}: run as CGI server\n"
printf "| ${YELLOW}--bind ADDRESS, -b ADDRESS${NC}: specify alternate bind address (default: all interfaces)\n"
printf "| ${YELLOW}--directory DIRECTORY, -d DIRECTORY${NC}: specify alternate directory (default: current directory)\n"
read -p "> Enter the port number. If nothing is entered, the default (8000) is applied.: " PORT
if [ -n "$PORT" ];then
cmd="python3 -m http.server $PORT"
else
cmd="python3 -m http.server"
fi
echo "|"
printf "+${BLUE}usage${NC}: python3 -m http.server ${WHITE}[--cgi] [--bind ADDRESS] [--directory DIRECTORY] [port]${NC}\n"
echo "└─Command > $cmd"
echo ""
echo "> You ready?"
num1 0 "No"
num2 0 "Yes"
read -n 1 -s ANS
echo ""
if [ ! -z "$ANS" ];then
if [ $ANS = "2" ];then
show_number 531 "Python HTTP Server"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0
else
:
fi
else
:
fi
}
5 changes: 5 additions & 0 deletions modules/auxiliary/auxiliarymenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ source kp.conf
source $MODULES_PATH/misc_module.sh
source $AUXILIARY_PATH/51_kp_undercover.sh
source $AUXILIARY_PATH/52_kp_netcat.sh
source $AUXILIARY_PATH/53_kp_httpserver.sh

function menu_auxiliary(){
clear
figlet Auxiliary
num5 0 "Auxiliary"
num1 5 "kali-undercover"
num2 5 "Netcat"
num3 5 "Python HTTP Server"
num9 5 "Main"
read -n 1 -s NUM
case $NUM in
Expand All @@ -20,6 +22,9 @@ function menu_auxiliary(){
2)
menu_netcat
;;
3)
menu_httpserver
;;
9)
mainmenu
;;
Expand Down

0 comments on commit c604817

Please sign in to comment.