initial commit
This commit is contained in:
41
tools/cache_poison_test.sh.unloaded
Normal file
41
tools/cache_poison_test.sh.unloaded
Normal file
@ -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
|
||||
}
|
Reference in New Issue
Block a user