This commit is contained in:
2023-08-17 22:29:18 -05:00
parent 81765724cc
commit 2994e240b5
7 changed files with 297 additions and 43 deletions

59
tools/imap_pop3_test.sh Normal file
View File

@ -0,0 +1,59 @@
#!/bin/bash
get_tool_name() {
echo "IMAP and POP3 Accessibility Checker"
}
get_tool_description() {
echo "Check IMAP and POP3 accessibility for a domain"
}
execute_tool() {
result=""
if [ -n "$domain" ]; then
if [[ "$domain" == *$'\n'* ]]; then
for single_domain in $domain; do
process_domain "$single_domain"
done
else
process_domain "$domain"
fi
else
result="No domains specified."
fi
echo -e "$result"
}
process_domain() {
local single_domain="$1"
mx_record=$(dig +short MX "$single_domain" | sort -n | head -n 1 | awk '{print $2}')
if [ -z "$mx_record" ]; then
mx_record="$single_domain"
fi
if command -v telnet &> /dev/null; then
imap143_status=$(timeout 10 telnet "$mx_record" 143 <<< "quit" > /dev/null 2>&1 && echo "Connected" || echo "Failed")
imap993_status=$(timeout 10 telnet "$mx_record" 993 <<< "quit" > /dev/null 2>&1 && echo "Connected" || echo "Failed")
pop3110_status=$(timeout 10 telnet "$mx_record" 110 <<< "quit" > /dev/null 2>&1 && echo "Connected" || echo "Failed")
pop3995_status=$(timeout 10 telnet "$mx_record" 995 <<< "quit" > /dev/null 2>&1 && echo "Connected" || echo "Failed")
elif command -v nc &> /dev/null; then
imap143_status=$(timeout 10 nc -z "$mx_record" 143 > /dev/null 2>&1 && echo "Connected" || echo "Failed")
imap993_status=$(timeout 10 nc -z "$mx_record" 993 > /dev/null 2>&1 && echo "Connected" || echo "Failed")
pop3110_status=$(timeout 10 nc -z "$mx_record" 110 > /dev/null 2>&1 && echo "Connected" || echo "Failed")
pop3995_status=$(timeout 10 nc -z "$mx_record" 995 > /dev/null 2>&1 && echo "Connected" || echo "Failed")
else
result+="\e[1mDomain:\e[0m $single_domain\n"
result+="\e[1mIMAP Accessibility:\e[0m Netcat and Telnet not available.\n"
result+="\e[1mPOP3 Accessibility:\e[0m Netcat and Telnet not available.\n"
return
fi
result+="\e[1mDomain:\e[0m $single_domain\n"
result+="\e[1mIMAP Accessibility (Port 143):\e[0m $imap143_status\n"
result+="\e[1mIMAP Accessibility (Port 993):\e[0m $imap993_status\n"
result+="\e[1mPOP3 Accessibility (Port 110):\e[0m $pop3110_status\n"
result+="\e[1mPOP3 Accessibility (Port 995):\e[0m $pop3995_status\n"
}

41
tools/load_time_test.sh Normal file
View File

@ -0,0 +1,41 @@
#!/bin/bash
get_tool_name() {
echo "Website Load Time Tester"
}
get_tool_description() {
echo "Test website load times using HTTP requests"
}
execute_tool() {
result=""
if [ -n "$domain" ]; then
if [[ "$domain" == *$'\n'* ]]; then
for single_domain in $domain; do
process_domain "$single_domain"
done
else
process_domain "$domain"
fi
else
result="No domains specified."
fi
echo -e "$result"
}
process_domain() {
local single_domain="$1"
result+="\e[1mDomain:\e[0m $single_domain\n"
# Measure initial server response time using curl
response_time=$(curl -o /dev/null -s -w "%{time_starttransfer}\n" "$single_domain")
# Measure fully loaded time using curl
fully_loaded_time=$(curl -o /dev/null -s -w "%{time_total}\n" "$single_domain")
result+="\e[1mInitial Server Response Time:\e[0m $response_time seconds\n"
result+="\e[1mFully Loaded Time:\e[0m $fully_loaded_time seconds\n"
}

View File

@ -33,9 +33,9 @@ process_domain() {
ports_status=""
for port in $smtp_ports; do
if nc -z -w3 "$mx_record" "$port"; then
ports_status+="\e[32m$port: \e[1mSuccess\e[0m "
ports_status+="\e[0m$port: \e[32mSuccess\e[0m "
else
ports_status+="\e[31m$port: \e[1mError\e[0m "
ports_status+="\e[0m$port: \e[31mError\e[0m "
fi
done
result+="\e[1mMX Hostname Tested:\e[0m $mx_record \e[1mPorts:\e[0m $ports_status\n"