├── .gitignore ├── install.sh ├── README.md └── breach-parse.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *-master.txt 2 | *-passwords.txt 3 | *-users.txt 4 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | uid=$(id -u) 4 | 5 | if [ "$uid" -ne 0 ] 6 | then echo "Error: To install, please run as root (uid 0)." 7 | exit 8 | fi 9 | 10 | cp ./breach-parse.sh ./breach-parse 11 | mv ./breach-parse /usr/local/bin/ 12 | 13 | echo "Installation complete. Usage: $ breach-parse" -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # breach-parse 2 | A tool for parsing breached passwords 3 | 4 | ### Installation 5 | 6 | Install: `sudo ./install.sh` 7 | 8 | Download breached password list from magnet located here: `magnet:?xt=urn:btih:7ffbcd8cee06aba2ce6561688cf68ce2addca0a3&dn=BreachCompilation&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fglotorrents.pw%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337` 9 | 10 | If you don't store the password list (BreachCompilation) in `/opt/breach-parse`, specify the location like: 11 | 12 | `breach-parse @gmail.com gmail.txt "~/Downloads/BreachCompilation/data"` 13 | 14 | Run `breach-parse` for instructions -------------------------------------------------------------------------------- /breach-parse.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ $# -lt 2 ]; then 4 | echo "Breach-Parse v2: A Breached Domain Parsing Tool by Heath Adams" 5 | echo " " 6 | echo "Usage: ./breach-parse.sh [breach data location]" 7 | echo "Example: ./breach-parse.sh @gmail.com gmail.txt" 8 | echo 'Example: ./breach-parse.sh @gmail.com gmail.txt "~/Downloads/BreachCompilation/data"' 9 | echo "You only need to specify [breach data location] if its not in the expected location (/opt/breach-parse/BreachCompilation/data)" 10 | echo " " 11 | echo 'For multiple domains: ./breach-parse.sh "|" ' 12 | echo 'Example: ./breach-parse.sh "@gmail.com|@yahoo.com" multiple.txt' 13 | exit 1 14 | else 15 | if [ $# -ge 4 ]; then 16 | echo 'You supplied more than 3 arguments, make sure to double quote your strings:' 17 | echo 'Example: ./breach-parse.sh @gmail.com gmail.txt "~/Downloads/Temp Files/BreachCompilation"' 18 | exit 1 19 | fi 20 | 21 | # assume default location 22 | breachDataLocation="/opt/breach-parse/BreachCompilation/data" 23 | # check if BreachCompilation was specified to be somewhere else 24 | if [ $# -eq 3 ]; then 25 | if [ -d "$3" ]; then 26 | breachDataLocation="$3" 27 | else 28 | echo "Could not find a directory at ${3}" 29 | echo 'Pass the BreachCompilation/data directory as the third argument' 30 | echo 'Example: ./breach-parse.sh @gmail.com gmail.txt "~/Downloads/BreachCompilation/data"' 31 | exit 1 32 | fi 33 | else 34 | if [ ! -d "${breachDataLocation}" ]; then 35 | echo "Could not find a directory at ${breachDataLocation}" 36 | echo 'Put the breached password list there or specify the location of the BreachCompilation/data as the third argument' 37 | echo 'Example: ./breach-parse.sh @gmail.com gmail.txt "~/Downloads/BreachCompilation/data"' 38 | exit 1 39 | fi 40 | fi 41 | 42 | # set output filenames 43 | fullfile=$2 44 | fbname=$(basename "$fullfile" | cut -d. -f1) 45 | master=$fbname-master.txt 46 | users=$fbname-users.txt 47 | passwords=$fbname-passwords.txt 48 | 49 | touch $master 50 | # count files for progressBar 51 | # -not -path '*/\.*' ignores hidden files/directories that may have been created by the OS 52 | total_Files=$(find "$breachDataLocation" -type f -not -path '*/\.*' | wc -l) 53 | file_Count=0 54 | 55 | function ProgressBar() { 56 | 57 | let _progress=$(((file_Count * 100 / total_Files * 100) / 100)) 58 | let _done=$(((_progress * 4) / 10)) 59 | let _left=$((40 - _done)) 60 | 61 | _fill=$(printf "%${_done}s") 62 | _empty=$(printf "%${_left}s") 63 | 64 | printf "\rProgress : [${_fill// /\#}${_empty// /-}] ${_progress}%%" 65 | 66 | } 67 | 68 | # grep for passwords 69 | find "$breachDataLocation" -type f -not -path '*/\.*' -print0 | while read -d $'\0' file; do 70 | grep -a -E "$1" "$file" >>$master 71 | ((++file_Count)) 72 | ProgressBar ${number} ${total_Files} 73 | 74 | done 75 | fi 76 | 77 | sleep 3 78 | 79 | echo # newline 80 | echo "Extracting usernames..." 81 | awk -F':' '{print $1}' $master >$users 82 | 83 | sleep 1 84 | 85 | echo "Extracting passwords..." 86 | awk -F':' '{print $2}' $master >$passwords 87 | echo 88 | exit 0 89 | --------------------------------------------------------------------------------