Tuesday 12 June 2012

Pineapple & DNS Spoof

Just configured DNS spoof on the Pineapple mk IV, a very simple set-up but for those like me who mainly used Windows in the past, a couple of notes on the set-up that may prove useful to others.

I have my Pineapple tethered to a Windows7 laptop, to communicate with the Pineapple I use the following programs
Logging on to the Pineapple using firefox, I find IE does not display all the screens properly (I had trouble seeing Karma log on the status page) I followed the edit link for DNS Spoof from the status page.

DNS Spoof Config

I added another line to the config file and save the config

172.16.42.1 www.<domain>.co.uk

This will cause an device connected to the Pineapple to go to the Pineapple web server (172.16.42.1 is the IP address of the Pineapple WiFi interface) if the www.<domain>.co.uk is in the URL request. They is the possibility of redirecting the browser to a server on another machine.

The www folder on the pineapple has the following pages in it.
  • error.php
  • index.php
  • redirect.php
The index.php is a simple html file that uses the META refresh to direct the browser to the redirect.php page.

The redirect.php is a php script that searches the HTTP_REFERER for a keyword (the domain to be redirected) if it exists it redirects the browser to a target page.

The error.php is a file that handles errors in the redirect.php ie. target domain has does not have a specified page to be redirected to.

Using WinSCP I connected to the Pineapple and browsed to the /www folder. The redirect.php can be edited to add additional domain redirects in the form.

if (strpos($ref, "<domain>")){ header('Location: <targetpage>.html'); }
I then uploaded a <targetpage>.html file to the www directory for the redirect.

Enabling DNS Spoofing then causes any device connecting to the Pineapple and looking for a domain to be directed to the specified page.

1 comment:

  1. Iv had one of these for a while but could never figure out how to work Karma properly, although I was using Backtrack so this only helps me slightly but defiantly a good read.

    ReplyDelete