Guest User

Untitled

a guest
Nov 26th, 2019
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env bash
  2. echo "[*] Script started"
  3. input="pdf_list.txt"
  4. keyword=$1
  5. output=$2
  6.  
  7. echo "[*] Finding all possible pdf files"
  8. find . -type f -name "*.pdf" > "$input"
  9.  
  10. echo "[*] PDF files found and saved in '"$input"'"
  11. cat "$input"
  12.  
  13. echo "[*] Finding possible emails"
  14. while IFS= read -r line
  15. do
  16.  
  17.     pdftotext "$line" - | grep "$keyword" >> tmp_list.txt
  18.     grep -i -o '[A-Z0-9._%+-]\+@[A-Z0-9.-]\+\.[A-Z]\{2,4\}' tmp_list.txt >> tmp_final.txt
  19.     #sort -u tmp_final.txt > final_list.txt
  20.     sort -u tmp_final.txt > "$output"
  21.  
  22. done < "$input"
  23.  
  24. echo "[*] Emails found and saved in $output"
  25. echo "[*] Cleaning up"
  26. rm -f tmp_list.txt && rm -f tmp_final.txt && rm -f "$input"
  27. echo "[*] Done"
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×