samba

SHA1 search (linkedin passwords)

Jun 6th, 2012
2,842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.86 KB | None | 0 0
  1. #!/bin/sh
  2. # sha1check.sh
  3.  
  4. # USAGE:
  5. # Download this file: http://dl.dropbox.com/u/83742553/combo_not.txt (using CURL)
  6. # Write your passwords (the ones you think might be stolen) to a file, one per line  >> mypasswords.txt
  7. # Call this script...
  8. # ~/sha1check.sh /path/to/combo_not.txt mypasswords.txt
  9.  
  10.  
  11.  
  12. SRCFILE=$1;
  13. PSDFILE=$2;
  14. TMPFILE=`mktemp /tmp/shasums.XXXXX`
  15.  
  16.  
  17. # First, collect all the SHA1 checksum suffixes
  18. # This is an optimization for grep, which can use a source file of simple patterns to make one pass over the search.
  19. while read password; do
  20.   echo "$password" | tr -d '\n' | shasum | cut -c 6-40
  21. done < $PSDFILE > $TMPFILE
  22.  
  23. # Show the user what hash suffixes are applicable
  24. echo '# Searching for...'
  25. cat $TMPFILE
  26.  
  27. # Run the search...
  28. grep -f $TMPFILE  $SRCFILE
  29. # If this prints anything, your password has probably been stolen.
  30.  
  31. rm $TMPFILE
Advertisement
Add Comment
Please, Sign In to add comment