Skip to content

Commit

Permalink
Merge pull request #1154 from BenediktMKuehne/jtr-stuff
Browse files Browse the repository at this point in the history
JTR hash sorting
  • Loading branch information
m-1-k-3 committed May 23, 2024
2 parents e661ffd + 98ed251 commit c590aee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/S108_stacs_password_search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ S108_stacs_password_search()
local MESSAGE=""

if command -v stacs > /dev/null ; then
stacs --debug --skip-unprocessable --rule-pack "${STACS_RULES_DIR}"/credential.json "${FIRMWARE_PATH}" 2> "${TMP_DIR}"/stacs.err 1> "${STACS_LOG_FILE}" || true
stacs --skip-unprocessable --rule-pack "${STACS_RULES_DIR}"/credential.json "${FIRMWARE_PATH}" 2> "${TMP_DIR}"/stacs.err 1> "${STACS_LOG_FILE}" || true

if [[ -f "${TMP_DIR}"/stacs.err ]]; then
print_ln
Expand Down
13 changes: 8 additions & 5 deletions modules/S109_jtr_local_pw_cracking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ S109_jtr_local_pw_cracking()
continue
fi

if [[ -f "${LOG_PATH_MODULE}"/jtr_hashes.txt ]]; then
if ! grep -q "${HASH}" "${LOG_PATH_MODULE}"/jtr_hashes.txt; then
print_output "[*] Found password data ${ORANGE}${HASH}${NC} for further processing in ${ORANGE}${HASH_SOURCE}${NC}"
echo "${HASH}" >> "${LOG_PATH_MODULE}"/jtr_hashes.txt
fi
if [[ "${HASH}" == "\$"*"\$"* ]]; then
# put ontop if linux-hash
sed -i "1s/^/${HASH}\n/" "${LOG_PATH_MODULE}"/jtr_hashes.txt
else
print_output "[*] Found password data ${ORANGE}${HASH}${NC} for further processing in ${ORANGE}${HASH_SOURCE}${NC}"
echo "${HASH}" >> "${LOG_PATH_MODULE}"/jtr_hashes.txt
fi
done

# sort and make unique
if [[ -f "${LOG_PATH_MODULE}"/jtr_hashes.txt ]]; then
sort -u --o "${LOG_PATH_MODULE}"/jtr_hashes.txt "${LOG_PATH_MODULE}"/jtr_hashes.txt
fi

if [[ -f "${LOG_PATH_MODULE}"/jtr_hashes.txt ]]; then
print_output "[*] Starting jtr with a runtime of ${ORANGE}${JTR_TIMEOUT}${NC} on the following data:"
tee -a "${LOG_FILE}" < "${LOG_PATH_MODULE}"/jtr_hashes.txt
Expand Down

0 comments on commit c590aee

Please sign in to comment.