Skip to content

Commit dc18e5a

Browse files
committed
multi: update init note structure, update webdevlivery cli, update location of utils shell func
1 parent 4757399 commit dc18e5a

File tree

3 files changed

+92
-62
lines changed

3 files changed

+92
-62
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
venv/
22
createhackenv.sh
3+
hosts/
4+
users/
5+
services/
6+
index.md

.vscode/.zshrc

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ if [ "$WEB_DELIVERY_MODE" ]; then
5050
echo "PS: If your terminal can't display this notes properly, you need resize your terminal window."
5151
echo ""
5252
# ProjectDiscovery/SimpleHTTPServer
53-
# simplehttpserver -listen 0.0.0.0:$LISTEN_ON -upload
54-
python3 -m http.server $LISTEN_ON
53+
simplehttpserver -listen 0.0.0.0:$LISTEN_ON -verbose -upload
54+
# python3 -m http.server $LISTEN_ON
5555
exit 0
5656
fi
5757

@@ -87,68 +87,14 @@ if [ "$REVERSE_SHELL_MODE" ]; then
8787
exit 0
8888
fi
8989

90-
91-
# automatically set the AWS environment variables from the json output of `aws sts assume-role`
92-
aws_sts_env () {
93-
if [[ -n "$1" ]]
94-
then
95-
local cred=$1
96-
fi
97-
if [[ -z "$cred" ]]
98-
then
99-
echo "Usage: $0 \`json\`"
100-
echo "Example: export cred=\`aws sts assume-role --role-arn xxxx --role-session-name xxxx|jq ".Credentials"\`"
101-
echo " or get metadata from remote"
102-
echo " export cred=\`curl 169.254.169.254/latest/meta-data/identity-credentials/ec2/security-credentials/ec2-instance\`"
103-
echo " aws_sts_env '[\$cred optional]'"
104-
return
105-
fi
106-
export AWS_ACCESS_KEY_ID=`echo $cred|jq -r '.AccessKeyId' `
107-
export AWS_SECRET_ACCESS_KEY=`echo $cred|jq -r '.SecretAccessKey'`
108-
export AWS_SESSION_TOKEN=`echo $cred|jq -r '(if .SessionToken == null then .Token else .SessionToken end)'`
109-
echo "SET AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN in environment."
110-
unset cred
111-
env | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} AWS | awk '{ print "export " $0 }'
112-
}
113-
114-
# Here is mode if-tree complete, Now will launch the shell
115-
# export SUBDOMAIN_WORDLIST=$SECLIST/Discovery/DNS/bitquark-subdomains-top100000.txt
116-
# pipx install wfuzz
117-
# alias wfuzz=docker run --rm --name wfuzz -v /usr/share/wordlists:/wordlists/ -it ghcr.io/xmendez/wfuzz wfuzz
118-
# usage: alias wfuzz_http_vhost='wfuzz -c -w $SUBDOMAIN_WORDLIST -H "Host: FUZZ.$host" -u "http://$host"'
119-
# usage: alias wfuzz_https_vhost='wfuzz -c -w $SUBDOMAIN_WORDLIST -H "Host: FUZZ.$host" -u "https://$host"'
120-
alias wfuzz=\wfuzz
121-
unset -f wfuzz_vhost_http
122-
function wfuzz_vhost_http () {
123-
local host=$1
124-
local wordlist=$2
125-
if [[ -z $wordlist ]] || [[ -z $host ]]
126-
then
127-
echo "Usage: wfuzz_vhost <host> <wordlist> [wfuzz options]"
128-
return
129-
fi
130-
wfuzz -c -w $wordlist -H "Host: FUZZ.$host" -u "http://$host" $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19
131-
}
132-
133-
unset -f wfuzz_vhost_https
134-
function wfuzz_vhost_https () {
135-
local host=$1
136-
local wordlist=$2
137-
if [[ -z $wordlist ]] || [[ -z $host ]]
138-
then
139-
echo "Usage: wfuzz_vhost <host> <wordlist> [wfuzz options]"
140-
return
141-
fi
142-
wfuzz -c -w $wordlist -H "Host: FUZZ.$host" -u "https://$host" $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19
143-
}
144-
145-
14690
# Start the virtual environment if exists
14791
if [ -d "$PROJECT_FOLDER/venv" ]; then
14892
if [ -n "${VIRTUAL_ENV}" ];then
149-
echo "Virtual Environment is already activated."
150-
echo "Virtual Environment Home: ${VIRTUAL_ENV}"
151-
echo "Trying to deactivate the virtual environment automatically."
93+
# sliently deactivate the virtual environment
94+
95+
# echo "Virtual Environment is already activated."
96+
# echo "Virtual Environment Home: ${VIRTUAL_ENV}"
97+
# echo "Trying to deactivate the virtual environment automatically."
15298

15399
# force deactivate the virtual environment
154100
if [ -n "${_OLD_VIRTUAL_PATH:-}" ]

.vscode/env.zsh

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
4851
export TF_LOG=trace
4952
export 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
102106
export HASH_SHA256CRYPT=7400
103107
export HASH_KRB5_PREAUTH=7500
104108
export 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=\wfuzz
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 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19
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 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19
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

Comments
 (0)