Created
January 19, 2017 15:29
-
-
Save DoctorD90/762c26e973a00a23abaf3a89e65c330a to your computer and use it in GitHub Desktop.
Bash script to download pastes listed on https://haveibeenpwned.com/Pastes/Latest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pastes="$(curl -s https://haveibeenpwned.com/Pastes/Latest | grep http://pastebin.com/ | sed 's/<a href=\"//g' | sed 's/\">//g')" | |
for link in $pastes; do | |
mkdir -p haveibeenpwned | |
echo "Checking $link" | |
id="$(echo "$link" | sed 's/http:\/\/pastebin.com\///g')" | |
if [ ! -e ./haveibeenpwned/"$id".txt ]; then | |
echo "Downloading . . ." | |
rawlink="$(echo "$link" | sed 's/pastebin.com\//pastebin.com\/raw\//g')" | |
wget -nv -O ./haveibeenpwned/"$id".txt "$rawlink" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment