From 1b877333cac92cfbec5a94213b8d6820ccb12920 Mon Sep 17 00:00:00 2001 From: lilfade Date: Thu, 17 Aug 2023 12:21:31 -0500 Subject: [PATCH] initial commit --- domains.txt | 34 +++++++++ entry.sh | 110 ++++++++++++++++++++++++++++ entry.sh.old | 89 ++++++++++++++++++++++ tools/cache_poison_test.sh.unloaded | 41 +++++++++++ tools/dns_health_check.sh | 79 ++++++++++++++++++++ tools/dns_propagation_check.sh | 45 ++++++++++++ tools/dns_server_comparison.sh | 45 ++++++++++++ tools/dnssec_validation.sh | 45 ++++++++++++ tools/domain_blacklist_check.sh | 43 +++++++++++ tools/domain_txt_check.sh.unloaded | 61 +++++++++++++++ tools/http_status_check.sh | 63 ++++++++++++++++ tools/rdns_check.sh | 41 +++++++++++ tools/smtp_test.sh | 45 ++++++++++++ tools/traffic_analyzer.sh.unloaded | 40 ++++++++++ 14 files changed, 781 insertions(+) create mode 100644 domains.txt create mode 100755 entry.sh create mode 100755 entry.sh.old create mode 100644 tools/cache_poison_test.sh.unloaded create mode 100644 tools/dns_health_check.sh create mode 100644 tools/dns_propagation_check.sh create mode 100644 tools/dns_server_comparison.sh create mode 100644 tools/dnssec_validation.sh create mode 100644 tools/domain_blacklist_check.sh create mode 100644 tools/domain_txt_check.sh.unloaded create mode 100644 tools/http_status_check.sh create mode 100644 tools/rdns_check.sh create mode 100755 tools/smtp_test.sh create mode 100644 tools/traffic_analyzer.sh.unloaded diff --git a/domains.txt b/domains.txt new file mode 100644 index 0000000..0023b77 --- /dev/null +++ b/domains.txt @@ -0,0 +1,34 @@ +fadedinnovations.us +nocartmart.com +blazed.network +blazed.social +growers.social +fadedgaming.co +whitedog.tech +childoutfitter.com +feign.fun +catsays.click +thekittysays.icu +trevino.properties +theserver.icu +tsi.icu +dataharvest.social +tsh.wtf +tsh.zone +tsh.systems +lacounty.homes +los.homes +theserver.click +theserver.network +theserver.monster +eternalpaws.com +transmissionhub.info +faded.house +1104beachwood.com +growersverse.social +growersverse.com +faded.network +thegardencouple.com +thecreepingvine.com +allpetsafe.com +102streetphotos.com diff --git a/entry.sh b/entry.sh new file mode 100755 index 0000000..e994079 --- /dev/null +++ b/entry.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +TOOLS_DIR="tools" +declare -A tool_scripts +declare -A tool_outputs +domain="" + +# Load tool scripts and previous outputs +index=1 +for tool_script in $(ls "$TOOLS_DIR"/*.sh); do + source "$tool_script" + tool_name=$(get_tool_name) + tool_scripts["$index"]=$tool_script + tool_outputs["$index"]="${tool_outputs["$index"]}" + index=$((index + 1)) +done + +# Main menu loop +while true; do + echo "Available tools:" + echo "[D] Add domain or file of domains" + for number in $(seq 1 ${#tool_scripts[@]}); do + source "${tool_scripts[$number]}" + tool_name=$(get_tool_name) + echo "[$number] $tool_name" + done + echo "[A] Run all tools against the loaded domain" + echo "[0] Exit and Print Output" + + read -p "Enter the number of the tool to execute (0 to exit): " choice + + if [ "$choice" == "D" ] || [ "$choice" == "d" ]; then + echo "Choose an option to load domains:" + echo "[1] Load domains from domains.txt" + echo "[2] Load a single domain" + + read -p "Enter the number of the option: " load_choice + + if [ "$load_choice" -eq 1 ]; then + if [ -f "domains.txt" ]; then + read -p "Do you want to load domains from domains.txt? (y/n): " confirm + if [ "$confirm" == "y" ]; then + domain=$(cat "domains.txt") + echo "Loaded domains from domains.txt." + fi + else + read -p "Enter the path to the domains.txt file: " domains_file + if [ -f "$domains_file" ]; then + domain=$(cat "$domains_file") + echo "Loaded domains from $domains_file." + else + echo "File not found: $domains_file" + fi + fi + elif [ "$load_choice" -eq 2 ]; then + read -p "Enter a single domain: " single_domain + domain="$single_domain" + echo "Added single domain: $domain" + else + echo "Invalid option: $load_choice" + fi + elif [ "$choice" == "A" ] || [ "$choice" == "a" ]; then + if [ -z "$domain" ]; then + echo "No domain loaded. Please load a domain first." + else + for number in $(seq 1 ${#tool_scripts[@]}); do + if [ "${tool_scripts[$number]}" ]; then + selected_script="${tool_scripts[$number]}" + source "$selected_script" + tool_output=$(execute_tool) + tool_outputs["$number"]="$tool_output" + echo "Tool $number executed." + fi + done + echo -e "\nResults:" + for number in $(seq 1 ${#tool_scripts[@]}); do + if [ "${tool_outputs["$number"]}" ]; then + source "${tool_scripts[$number]}" + tool_name=$(get_tool_name) + echo "Tool: $tool_name" + echo -e "${tool_outputs["$number"]}" + echo "------------------------------------" + fi + done + exit + fi + elif [[ "$choice" =~ ^[0-9]+$ ]]; then + if [ "$choice" -eq 0 ]; then + echo -e "\nResults:" + for number in $(seq 1 ${#tool_scripts[@]}); do + if [ "${tool_outputs["$number"]}" ]; then + echo "Tool $number Output:" + echo -e "${tool_outputs["$number"]}" + echo "------------------------------------" + fi + done + exit + elif [ "${tool_scripts[$choice]}" ]; then + selected_script="${tool_scripts[$choice]}" + source "$selected_script" + tool_output=$(execute_tool) + tool_outputs["$choice"]+="$tool_output" + echo "Tool $choice executed." + else + echo "Invalid tool number: $choice" + fi + else + echo "Invalid input." + fi +done diff --git a/entry.sh.old b/entry.sh.old new file mode 100755 index 0000000..2076bff --- /dev/null +++ b/entry.sh.old @@ -0,0 +1,89 @@ +#!/bin/bash + +TOOLS_DIR="tools" +declare -A tool_scripts +declare -A tool_outputs +domain="" + +# Load tool scripts and previous outputs +index=1 +for tool_script in $(ls "$TOOLS_DIR"/*.sh); do + source "$tool_script" + tool_name=$(get_tool_name) + tool_scripts["$index"]=$tool_script + tool_outputs["$index"]="${tool_outputs["$index"]}" + index=$((index + 1)) +done + +# Main menu loop +while true; do + echo "Available tools:" + echo "[D] Add domain or file of domains" + for number in $(seq 1 ${#tool_scripts[@]}); do + source "${tool_scripts[$number]}" + tool_name=$(get_tool_name) + echo "[$number] $tool_name" + done + echo "[0] Exit and Print Output" + + read -p "Enter the number of the tool to execute (0 to exit): " choice + + if [ "$choice" == "D" ] || [ "$choice" == "d" ]; then + echo "Choose an option to load domains:" + echo "[1] Load domains from domains.txt" + echo "[2] Load a single domain" + echo "[3] Load multiple single domains" + + read -p "Enter the number of the option: " load_choice + + if [ "$load_choice" -eq 1 ]; then + if [ -f "domains.txt" ]; then + read -p "Do you want to load domains from domains.txt? (y/n): " confirm + if [ "$confirm" == "y" ]; then + domain=$(cat "domains.txt") + echo "Loaded domains from domains.txt." + fi + else + read -p "Enter the path to the domains.txt file: " domains_file + if [ -f "$domains_file" ]; then + domain=$(cat "$domains_file") + echo "Loaded domains from $domains_file." + else + echo "File not found: $domains_file" + fi + fi + elif [ "$load_choice" -eq 2 ]; then + read -p "Enter a single domain: " single_domain + domain="$single_domain" + echo "Added single domain: $domain" + elif [ "$load_choice" -eq 3 ]; then + read -p "Enter multiple single domains (separated by spaces): " multiple_domains + domain="$multiple_domains" + echo "Added multiple single domains: $domain" + else + echo "Invalid option: $load_choice" + fi + elif [[ "$choice" =~ ^[0-9]+$ ]]; then + if [ "$choice" -eq 0 ]; then + echo -e "\nResults:" + for number in $(seq 1 ${#tool_scripts[@]}); do + if [ "${tool_outputs["$number"]}" ]; then + echo "Tool $number Output:" + echo -e "${tool_outputs["$number"]}" + echo "------------------------------------" + fi + done + exit + elif [ "${tool_scripts[$choice]}" ]; then + selected_script="${tool_scripts[$choice]}" + source "$selected_script" + tool_output=$(execute_tool) + tool_outputs["$choice"]+="$tool_output" + echo "Tool $choice executed." + else + echo "Invalid tool number: $choice" + fi + else + echo "Invalid input." + fi +done diff --git a/tools/cache_poison_test.sh.unloaded b/tools/cache_poison_test.sh.unloaded new file mode 100644 index 0000000..4e86aff --- /dev/null +++ b/tools/cache_poison_test.sh.unloaded @@ -0,0 +1,41 @@ +#!/bin/bash + +get_tool_name() { + echo "DNS Cache Poisoning Tester" +} + +get_tool_description() { + echo "Test DNS cache poisoning vulnerability on a domain or domains" +} + +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" + + ns1_result=$(dig +short @"$single_domain" "$single_domain") + ns2_result=$(dig +short @"$single_domain" "$single_domain") + + if [ "$ns1_result" == "$ns2_result" ]; then + result+="\e[1mCache Poisoning:\e[0m Vulnerable\n" + else + result+="\e[1mCache Poisoning:\e[0m Not Vulnerable\n" + fi +} diff --git a/tools/dns_health_check.sh b/tools/dns_health_check.sh new file mode 100644 index 0000000..1821221 --- /dev/null +++ b/tools/dns_health_check.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +get_tool_name() { + echo "DNS Health Check" +} + +get_tool_description() { + echo "Comprehensive health check of a domain's DNS configuration" +} + +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" + + # Check for A Record + a_record=$(dig +short A "$single_domain") + if [ -n "$a_record" ]; then + result+="\e[1mA Record:\e[0m $a_record\n" + else + result+="\e[1mA Record:\e[0m \e[31mMissing\e[0m\n" + fi + + # Check for MX Record + mx_records=$(dig +short MX "$single_domain" | cut -d " " -f 2) + if [ -n "$mx_records" ]; then + result+="\e[1mMX Records:\e[0m $mx_records\n" + else + result+="\e[1mMX Records:\e[0m \e[31mMissing\e[0m\n" + fi + + # Check for TXT Record (SPF) + spf_record=$(dig +short TXT "$single_domain" | grep "v=spf1") + if [ -n "$spf_record" ]; then + result+="\e[1mSPF Record:\e[0m $spf_record\n" + else + result+="\e[1mSPF Record:\e[0m \e[31mMissing\e[0m\n" + fi + + # Check for TXT Record (DMARC) + dmarc_record=$(dig +short TXT "_dmarc.$single_domain" | grep "v=DMARC1") + if [ -n "$dmarc_record" ]; then + result+="\e[1mDMARC Record:\e[0m $dmarc_record\n" + else + result+="\e[1mDMARC Record:\e[0m \e[31mMissing\e[0m\n" + fi + + # Check for TXT Record (DKIM) + # Check DKIM records + dkim_record=$(dig +short TXT "default._domainkey.$single_domain") + if [ -n "$dkim_record" ]; then + result+="\e[1mDKIM Record:\e[0m $dkim_record\n" + else + result+="\e[1mDKIM Record:\e[0m \e[31mNo DKIM record found\e[0m\n" + fi + + # Check DNS Resolution Delay + dns_resolution_delay=$(ping -c 5 "$single_domain" | tail -1 | awk '{print $4}' | cut -d '/' -f 2) + if [ -n "$dns_resolution_delay" ]; then + result+="\e[1mDNS Resolution Delay:\e[0m $dns_resolution_delay ms\n" + fi +} diff --git a/tools/dns_propagation_check.sh b/tools/dns_propagation_check.sh new file mode 100644 index 0000000..9389f12 --- /dev/null +++ b/tools/dns_propagation_check.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# List of DNS servers from different locations +DNS_SERVERS=("8.8.8.8" "1.1.1.1" "9.9.9.9" "208.67.222.222") + +get_tool_name() { + echo "DNS Propagation Check" +} + +get_tool_description() { + echo "Check DNS propagation across various DNS servers worldwide" +} + +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" + + for dns_server in "${DNS_SERVERS[@]}"; do + response=$(dig "@$dns_server" "$single_domain" +short) + + if [ -n "$response" ]; then + result+="\e[1mDNS Server ($dns_server):\e[0m $response\n" + else + result+="\e[1mDNS Server ($dns_server):\e[0m \e[31mFailed\e[0m\n" + fi + done +} diff --git a/tools/dns_server_comparison.sh b/tools/dns_server_comparison.sh new file mode 100644 index 0000000..945198c --- /dev/null +++ b/tools/dns_server_comparison.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# List of DNS servers to compare +DNS_SERVERS=("8.8.8.8" "1.1.1.1" "9.9.9.9" "208.67.222.222") + +get_tool_name() { + echo "DNS Server Comparison" +} + +get_tool_description() { + echo "Compare DNS server performance in terms of speed and reliability" +} + +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" + + for dns_server in "${DNS_SERVERS[@]}"; do + response_time=$(dig "@$dns_server" "$single_domain" +stats +time=1 | grep "Query time:" | awk '{print $4}') + + if [ -n "$response_time" ]; then + result+="\e[1mDNS Server:\e[0m $dns_server \e[1mResponse Time:\e[0m ${response_time}ms\n" + else + result+="\e[1mDNS Server:\e[0m $dns_server \e[1mResponse Time:\e[0m \e[31mFailed\e[0m\n" + fi + done +} diff --git a/tools/dnssec_validation.sh b/tools/dnssec_validation.sh new file mode 100644 index 0000000..f000c13 --- /dev/null +++ b/tools/dnssec_validation.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# List of open DNS servers for testing +DNS_SERVERS=("8.8.8.8" "1.1.1.1" "9.9.9.9" "208.67.222.222") + +get_tool_name() { + echo "DNSSEC Validation" +} + +get_tool_description() { + echo "Verify DNSSEC signatures 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" + + result+="\e[1mDomain:\e[0m $single_domain\n" + + for dns_server in "${DNS_SERVERS[@]}"; do + dnssec_status=$(delv @"$dns_server" +dnssec +nocomments +nocl "$single_domain" 2>&1 | head -n 1) + + if echo "$dnssec_status" | grep -q "; fully validated"; then + result+="\e[1mDNS Server ($dns_server):\e[0m \e[32mFully Validated\e[0m\n" + else + result+="\e[1mDNS Server ($dns_server):\e[0m \e[31mNot Fully Validated\e[0m\n" + fi + done +} diff --git a/tools/domain_blacklist_check.sh b/tools/domain_blacklist_check.sh new file mode 100644 index 0000000..3151eb4 --- /dev/null +++ b/tools/domain_blacklist_check.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +get_tool_name() { + echo "Domain Blacklist Check" +} + +get_tool_description() { + echo "Check domains against well-known blacklists" +} + +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" + blacklists=("zen.spamhaus.org" "bl.spamcop.net" "b.barracudacentral.org") + + result+="\e[1mDomain:\e[0m $single_domain\n" + + for blacklist in "${blacklists[@]}"; do + if nslookup "$single_domain.$blacklist" > /dev/null; then + result+="\e[1m$blacklist:\e[0m \e[31mFailed\e[0m\n" + else + result+="\e[1m$blacklist:\e[0m \e[32mPass\e[0m\n" + fi + done + + result+="\n" +} diff --git a/tools/domain_txt_check.sh.unloaded b/tools/domain_txt_check.sh.unloaded new file mode 100644 index 0000000..9018c97 --- /dev/null +++ b/tools/domain_txt_check.sh.unloaded @@ -0,0 +1,61 @@ +#!/bin/bash + +get_tool_name() { + echo "Domain TXT Record Check" +} + +get_tool_description() { + echo "Check SPF, DMARC, DKIM, and other TXT records of 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" + spf_record=$(dig +short TXT "$single_domain" | grep -i "v=spf1") + dmarc_record=$(dig +short TXT "_dmarc.$single_domain") + + dkim_records=$(dig +short TXT "$single_domain" | grep -i "v=dkim1") + + result+="\e[1mDomain:\e[0m $single_domain\n" + + if [ -n "$spf_record" ]; then + result+="\e[1mSPF Record:\e[0m $spf_record\n" + else + result+="\e[1mSPF Record:\e[0m \e[31mFailed\e[0m\n" + fi + + if [ -n "$dmarc_record" ]; then + result+="\e[1mDMARC Record:\e[0m $dmarc_record\n" + else + result+="\e[1mDMARC Record:\e[0m \e[31mFailed\e[0m\n" + fi + + if [ -n "$dkim_records" ]; then + result+="\e[1mDKIM Records:\e[0m\n$dkim_records\n" + else + result+="\e[1mDKIM Records:\e[0m \e[31mFailed\e[0m\n" + fi + + other_txt_records=$(dig +short TXT "$single_domain" | grep -v -iE "v=spf1|_dmarc|v=dkim1") + if [ -n "$other_txt_records" ]; then + result+="\e[1mOther TXT Records:\e[0m\n$other_txt_records\n" + fi + + result+="\n" +} diff --git a/tools/http_status_check.sh b/tools/http_status_check.sh new file mode 100644 index 0000000..aa8d7be --- /dev/null +++ b/tools/http_status_check.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +# Set this variable to "true" to enable debug mode +DEBUG_MODE="false" + +get_tool_name() { + echo "HTTP Status Check" +} + +get_tool_description() { + echo "Check HTTP and HTTPS status of 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" + + result+="\e[1mDomain:\e[0m $single_domain\n" + + http_response=$(curl -sIL --max-time 10 "http://$single_domain" | grep -i "HTTP/1.1") + + if [ -n "$http_response" ]; then + result+="\e[1mHTTP:\e[0m \e[32mPass\e[0m\n" + else + https_response=$(curl -sIL --max-time 10 "https://$single_domain" | grep -i "HTTP/1.1") + if [ -n "$https_response" ]; then + if [[ "$https_response" == *"301 Moved Permanently"* ]]; then + https_redirect=$(echo "$https_response" | awk '{print $3}') + https_status=$(curl -sIL --max-time 10 "$https_redirect" | grep -i "HTTP/1.1") + if [ -n "$https_status" ] && [[ "$https_status" == *"200 OK"* ]]; then + result+="\e[1mHTTP/HTTPS:\e[0m \e[32mhttps forced\e[0m\n" + else + result+="\e[1mHTTP/HTTPS:\e[0m \e[31mhttps not forced\e[0m\n" + fi + else + result+="\e[1mHTTP/HTTPS:\e[0m \e[31mhttps failed\e[0m\n" + fi + else + result+="\e[1mHTTP/HTTPS:\e[0m \e[31mFailed\e[0m\n" + fi + fi + + if [ "$DEBUG_MODE" == "true" ]; then + echo -e "\n\e[1mDebug Info:\e[0m" + curl -IL --max-time 10 "http://$single_domain" + fi +} diff --git a/tools/rdns_check.sh b/tools/rdns_check.sh new file mode 100644 index 0000000..83f61e4 --- /dev/null +++ b/tools/rdns_check.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +get_tool_name() { + echo "RDNS Check" +} + +get_tool_description() { + echo "Perform reverse DNS (RDNS) checks on a domain or domains" +} + +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" + + single_domain_ip=$(dig A +short "$single_domain") + rDNS_result=$(dig +short -x "$single_domain_ip") + + if [ -n "$rDNS_result" ]; then + result+="\e[34mRDNS Result:\e[32m $rDNS_result\n" + else + result+="\e[34mRDNS Result:\e[31m No RDNS record found.\n" + fi +} diff --git a/tools/smtp_test.sh b/tools/smtp_test.sh new file mode 100755 index 0000000..41b81be --- /dev/null +++ b/tools/smtp_test.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +get_tool_name() { + echo "SMTP Test" +} + +get_tool_description() { + echo "Check SMTP ports of 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 [ -n "$mx_record" ]; then + smtp_ports="25 465 587" + 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 " + else + ports_status+="\e[31m$port: \e[1mError\e[0m " + fi + done + result+="\e[1mMX Hostname Tested:\e[0m $mx_record \e[1mPorts:\e[0m $ports_status\n" + else + result+="No MX record found for $single_domain\n" + fi +} diff --git a/tools/traffic_analyzer.sh.unloaded b/tools/traffic_analyzer.sh.unloaded new file mode 100644 index 0000000..4d9a602 --- /dev/null +++ b/tools/traffic_analyzer.sh.unloaded @@ -0,0 +1,40 @@ +#!/bin/bash + +get_tool_name() { + echo "DNS Traffic Analyzer" +} + +get_tool_description() { + echo "Analyze DNS traffic for a domain or domains" +} + +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" + + dns_traffic=$(tcpdump -n -i any port 53 and host "$single_domain" -c 10) + + if [ -n "$dns_traffic" ]; then + result+="\e[1mDNS Traffic:\e[0m\n$dns_traffic\n" + else + result+="\e[1mDNS Traffic:\e[0m No DNS traffic detected.\n" + fi +}