updates
This commit is contained in:
54
wip/dns_query_analyzer.sh.unloaded
Normal file
54
wip/dns_query_analyzer.sh.unloaded
Normal file
@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_tool_name() {
|
||||
echo "DNS Query Analyzer"
|
||||
}
|
||||
|
||||
get_tool_description() {
|
||||
echo "Analyze DNS queries and responses for slow responses"
|
||||
}
|
||||
|
||||
execute_tool() {
|
||||
if ! command -v tcpdump &> /dev/null || ! command -v tshark &> /dev/null; then
|
||||
echo "Required tools (tcpdump and tshark) are not available."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
result=""
|
||||
if [ -n "$domain" ]; then
|
||||
if [[ "$domain" == *$'\n'* ]]; then
|
||||
for single_domain in $domain; do
|
||||
analyze_dns "$single_domain"
|
||||
done
|
||||
else
|
||||
analyze_dns "$domain"
|
||||
fi
|
||||
else
|
||||
result="No domains specified."
|
||||
fi
|
||||
|
||||
echo -e "$result"
|
||||
}
|
||||
|
||||
analyze_dns() {
|
||||
local single_domain="$1"
|
||||
|
||||
result+="\e[1mAnalyzing DNS queries for $single_domain:\e[0m\n"
|
||||
|
||||
# Capture DNS traffic with tcpdump
|
||||
tcpdump -i any -n -s0 -w dns_traffic.pcap udp port 53 &> /dev/null &
|
||||
sleep 5
|
||||
pkill tcpdump
|
||||
|
||||
# Analyze captured traffic with tshark
|
||||
slow_queries=$(tshark -r dns_traffic.pcap -Y "dns.qry.name contains $single_domain && dns.a" -T fields -e dns.time -e dns.qry.name)
|
||||
|
||||
if [ -n "$slow_queries" ]; then
|
||||
result+="$slow_queries\n"
|
||||
else
|
||||
result+="No slow queries found.\n"
|
||||
fi
|
||||
|
||||
# Cleanup captured traffic file
|
||||
rm -f dns_traffic.pcap
|
||||
}
|
64
wip/subdomain_enumerator.sh.unloaded
Normal file
64
wip/subdomain_enumerator.sh.unloaded
Normal file
@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
get_tool_name() {
|
||||
echo "Subdomain Enumerator"
|
||||
}
|
||||
|
||||
get_tool_description() {
|
||||
echo "Enumerate subdomains of a primary domain"
|
||||
}
|
||||
|
||||
check_requirements() {
|
||||
if ! command -v dig &> /dev/null; then
|
||||
echo "dig is not available. Install it to continue."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v amass &> /dev/null; then
|
||||
echo "amass is not available. Install it to continue."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
execute_tool() {
|
||||
check_requirements
|
||||
|
||||
result=""
|
||||
if [ -n "$domain" ]; then
|
||||
if [[ "$domain" == *$'\n'* ]]; then
|
||||
for single_domain in $domain; do
|
||||
enumerate_subdomains "$single_domain"
|
||||
done
|
||||
else
|
||||
enumerate_subdomains "$domain"
|
||||
fi
|
||||
else
|
||||
result="No domains specified."
|
||||
fi
|
||||
|
||||
echo -e "$result"
|
||||
}
|
||||
|
||||
enumerate_subdomains() {
|
||||
local primary_domain="$1"
|
||||
|
||||
result+="\e[1mEnumerating subdomains of $primary_domain:\e[0m\n"
|
||||
|
||||
# Perform DNS queries to enumerate subdomains
|
||||
subdomains_dns=$(dig +short "$primary_domain" | grep -oE "([a-zA-Z0-9\-]+\.)*$primary_domain")
|
||||
|
||||
# Perform web-based enumeration using Amass
|
||||
subdomains_web=$(amass enum -d "$primary_domain" -o - 2>/dev/null)
|
||||
|
||||
# Combine results from DNS and web-based enumeration
|
||||
all_subdomains="$subdomains_dns\n$subdomains_web"
|
||||
|
||||
# Remove duplicates and sort the list
|
||||
unique_subdomains=$(echo -e "$all_subdomains" | sort -u)
|
||||
|
||||
if [ -n "$unique_subdomains" ]; then
|
||||
result+="$unique_subdomains\n"
|
||||
else
|
||||
result+="No subdomains found.\n"
|
||||
fi
|
||||
}
|
Reference in New Issue
Block a user