Skip to content

Commit

Permalink
Expand regex for nested dirs and double timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryyyyy committed Sep 27, 2023
1 parent 80a24b4 commit 77a04c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ RUN cd /home/turbinia && echo "" > password.lst
RUN cd /home/turbinia && curl -s https://raw.githubusercontent.com/danielmiessler/SecLists/285474cf9bff85f3323c5a1ae436f78acd1cb62c/Passwords/UserPassCombo-Jay.txt >> password.lst
RUN cd /home/turbinia && curl -s https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000000.txt >> password.lst
RUN cp /home/turbinia/password.lst /root/
RUN echo ':\nd' > /home/turbinia/turbinia.rules

# Copy Kubernetes support tool to home folder
COPY --chown=turbinia:turbinia k8s/tools/check-lockfile.py /home/turbinia/check-lockfile.py
Expand Down
2 changes: 2 additions & 0 deletions turbinia/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def bruteforce_password_hashes(

pot_file = os.path.join((tmp_dir or tempfile.gettempdir()), 'hashcat.pot')
password_list_file_path = os.path.expanduser('~/password.lst')
password_rules_file_path = os.path.expanduser('~/turbinia.rules')

# Fallback
if not os.path.isfile(password_list_file_path):
Expand All @@ -193,6 +194,7 @@ def bruteforce_password_hashes(
cmd = cmd + [f'--potfile-path={pot_file}']
cmd = cmd + [
password_hashes_file_path, password_list_file_path]
cmd = cmd + ['-r', password_rules_file_path]

with open(os.devnull, 'w') as devnull:
try:
Expand Down
4 changes: 2 additions & 2 deletions turbinia/workers/analysis/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class JenkinsAnalysisTask(TurbiniaTask):
TASK_CONFIG = {
# This is the length of time in seconds that the collected passwords will
# be bruteforced.
'bruteforce_timeout': 300
'bruteforce_timeout': 600
}

def run(self, evidence, result):
Expand Down Expand Up @@ -72,7 +72,7 @@ def run(self, evidence, result):

jenkins_artifacts = []
jenkins_re = re.compile(
r'^.*jenkins[^\/]*(\/home)?(\/users\/[^\/]+)*\/config\.xml$')
r'^.*?jenkins[^\/]*(\/home)?(\/users)?(\/.*?)\/config\.xml$')
for collected_artifact in collected_artifacts:
if re.match(jenkins_re, collected_artifact):
jenkins_artifacts.append(collected_artifact)
Expand Down

0 comments on commit 77a04c0

Please sign in to comment.