@@ -44,6 +44,9 @@ export METASPLOIT_INIT_COMMAND=""
4444# export MINIO_ENDPOINT=
4545# export MC_HOST_myminio=http://${MINIO_ROOT_USER}:${MINIO_ROOT_PASSWORD}@${MINIO_ENDPOINT}
4646
47+ # Kubernetes settings
48+ # export KUBECONFIG=${PROJECT_FOLDER}/kubeconfig
49+
4750# Terraform settings
4851export TF_LOG=trace
4952export TF_LOG_PATH=$PROJECT_FOLDER /terraform.log
@@ -86,6 +89,7 @@ unset https_proxy http_proxy all_proxy
8689# useful settings like ROCKYOU, SECLIST, etc.
8790# export ROCKYOU=/usr/share/wordlists/rockyou.txt
8891# export SECLIST=/usr/share/wordlists/seclists/
92+ # export TOP_DNS=${SECLIST}/Discovery/DNS/bitquark-subdomains-top100000.txt
8993# export WORDLISTS=/usr/share/wordlists/
9094
9195# URL: https://hashcat.net/wiki/doku.php?id=example_hashes
@@ -102,4 +106,80 @@ export HASH_NETNTLMv2=5600
102106export HASH_SHA256CRYPT=7400
103107export HASH_KRB5_PREAUTH=7500
104108export HASH_DJANGO_PBKDF2_SHA256=10000
105- export HASH_PBKDF2_HMAC_SHA256=10900
109+ export HASH_PBKDF2_HMAC_SHA256=10900
110+
111+
112+ # utils functions
113+
114+ # automatically set the AWS environment variables from the json output of `aws sts assume-role`
115+ aws_sts_env () {
116+ if [[ -n " $1 " ]]
117+ then
118+ local cred=$1
119+ fi
120+ if [[ -z " $cred " ]]
121+ then
122+ echo " Usage: $0 \` json\` "
123+ echo " Example: export cred=\` aws sts assume-role --role-arn xxxx --role-session-name xxxx|jq " .Credentials" \` "
124+ echo " or get metadata from remote"
125+ echo " export cred=\` curl 169.254.169.254/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance\` "
126+ echo " aws_sts_env '[\$ cred optional]'"
127+ return
128+ fi
129+ export AWS_ACCESS_KEY_ID=` echo $cred | jq -r ' .AccessKeyId' `
130+ export AWS_SECRET_ACCESS_KEY=` echo $cred | jq -r ' .SecretAccessKey' `
131+ export AWS_SESSION_TOKEN=` echo $cred | jq -r ' (if .SessionToken == null then .Token else .SessionToken end)' `
132+ echo " SET AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN in environment."
133+ unset cred
134+ env | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} AWS | awk ' { print "export " $0 }'
135+ }
136+
137+ # Here is mode if-tree complete, Now will launch the shell
138+ # export SUBDOMAIN_WORDLIST=$SECLIST/Discovery/DNS/bitquark-subdomains-top100000.txt
139+ # pipx install wfuzz
140+ # alias wfuzz=docker run --rm --name wfuzz -v /usr/share/wordlists:/wordlists/ -it ghcr.io/xmendez/wfuzz wfuzz
141+ # usage: alias wfuzz_http_vhost='wfuzz -c -w $SUBDOMAIN_WORDLIST -H "Host: FUZZ.$host" -u "http://$host"'
142+ # usage: alias wfuzz_https_vhost='wfuzz -c -w $SUBDOMAIN_WORDLIST -H "Host: FUZZ.$host" -u "https://$host"'
143+ alias wfuzz=\w fuzz
144+ # unset -f wfuzz_vhost_http
145+ function wfuzz_vhost_http () {
146+ local host=$1
147+ local wordlist=$2
148+ if [[ -z $wordlist ]] || [[ -z $host ]]
149+ then
150+ echo " Usage: wfuzz_vhost <host> <wordlist> [wfuzz options]"
151+ return
152+ fi
153+ wfuzz -c -w $wordlist -H " Host: FUZZ.$host " -u " http://$host " $3 $4 $5 $6 $7 $8 $9 $1 0 $1 1 $1 2 $1 3 $1 4 $1 5 $1 6 $1 7 $1 8 $1 9
154+ }
155+
156+ unset -f wfuzz_vhost_https
157+ function wfuzz_vhost_https () {
158+ local host=$1
159+ local wordlist=$2
160+ if [[ -z $wordlist ]] || [[ -z $host ]]
161+ then
162+ echo " Usage: wfuzz_vhost <host> <wordlist> [wfuzz options]"
163+ return
164+ fi
165+ wfuzz -c -w $wordlist -H " Host: FUZZ.$host " -u " https://$host " $3 $4 $5 $6 $7 $8 $9 $1 0 $1 1 $1 2 $1 3 $1 4 $1 5 $1 6 $1 7 $1 8 $1 9
166+ }
167+
168+ function create_project_structure () {
169+ if [ -f " index.md" ]; then # lock the project folder
170+ return
171+ fi
172+ mkdir -p $PROJECT_FOLDER /{hosts,users,services}
173+ touch $PROJECT_FOLDER /hosts/host-list.md
174+ touch $PROJECT_FOLDER /users/user-list.md
175+ touch $PROJECT_FOLDER /services/service-list.md
176+ touch $PROJECT_FOLDER /index.md
177+ echo " Project Folder sturcture created completed!"
178+ }
179+ create_project_structure
180+ unset -f create_project_structure
181+
182+ function clean_project_structure () {
183+ rm -rf $PROJECT_FOLDER /{hosts,users,services} $PROJECT_FOLDER /index.md
184+ echo " Project Folder sturcture cleaned completed!"
185+ }
0 commit comments