Skip to content

Instantly share code, notes, and snippets.

@haxcited
Created February 11, 2021 06:24
Show Gist options
  • Save haxcited/e684df7f9ec210867d25f7ccac22c1d5 to your computer and use it in GitHub Desktop.
Save haxcited/e684df7f9ec210867d25f7ccac22c1d5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "Enter name of the program: "
read PROGNAME
echo "enter name of the seed domain for amass "
read SEED
BOUNTYD=$HOME/01/bounty
PLATFORM=h1
# create project directory
# ascr auto screenshot ,mscr manual screenshot
# bu folderlari listeden alsin mi?
PROGD=$BOUNTYD/$PLATFORM/$PROGNAME
if [[ -d "$PROGD" ]]
then
echo "$PROGD exists, skipping creation..."
else
mkdir -p $PROGD/{amass,masscan,nmap,scrshot,burpfiles,downloads} &&
echo "Directories created."
fi
cd $PROGD &&
# copy and create some files -> hardcoded find a better way
cp $BOUNTYD/03-temp-amass-conf.ini $PROGD/amass/amass-conf-$PROGNAME.ini &&
cp $BOUNTYD/03-temp-bounty-checks.org $PROGD/00-checks-$PROGNAME.org
cp $BOUNTYD/03-temp-bounty-notes.org $PROGD/01-notes-$PROGNAME.org
cp $BOUNTYD/03-temp-bounty-oneliners.sh $PROGD/02-oneliners-$PROGNAME.sh
cp $BOUNTYD/03-temp-tmux.sh $PROGD/02-tmux-$PROGNAME.sh && chmod +x $PROGD/02-tmux-$PROGNAME.sh
# seek and destroy array
declare -A srarray
srarray=(
[%%PROG_NAME%%]=$PROGNAME
[%%SEED_DOMA%%]=$SEED
)
# search and destroy loop
sd() {
# Loop the sd array
for i in "${!srarray[@]}"
do
search=${i}
destroy=${srarray[$i]}
sed -i "s/${search}/${destroy}/g" $PROGD/amass/amass-conf-$PROGNAME.ini
sed -i "s/${search}/${destroy}/g" $PROGD/02-oneliners-$PROGNAME.sh
sed -i "s/${search}/${destroy}/g" $PROGD/02-tmux-$PROGNAME.sh
done
}
# search and destroy function call
sd
# burayi bitirince tmux session ac
$PROGD/02-tmux-$PROGNAME.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment