Feb 272009
 

This code is the guts of another firefox plugin I wrote to Auto add face book users who had the blood wars application installed.

The blood wars application exposes the FB user ID in a very simple way to collect. This application goes through the war.php pages and collects the user ID exposed there. it collects 10 and then goes to http://www.facebook.com/addfriend.php?id=+UID and pastes a generic relevant please add me to your friend list message.

It does this on loop until a message is displayed telling you you may hit a limit.

One could harvest thousands of these ID and then use multiple accounts to make “friends” with all these people and then use another bot to data mine all their private information. People simply don’t use the privacy options, or can’t find them all because they are so spread out.

var BWFadd = {
Tab:undefined,
Browser:undefined,
ExpectedURL:undefined,
BrowserTimeOutRef:undefined,
BrowserTimeOut:30000,
UIds:undefined,
FormFilled:false,
GameTarget:"http://apps.facebook.com/elvenblood/war.php",
Enabled:true,
TotalAdded:0,

OpenWorkerTab:function(){
window.dump("New Start\n")
if (this.Browser == undefined){
//this.ExpectedURL =  "http://apps.facebook.com/skiesofblood/war.php";
this.ExpectedURL = this.GameTarget;
this.Tab =  gBrowser.addTab(this.ExpectedURL)
this.Browser =  gBrowser.getBrowserForTab(this.Tab);
this.Browser.addEventListener("load", function(e)  {BWFadd.OnPageLoad(e);}, true);
gBrowser.mTabContainer.advanceSelectedTab(1, true);
}  else {
this.GoURL(this.ExpectedURL,false);
}
},

CanAdd:function(){
if  (this.Browser.contentDocument.getElementById("error")) {
if  (this.Browser.contentDocument.getElementById("standard_error").firstChild.nodeValue=="You  are approaching the limit for adding friends!"){
this.Enabled = false;
alert("Added Today :  "+this.TotalAdded);
}
return false;
}
if (this.Browser.contentDocument.getElementById("standard_status"))  return false;
return true;
},

OnPageLoad:function(aEvent){
if (!this.Enabled) {
window.clearInterval(this.BrowserTimeOutRef);
this.Browser.removeEventListener("load", function(e)  {BWFadd.OnPageLoad(e);}, true);
return;
}
window.dump("Load Event\n")
//if (aEvent.originalTarget  instanceof HTMLDocument){      }
if  (this.Browser.contentDocument.getElementById("pagefooter")){

/*
var useless =  this.Browser.contentDocument.getElementsByTagName("IFRAME");
for (var a=0;a<useless.length;a++){
useless[a].parentNode.removeChild(useless[a]);
}
useless =  this.Browser.contentDocument.getElementById("sidebar_ads");
if (useless != null) useless.parentNode.removeChild(useless);
*/

//switch  (String(aEvent.originalTarget.documentURI.match(/war.php|addfriend.php/))){
switch  (String(this.Browser.contentDocument.documentURI.match(/war.php|addfriend.php|home.php/))){
case "war.php":
this.GetIDs();
break;
case "addfriend.php":
if  (this.CanAdd()) {
this.FillForm();
} else {
if (this.UIds.length>0){
this.GoURL("http://www.facebook.com/addfriend.php?id="+this.UIds.shift(),false);
} else {
this.GoURL(this.GameTarget,false);
}
}
break;
case "home.php":
if (this.UIds.length>0){
this.GoURL("http://www.facebook.com/addfriend.php?id="+this.UIds.shift(),false);
} else {
this.GoURL(this.GameTarget,false);
}
break;
default:window.dump("Doc URL of event :  "+this.Browser.contentDocument.documentURI+"\n");
}
} else {
window.dump("No Footer Found\n")
}
},

SetNewTimeout:function(Command, Mills){
window.clearTimeout(this.BrowserTimeOutRef);
this.BrowserTimeOutRef = window.setTimeout(Command,Mills);
},

GoURL:function(URL,refresh){
if (refresh ||  this.ExpectedURL != URL){
window.dump(URL+"\n");
this.SetNewTimeout("BWFadd.GoURL('" + URL +  "',true);",this.BrowserTimeOut);
this.ExpectedURL = URL;
window.setTimeout("BWFadd.Browser.loadURI('"+URL+"');",500);
//this.Browser.loadURI(URL);
}
},

ClickLink:function(Link){
var Links =  this.Browser.contentDocument.getElementsByTagName("A");
for  (var a=0;a<Links.length;a++){
if (Links[a] &&  Links[a].childNodes[0] &&  Links[a].childNodes[0].nodeValue==Link) {
var event =  document.createEvent("MouseEvents");
event.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false,  false, false, false, 0, null);
Links[a].dispatchEvent(event);
return true;
}
}
return false;
},

GetIDs:function(){
this.UIds = new Array();
var forms  = this.Browser.contentDocument.getElementsByTagName("FORM");
for (var a=1;a<11;a++){
if  (parseInt(forms[a].parentNode.parentNode.getElementsByClassName("g")[0].nextSibling.nodeValue.replace(/[$]|g/g,""))  < 1000)
this.UIds.push(forms[a].childNodes[15].getAttribute("value"));
}
if (this.UIds.length) {
this.GoURL("http://www.facebook.com/addfriend.php?id="+this.UIds[0],false);
} else {
this.GoURL(this.GameTarget,true);
}
},

FillForm:function(){
var ID =  this.Browser.contentDocument.documentURI.match(/\d{1,}/);
this.ClickLink("[ Add a personal message ]");
var TextArea =  this.Browser.contentDocument.getElementById("message");
TextArea.value = "Please Join My Blood Line in the world of Blood  Series."
var DropDown =  this.Browser.contentDocument.getElementById("add_to_friend_list_widget_select_"+ID);
DropDown.selectedIndex=5;
this.Browser.contentDocument.getElementsByTagName("FORM")[1].submit();
this.TotalAdded++;
}
}

Share

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>