42 lines
1.0 KiB
Bash
Executable File
42 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
script_dir="$(dirname $(realpath $0))"
|
|
passwd_file="${script_dir}/files/password.list"
|
|
|
|
if [[ ! -f "$passwd_file" ]] ; then
|
|
echo ""
|
|
echo -e " [ \033[31m\033[1mFatal\033[m ] File '$passwd_file' not found!"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
|
|
#imap_server="imap.so36.net"
|
|
imap_server="localhost"
|
|
|
|
if [[ $imap_server =~ ^127\.0\.0\.1 ]] || [[ $imap_server =~ ^localhost ]]; then
|
|
imap_protocol="imap"
|
|
else
|
|
imap_protocol="imaps"
|
|
fi
|
|
|
|
echo ""
|
|
set +H
|
|
while IFS=':' read -r email passwd || [[ -n $email ]] ; do
|
|
|
|
[[ $email =~ ^\s*$ ]] && continue
|
|
[[ $email =~ ^\s*# ]] && continue
|
|
|
|
echo -en " Test given password for email \033[1m$email\\033[m .."
|
|
curl --url "${imap_protocol}://${imap_server}" --user "${email}:${passwd}" > /dev/null 2>&1
|
|
if [[ $? -eq 0 ]]; then
|
|
echo -e "\033[1G [ \033[31m\033[1mWarning\033[m ]: Password for \033[1m$email\033[m is unsafe!"
|
|
else
|
|
echo -e "\033[1G [ \033[32mOk\033[m ]: Password for '$email' does not match password list."
|
|
fi
|
|
|
|
done < "$passwd_file"
|
|
set -H
|
|
echo ""
|
|
|
|
exit 0
|