Skip to content

Instantly share code, notes, and snippets.

@jankcat
Last active August 3, 2019 01:43
Show Gist options
  • Save jankcat/fa81f78c18e4fd882fae3a0aaeb185f0 to your computer and use it in GitHub Desktop.
Save jankcat/fa81f78c18e4fd882fae3a0aaeb185f0 to your computer and use it in GitHub Desktop.
Match user+hash file with pass+hash file
#!/bin/bash
grep . users.txt | while read user; do
echo "$(echo $user | grep -o '^\S*' | grep -v '^$') $(cat pass.txt | grep "$(echo $user | grep -o '\s\S*' | grep -o '\S.*')" | grep -o '^\S*' | grep -v '^$' || echo -e "\033[2K\033[1A")"
done
password1 a1a1a1a1
password4 d2d2d2d2
password2 b1b1b1b1
password3 c1c1c1c1
password5 a1b1c1d2
timwatkins a1a1a1a1
taherazab b1b1b1b1
greg d1d1d1d1
mattdamon c1c1c1c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment