-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
113 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |