Skip to content

Instantly share code, notes, and snippets.

@MauroEldritch
Last active March 15, 2019 00:40
Show Gist options
  • Save MauroEldritch/e1f04f1399c561c2683189be9d3e3dce to your computer and use it in GitHub Desktop.
Save MauroEldritch/e1f04f1399c561c2683189be9d3e3dce to your computer and use it in GitHub Desktop.
Cracking Samba passwords with John the ripper
#SAMBA_HASHES => hash.dat
#Output:
#user:{{SSHA}}$HASH
slapcat | awk 'BEGIN{uidFound=0};$1 ~ /^uid:/{uid=$2;uidFound=1};$1 ~ /^userPassword::/
&& uidFound == 1{printf uid":";system("echo " $2 "|base64 -d"); print "";uidFound=0};
$0 == ""{uidFound=0}' > hash.dat
john --incremental hash.dat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment