Share code imacros login bằng cookie để check acc còn live


Posted on 07-11-2018, in Categories: Share-code, imacros,


Đây là code tự động login bằng cookie bằng imacros mình dùng để check acc từ 2017 các bạn copy nhớ sửa lại đường dẫn tới data đúng với máy của bạn nhé :

 

 


for(i=1;i<99999;i++)
{

// Thoat Cookies Facebook
javascript:void(function(){ 
function deleteAllCookiesFromCurrentDomain() { 
var cookies = window.document.cookie.split(";"); 
var console = (Components.utils.import("resource://gre/modules/devtools/Console.jsm", {})).console; 
console.log(cookies); 
for (var c = 0; c < cookies.length; c++) { 
var d = window.location.hostname.split("."); 
while (d.length > 0) { var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path='; 
var p = window.location.pathname.split('/'); 
window.document.cookie = cookieBase + '/'; while (p.length > 0) { window.document.cookie = cookieBase + p.join('/'); p.pop(); }; d.shift(); } } } deleteAllCookiesFromCurrentDomain(); 
window.location.href = 'https://facebook.com'; })();
//Thoat cookie full
var Cc=Components.classes, Ci=Components.interfaces;
var prf=Cc['@mozilla.org/preferences-service;1'].getService(Ci.nsIPrefBranch);
var str=Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
var cok=Cc['@mozilla.org/cookiemanager;1'].getService(Ci.nsICookieManager);      
iimDisplay(cok);
function del_cookis(){
var iter=cok.enumerator;
while (iter.hasMoreElements()){var cookie=iter.getNext();
if(cookie instanceof Ci.nsICookie){cok.remove(cookie.host, cookie.name, cookie.path, cookie.blocked);}}}
del_cookis();
////Read last line current check cookie
var datasource = "C:\\Users\\Vntricky\\Documents\\iMacros\\Datasources\\CheckCookieLive\\";
var csv_file_name = "CurrentCookie.txt";
 // COUNT THE NUMBERS OF ROWS IN CSV FOR LOOP
 const CRLF = "\r\n";
 const LF = "\n";
 var lines = new Array();
 var file_i = imns.FIO.openNode(datasource+csv_file_name);
 var text = imns.FIO.readTextFile(file_i); // Read file into one string
 // Determine end-of-line marker
 var eol = (text.indexOf(CRLF) == -1) ? LF : CRLF;
 // Split into lines (number of lines) NUMBER OF LINES IN CSV
 lines = text.split(eol);
 eol = lines.length;
iimDisplay(eol);
//Save line current Cookie
var stt;
stt =  "CODE:";
stt +=  "SET !EXTRACT {{stt2}}" + "\n"; 
stt +=  "SAVEAS TYPE=EXTRACT FOLDER=C:\\Users\\Vntricky\\Documents\\iMacros\\Datasources\\CheckCookieLive FILE=CurrentCookie.txt" + "\n"; 
iimSet("stt2",eol);
iimPlay(stt)
/////////////////////////////
//Load web facebook
var wait;
wait =  "CODE:";
wait +=  "URL GOTO=http://m.facebook.com" + "\n"; 
iimPlay(wait)
////////////////////////////
// Import cookie
var importCookie;
importCookie = "CODE:";
importCookie +=  "SET !DATASOURCE C:\\Users\\Vntricky\\Documents\\iMacros\\Datasources\\CheckCookieLive\\Cookie.txt" + "\n"; 
importCookie +=  "SET !DATASOURCE_LINE {{stt2}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL1}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL2}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL3}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL4}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL5}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL6}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL7}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL8}}" + "\n";
importCookie +=  "ADD !EXTRACT {{!COL9}}" + "\n";
iimSet("stt2",eol);
iimPlay(importCookie)
var cookieif = iimGetLastExtract(1);
var token = iimGetLastExtract(2);
var mail = iimGetLastExtract(3);
var pass = iimGetLastExtract(4);
var uid = iimGetLastExtract(5);
var codeveri = iimGetLastExtract(6);
var daybirth = iimGetLastExtract(7);
var monthbirth = iimGetLastExtract(8);
var yearbirth = iimGetLastExtract(9);
var codecookie1 = iimGetLastExtract(1);
iimDisplay("Dang chay acc " + eol + "  " + "Cookie:  " + codecookie1);
/////////////////////////////
//Login facebook with Cookie
javascript:void(function(){
function setCookie(t) { 
var list = t.split("; ");
var console = (Components.utils.import("resource://gre/modules/devtools/Console.jsm", {})).console; 
console.log(list); 
for (var i = list.length - 1; i >= 0; i--) {
var cname = list[i].split("=")[0];
var cvalue = list[i].split("=")[1]; 
var d = new Date();
d.setTime(d.getTime() + (7*24*60*60*1000));
var expires = ";domain=.facebook.com;expires="+ d.toUTCString(); 
window.document.cookie = cname + "=" + cvalue + "; " + expires; 
}
} function hex2a(hex) { var str = '';
for (var i = 0; i < hex.length; i += 2) { 
var v = parseInt(hex.substr(i, 2), 16);
if (v) str += String.fromCharCode(v); } return str;
}
var cookie = codecookie1;
setCookie(cookie); 
window.location.href = 'https://facebook.com'; })
();
////////////////////////
iimPlay("CODE:WAIT SECONDS=2");
/////////////////////////
if(window.document.URL.indexOf("interstitial")>=0)
    {

var nhappass;
nhappass = "CODE:"
nhappass += "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/passwordacquisitionqp/action/delegate/?qp_id=1395701103829373&qp_nux_id=2289&qp_fr=%2Fpassword%2Fset%2F&qp_action=primary&qp_action_url=%2Fpassword%2Fset%2F&qp_mac=AZKJjoixuBeMk6cg&qp_trigger=newsfeed&next=%2Fhome.php&refid=8 ATTR=NAME:password ATTR=NAME:password CONTENT=Tien01627877417" + "\n";
nhappass += "TAG POS=1 TYPE=BUTTON FORM=ACTION:/passwordacquisitionqp/action/delegate/?qp_id=1395701103829373&qp_nux_id=2289&qp_fr=%2Fpassword%2Fset%2F&qp_action=primary&qp_action_url=%2Fpassword%2Fset%2F&qp_mac=AZKJjoixuBeMk6cg&qp_trigger=newsfeed&next=%2Fhome.php&refid=8 ATTR=NAME:password ATTR=TXT:Đặt<SP>mật<SP>khẩu" + "\n";
nhappass += "WAIT SECONDS=3" + "\n";
iimPlay(nhappass);
}
//////////////////////////
var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"] 
.getService(Components.interfaces.nsICookieManager); 

var iter = cookieManager.enumerator; 
while (iter.hasMoreElements()){ 
var cookie = iter.getNext(); 
if (cookie instanceof Components.interfaces.nsICookie){ 
if (cookie.host == ".facebook.com" && cookie.name == "c_user") 
var c_user = cookie.value;
if (cookie.host == ".facebook.com" && cookie.name == "xs") 
var xs = cookie.value;
//
if(c_user == undefined)
{
    var result = "Cookie Die";
    codever = "notgettoken";
}
else
{
    if(window.document.URL.indexOf("checkpoint")>=0)
    {
        var result = "Checkpoint";
        codever = "notgettoken";
    }
    else
    {
        if(window.document.URL.indexOf("confirmemail")>=0)
        {
            var result = "Valid Email Address";
            codever = "notgettoken";
        }
        else
        {
            var result = "Cookie Live";
        }
    }
}
var Cookiedata = "c_user" + "=" + c_user + ";" + " " + "xs" + "=" + xs + ";" + "," + codever + "," + mail + "," + pass + "," + uid + "," + codeveri + "," + daybirth + "," + monthbirth + "," + yearbirth;

}
var exportcookie = Cookiedata + "," + result;
}


 

 

 


Tags:

admin

"Tôi không phải là dân lập trình chuyên nghiệp bởi kinh nghiệm mà tôi có được không nhiều, hầu hết các code mà tôi đã từng edit code cũng không là bao, tôi nhận thấy mình chỉ là một người yêu thích lập trình và chia sẻ mà thôi..."


Về Tôi

ĐĂNG KÝ NHẬN TIN QUA EMAIL

Social Media Network