Skip to content

Commit

Permalink
{+} setoolkit and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xzan0x7c7 committed Feb 18, 2024
1 parent 7ff2ecb commit 20df70f
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 37 deletions.
14 changes: 10 additions & 4 deletions docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ sudo apt-get -y remove docker \
gnupg \
lsb-release


curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
if [ $1 = jammy ]; then
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
else
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
fi;



sudo apt-get -y update
Expand Down
22 changes: 22 additions & 0 deletions setoolkit/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ ! $(which python3) ] || [ ! $(which pip3) ]; then
echo "No python or pip3 installed";
exit 1;
fi;

if [ -d /setoolkit ]; then
echo "setoolkit is installed already";
exit 1;
fi;

echo "Cloning repo"
git clone https://github.com/trustedsec/social-engineer-toolkit/ /setoolkit;

cd /setoolkit && \
echo "Installing dependencies and running setup on setoolkit/" && \
pip3 install -r requirements.txt && \
python3 setup.py


echo "DONE"
114 changes: 81 additions & 33 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,70 +1,118 @@
#!/bin/bash
# This script is the main point of entry for the tools manager.

set -e

t=(
"admin"
"vim"
"docker"
"python"
"node"
"git"
"tmux"
"osquery"
"setoolkit"
)

if [ $# -lt 1 ]; then
usage;
exit 0
fi

function usage () {
local t=(
"admin"
"vim"
"docker"
"python"
"node"
"git"
"tmux"
"osquery"
)

echo "====================================="
echo "[AUX NUIT]"
echo "$(date)"
echo "Usage ~> ./setup.sh <tool_name>"
echo "====================================="
echo "Options"
echo "====================================="

for s in ${!t[@]}; do
printf ">>> %s\n" "${t[$s]}";
done
}


function execute() {
if [ $1 = services ]; then
local loca="$(pwd)/$1/manager.sh";
else
local loca="$(pwd)/$1/start.sh";
fi;

if [ -x $loca ]; then
local loca="$(pwd)/$1/start.sh";
if [ -f $loca ]; then
echo "{+} Executing $loca";
chmod +x $loca && /bin/bash $loca;
else
echo "{+} $loca not found ...";
fi

exit 0;
}


function delete_service () {
########## Main exception/s ##############
if [ $1 = "tmux" ]; then
rm ~/.tmux.conf
printf "Remove tmux from system: yes/no";
read choice;
echo "$choice";
exit 1;
fi;
########## Run uninstall.sh ##############
local loca="$(pwd)/$1/uninstall.sh";
if [ -f $loca ]; then
echo "{+} Executing $loca"; chmod +x $loca && /bin/bash $loca;
else
echo "{+} $loca not found ...";
fi;
exit 0;
}


function main() {
case $1 in
"vim") execute "vim" ;;
"docker") execute "docker" ;;
"docker") execute "docker" ;;
"node") execute "node" ;;
"python") execute "python" ;;
"osquery") execute "osquery" ;;
"git") execute "git" ;;
"services") execute "services" ;;
"tmux")
if [ -f dot/.tmux.conf ];
then cp dot/.tmux.conf ~/.tmux.conf;
fi
;;
"setoolkit") execute "setoolkit" ;;
"tmux") if [ -f dot/.tmux.conf ]; then cp dot/.tmux.conf ~/.tmux.conf; fi ;;
"--delete") delete_service $2 ;;
*) echo "{+} ...."; usage; exit 0 ;;
esac
}

main $1
#############
# Execution
#############


if [ $# -lt 1 ]; then
usage;
exit 0
fi

if [ $1 = "--delete" ] && [ $# -eq 1 ]; then
echo "Missing service name. Usage: --delete <service-name>" exit 1;
exit 1;
fi;


if [ $# -eq 2 ]; then
for s in ${!t[@]}; do
i=s;
s="${t[$s]}";
if [ $1 = "--delete" ]; then
if [ $2 = $s ]; then
main $1 $2;
fi;
else
echo "Invalid option $1"; exit 1;
fi;
done;
echo "Invalid service to delete => $2"; exit 1;
else
for s in ${!t[@]}; do
i=s;
s="${t[$s]}";
if [ $1 = $s ]; then
main $1;
exit 1;
fi;
done;
echo "Invalid option => $1"; exit 1;
fi;

0 comments on commit 20df70f

Please sign in to comment.