Skip to content

Commit

Permalink
fix(wordlist): crash if ADD_WORDLIST_N_RULES build arg isn't set to true
Browse files Browse the repository at this point in the history
  • Loading branch information
Yimura committed Feb 15, 2024
1 parent 36248cd commit 4b591b6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions wordlists/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ ARG ADD_WORDLIST_N_RULES=false
USER root

WORKDIR /opt/wordlists
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && git clone https://github.com/danielmiessler/SecLists.git --depth 1
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && git clone https://github.com/danielmiessler/SecLists.git --depth 1 ||\
echo "Skip pulling SecLists, ADD_WORDLIST_N_RULES build arg is not set to true"

WORKDIR /opt/rules
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && git clone https://github.com/NotSoSecure/password_cracking_rules.git --depth=1
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && git clone https://github.com/NotSoSecure/password_cracking_rules.git --depth=1 ||\
echo "Skip pulling password_cracking_rules, ADD_WORDLIST_N_RULES build arg is not set to true"

WORKDIR /opt/wordlists
RUN find . -type f -iname '*.tar.gz' -exec tar -xf {} \; -exec rm -f {} \; &&\
find ./SecLists -maxdepth 1 -type d ! -path './SecLists/Passwords' ! -path './SecLists' -exec rm -rf {} \;
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && find . -type f -iname '*.tar.gz' -exec tar -xf {} \; -exec rm -f {} \; &&\
find ./SecLists -maxdepth 1 -type d ! -path './SecLists/Passwords' ! -path './SecLists' -exec rm -rf {} \; ||\
echo "SecLists was not pulled, skipping optimisation step."

WORKDIR /opt/rules
RUN find . -iname '*.rule' -exec mv {} . \; &&\
find . -maxdepth 1 -type d ! -path '.' -exec rm -rf {} \;
RUN [[ "$ADD_WORDLIST_N_RULES" == "true" ]] && find . -iname '*.rule' -exec mv {} . \; &&\
find . -maxdepth 1 -type d ! -path '.' -exec rm -rf {} \; ||\
echo "password_cracking_rules was not pulled, skipping optimisation step."

0 comments on commit 4b591b6

Please sign in to comment.