diff options
| author | thomas grothe <thomas@debian> | 2023-10-23 21:24:32 -0500 |
|---|---|---|
| committer | thomas grothe <thomas@debian> | 2023-10-23 21:24:32 -0500 |
| commit | 7ba2f6677e74c86f3e226b5b1f21ff9a26a29b04 (patch) | |
| tree | 88fb55ac6aad1a9c0b20f9beb4992a4c1a360ffe /pass2txt.sh | |
| parent | eb4c8e463adab15ea91127412cdbe0464ca76343 (diff) | |
starting some server security scripts. and making a script to extract passwords from pass db into plaintext
Diffstat (limited to 'pass2txt.sh')
| -rwxr-xr-x | pass2txt.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pass2txt.sh b/pass2txt.sh new file mode 100755 index 0000000..6317feb --- /dev/null +++ b/pass2txt.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +#this script will take the passwords from the "pass" databaes (~/.password) and outputs them into a text file + +passdb=`realpath ~/.password-store/` +outfile="./passwords-in-plaintext.txt" +if [[ $1 ]]; then + outfile="$1" +fi +echo "reading from "${passdb} +echo "and writing to "${outfile} + + +for f in `find ${passdb} | grep \.gpg`; do + echo $f >> ${outfile} + pass `echo $f | sed 's/\.gpg//g'` >> ${outfile} + echo "" >> ${outfile} +done + |
