Skip to content

Ensure script exits with failure status on failure#10

Open
jsherwood0 wants to merge 1 commit intoTarlogicSecurity:masterfrom
jsherwood0:jsherwood-patch-ensure-failure-exits-as-failure
Open

Ensure script exits with failure status on failure#10
jsherwood0 wants to merge 1 commit intoTarlogicSecurity:masterfrom
jsherwood0:jsherwood-patch-ensure-failure-exits-as-failure

Conversation

@jsherwood0
Copy link

To make this script easily wrappable by other scripts, it should return a failure status when it fails so that logic like the following can work:

# inside loop that iterates through computers in an AD OU
if kerbrute -domain "${DOMNAME}" -user "${COMPNAME}\$" -password "${COMPNAME:0:14}" -dc-ip $DCIP; then
  echo "${COMPNAME} - VULNERABLE - Pre2k default password" | tee -a $OUTFILE
elif kerbrute -domain "${DOMNAME}" -user "${COMPNAME}\$" -password "" -dc-ip $DCIP; then
  echo "${COMPNAME} - VULNERABLE - Blank default password" | tee -a $OUTFILE
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant