//=========CONTENT SCRIPT============// //Labels of game var labels = { checkBalance : ["Verificar balanço bancário", "Check bank status"], transferMoney: ["Transferir dinheiro", "Transfer money"] } //This structure stores the data for transmission var requestData = { act : null, stepId : null, url: null, ip : [], account : [], amount: null, language: null, job: null, counter: null, myAccount: null, software: null } //This estructure stores the default actions var defaultAct = { getRequestData : 1, setRequestData : 2 } //This stores the delay count var counterDelay = 0; var delay; var DEFAULT_DELAY = 10; var panel, globalAux; //This stores the default job var defaultJob = { checkBalance : 1, transferMoney : 2, installSoftware : 3, wait : 4 } //################################################################# //################################################################# //################################################################# //It listens for messages comming from background script chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { sendResponse({backMessage: "Ok. Request data received by content script"}); handleRequest(request); } ); //It sends a message to the background script function sendRequest(request){ chrome.runtime.sendMessage({message: request}, function(response) {console.log(response.backMessage);}); }; //It handles messages comming from background script function handleRequest(request){ showRequest(request.message); switch(request.message.act){ case defaultAct.getRequestData: //code break; case defaultAct.setRequestData: //console.log("SetRequestData from background script>>> Act: ", request.message.act + " stepId: " + request.message.stepId); if (request.message.stepId != null){ if ((request.message.job == defaultJob.checkBalance) || (request.message.job == defaultJob.transferMoney)){ executeMissionStep(request.message); } else if (request.message.job == defaultJob.campingBankLogs){ executeCampingStep(request.message); } else if (request.message.job == defaultJob.installSoftware){ executeInstallSoftware(request.message); } else if (request.message.job == defaultJob.wait){ //Do nothing, just wait } } break; default : break; } }; //################################################################# //################################################################# //################################################################# //It sends the next step description to the background script function setNextStep(request, stepId){ request.act = defaultAct.setRequestData; request.stepId = stepId; sendRequest(request); }; //It resets the requestData structure function resetRequestDada(request){ request.act = null; request.stepId = null; request.url = null; request.ip = []; request.account = []; request.amount = null; //request.language = null; //request.job = null; return request; }; //Show request content function showRequest(request){ var data = request; console.log("Request>>> ACTION:" + (data.act == defaultAct.getRequestData ? "getRequestData" : "setRequestData") + " STEPID: " + data.stepId + " URL: " + data.url + " IPS: " + data.ip[0] + " " + data.ip[1] + " ACCOUNTS: " + data.account[0] + " " + data.account[1] + " AMOUNT: " + data.amount); }; //It searches for all elements with the specified tagName, then filter those elements that have the specified attribName valued as attribValue. //Next it gets one element from specified position on the elements array and returns it function getSomeElement(tagName, attribName, attribValue, position){ if (tagName != null){ element = document.getElementsByTagName(tagName); } else { element = document.getElementsByTagName("*"); } resultElements = []; var count; if (attribName != null){ for(count = 0; count <= element.length - 1; count++){ if (element[count].getAttribute(attribName) == attribValue){ resultElements.push(element[count]); } } } else { resultElements = element; }; if (resultElements.length > 0){ try{ resultElements[position].style.fontSize = "15px"; resultElements[position].style.color = "red"; } catch(error){ console.log(error.message); } return resultElements[position]; } else { return null; } } //It try to get some mission, if is avaiable, and accept it function getSomeMission(request){ //Get the URL mission var element = document.getElementsByTagName("a"); var countFound = 0; var url; var urlIsObtained = false; for(count = 0; count <= element.length - 1; count++){ aux = element[count]; url = aux.href; aux = aux.childNodes[0]; aux = aux.nodeValue; if (aux != null){ if (request.job == defaultJob.checkBalance){ if (aux.search(labels.checkBalance[request.language]) >= 0){ countFound++; //url = url.split("?")[1]; request.url = url; console.log(request.url); urlIsObtained = true; break; } } else if (request.job == defaultJob.transferMoney){ if (aux.search(labels.transferMoney[request.language]) >= 0){ countFound++; //url = url.split("?")[1]; request.url = url; console.log(request.url); urlIsObtained = true; break; } } } } return request; }; //This analyses the url and defines the language function defineLanguage(request){ switch(window.location.href.split("/")[2].split(".")[0]){ case "br": request.language = 0; break; case "en": request.language = 1; break; default: break; } request.act = defaultAct.setRequestData; sendRequest(request); } //It gets all information about current mission function getMissionInformation(request){ //Get the mission IPs var element = document.getElementsByClassName("black"); var aux; var countFound = 0; request.ip[0] = getSomeElement("a", "class", "small", 0).childNodes[0].nodeValue; try{ request.ip[1] = getSomeElement("a", "class", "small", 1).childNodes[0].nodeValue; }catch(error){ console.log(error.message); } //Get the mission accounts element = document.getElementsByTagName("td"); countFound = 0; for(count = 0; count <= element.length - 1; count++){ aux = element[count]; aux = aux.childNodes[0]; aux = aux.nodeValue; if (aux != null){ if (aux.search("#") >= 0){ aux = aux.substr(1, aux.length - 1); request.account[countFound] = aux; console.log(countFound + "::" + request.account[countFound]); countFound++; } } } return request; }; //This function goes to the page especified by path function goToPage(path){ var currentUrl = window.location.href; newUrl = currentUrl.split("/"); newUrl = newUrl[0] + "//" + newUrl[2] + path; window.location.href = newUrl; } //It analyzes the logs data and extracts accounts in order to invade them //It analyzes the logs data and extracts accounts in order to invade them function extractDataFromLogs(request, logs){ var piece = logs.split(" to "); var count, count2 = 0; var positionFlag = 0; var thereIsAlready; var accountFound; for(count = 0; count <= piece.length - 1; count++){ if (piece[count].search("#") == 0){ positionFlag = piece[count].search(" "); if (piece[count].search(" at localhost") == positionFlag){ accountFound = piece[count].substr(1, positionFlag - 1); thereIsAlready = false; for (count2 = 0; count2 <= request.account.length - 1; count2++){ if (request.account[count2] == accountFound){ thereIsAlready = true; break; } } if (accountFound == request.myAccount){ thereIsAlready = true; } if (thereIsAlready == false){ request.account.push(accountFound); console.log(accountFound); } } } } return request; }; //It gets the id of any software function getSoftwareId(name, version){ var elements = document.getElementsByTagName("tbody")[0].getElementsByTagName("*"); var count, textNodeValue; var itemIsFound = false; var foundId = null; for (count = 0; count <= elements.length - 1; count++){ if (elements[count].childNodes[0] != undefined){ if (elements[count].childNodes[0].nodeValue != null){ if (elements[count].childNodes[0].nodeValue.search(name.trim()) >= 0){ switch(elements[count].tagName){ case "A": itemIsFound = true; break; case "TD": try{ switch(elements[count].nextElementSibling.childNodes[1].childNodes[0].tagName){ case undefined: if (elements[count].nextElementSibling.childNodes[1].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; case "B": if (elements[count].nextElementSibling.childNodes[1].childNodes[0].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; case "I": if (elements[count].nextElementSibling.childNodes[1].childNodes[0].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; default: break; } }catch(error){console.log(error.message)} break; case "B": try{ switch(elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].tagName){ case undefined: if (elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; case "B": if (elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; default: break; } }catch(error){console.log(error.message)} break; case "I": try{ switch(elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].tagName){ case undefined: if (elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; case "B": if (elements[count].parentElement.nextElementSibling.childNodes[1].childNodes[0].childNodes[0].nodeValue.search(version.trim()) >= 0){ itemIsFound = true; } break; default: break; } }catch(error){console.log(error.message)} break; default: break; } }; } } if (itemIsFound == true){ foundId = elements[count].parentElement.tagName; switch(elements[count].tagName){ case "B": foundId = elements[count].parentElement.parentElement.getAttribute("id"); break; case "TD": foundId = elements[count].parentElement.getAttribute("id"); break; case "I": foundId = elements[count].parentElement.parentElement.getAttribute("id"); break; case "A": foundId = elements[count].parentElement.parentElement.getAttribute("id"); default: break; } break; } } return foundId; } //This function implements the install software algorithm function executeInstallSoftware(request){ var softwareId; switch(request.stepId){ case "checkSoftware": if (getSoftwareId(request.software.split(",")[0],request.software.split(",")[1]) != null){ setNextStep(request, "fillIPOnInternetPage"); goToPage("/internet"); } else { window.alert("There is no any software like the specified :( >" + request.software.split(",")[0] + "::" + request.software.split(",")[1] + "<"); setNextStep(request, "finishAll"); location.reload(true) } break; case "fillIPOnInternetPage": if (request.ip.length > 0){ if (getSomeElement("a", "href", "?view=logout", 0) == null){ getSomeElement("input", "class", "browser-bar", 0).value = request.ip.pop(); //Fill IP Adress bar setNextStep(request, "goToServerTab"); getSomeElement("input", "type", "submit", 0).click(); //Click on Go button } else { setNextStep(request, "fillIPOnInternetPage"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } } else { window.alert("There is no a ip avaiable"); } break; case "goToServerTab": if ((getSomeElement("div", "class", "alert alert-error", 0) == null) && (getSomeElement("a", "href", "?action=login", 0) != null)){ setNextStep(request, "signInKnownServer"); getSomeElement("a", "href", "?action=login", 0).click(); //Click on the server login tab } else { if (request.ip.length >= 1){ if (request.ip.length == 0){ setNextStep(request, "finishSoftwareInstall"); } else { setNextStep(request, "fillIPOnInternetPage"); goToPage("/internet"); } } else { //abort } } break; case "signInKnownServer": if (getSomeElement("strong", null, null, 1) != null){//Check if the password is avaiable setNextStep(request, "removeMyClues"); aux = getSomeElement("span", "class", "small pull-left", 0).childNodes[1].nodeValue; aux = aux.substr(2, aux.length - 2); getSomeElement("input", "name", "user", 0).value = aux; //Fill the user field with the user on screen aux = getSomeElement("span", "class", "small pull-left", 1).childNodes[1].nodeValue; aux = aux.substr(2, aux.length - 2); getSomeElement("input", "type", "password", 0).value = aux; //Fill the password field with the password on screen getSomeElement("input", "type", "submit", 1).click(); //Click on the Login button } else { //Go to server invader setNextStep(request, "signInNew-KnownServer"); goToPage("/internet?action=hack&method=bf"); //Atack by brute force method } break; case "signInNew-KnownServer": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "signInKnownServer"); //getSomeElement("a", "href", "?action=login", 0).click(); //Click on the server login tab } else { setNextStep(request, "finishCycle"); location.reload(true); } break; case "removeMyClues": logs = " "; try{ logs = getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue; //Get all log datas }catch(error){ console.log(error.message); } if (logs != undefined){ request = extractDataFromLogs(request, logs); } setNextStep(request, "waitForEditLogProcess"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data ButtongoToPage("/missions"); break; case "waitForEditLogProcess": setNextStep(request, "goToMySoftwarePanel"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ //Do nothing } else { getSomeElement("a", "href", "?view=logs", 0).click(); //reload the log page } break; case "goToMySoftwarePanel": setNextStep(request, "uploadSoftware"); goToPage("/software"); break; case "uploadSoftware": setNextStep(request, "waitForInstallSoftwareProcess"); softwareId = getSoftwareId(request.software.split(",")[0],request.software.split(",")[1]); if (softwareId != null){ goToPage("/internet?view=software&cmd=up&id=" + softwareId); } else { window.alert("Hey, it seems you don't have that software anymore :("); setNextStep(request, "finishAll"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "waitForInstallSoftwareProcess": if (getSomeElement("div", "class", "alert alert-success", 0) == null){ if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "goToLog-1"); } else { //request.ip.pop(); setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } } else { setNextStep(request, "goToLog-1"); location.reload(true); } break; case "goToLog-1": setNextStep(request, "clearLog-1"); getSomeElement("a", "href", "?view=logs", 0).click(); //Go to logs break; case "clearLog-1": setNextStep(request, "waitForEditLogProcess-1"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data Button break; case "waitForEditLogProcess-1": setNextStep(request, "goToSoftwareTab"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ } else { getSomeElement("a", "href", "?view=logs", 0).click(); //Reload Page } break; case "goToSoftwareTab": setNextStep(request, "installSoftware"); goToPage("/internet?view=software"); break; case "installSoftware": softwareId = getSoftwareId(request.software.split(",")[0],request.software.split(",")[1]); if (softwareId != null){ setNextStep(request, "waitForInstallSoftware"); goToPage("/internet?view=software&cmd=install&id=" + softwareId); } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "waitForInstallSoftware": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "goToLog-3"); } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "goToLog-3": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "clearLog-3"); getSomeElement("a", "href", "?view=logs", 0).click(); //Go to logs } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "clearLog-3": setNextStep(request, "waitForEditLogProcess-3"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data Button break; case "waitForEditLogProcess-3": setNextStep(request, "goToSoftwareTab2"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ } else { getSomeElement("a", "href", "?view=logs", 0).click(); //Reload Page } break; case "goToSoftwareTab2": setNextStep(request, "hideSoftware"); goToPage("/internet?view=software"); break; case "hideSoftware": softwareId = getSoftwareId(request.software.split(",")[0],request.software.split(",")[1]); if (softwareId != null){ setNextStep(request, "waitForHideProcess"); //window.alert("/internet?view=software&cmd=hide&id=" + softwareId); goToPage("/internet?view=software&cmd=hide&id=" + softwareId); } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "waitForHideProcess": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "goToLog-2"); } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "goToLog-2": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "clearLog-2"); getSomeElement("a", "href", "?view=logs", 0).click(); //Go to logs } else { setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "clearLog-2": setNextStep(request, "waitForEditLogProcess-2"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data Button break; case "waitForEditLogProcess-2": setNextStep(request, "logOutServer"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ } else { location.reload(true); } break; case "logOutServer": setNextStep(request, "finishCycle"); getSomeElement("a", "href", "?view=logout", 0).click(); break; case "goToMyOwnLog": setNextStep(request, "cleanOwnLog"); goToPage("/log"); break; case "cleanOwnLog": setNextStep(request, "waitForEditOwnLogProcess"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 0).click(); //Click on the Edit Log Data Button break; case "waitForEditOwnLogProcess": setNextStep(request, "finishAll"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ } else { location.reload(true); } break; case "finishCycle": if(request.ip.length > 0){ setNextStep(request, "fillIPOnInternetPage"); goToPage("/internet"); } else { setNextStep(request, "goToMyOwnLog"); location.reload(true); } break; case "finishAll": request = resetRequestDada(request); request.job = defaultJob.checkBalance; setNextStep(request, "chooseJob"); goToPage("/software"); break; default: break; } } //Execute the camping step job function executeCampingStep(request){ //var AMOUNT_BUFFERED_ACCOUNTS = 2; var amountAccount = 0; var aux, logs; switch(request.stepId){ case "fillIPOnInternetPage": if (getSomeElement("a", "href", "?view=logout", 0) == null){ setNextStep(request, "goToServerTab"); getSomeElement("input", "class", "browser-bar", 0).value = request.ip[0]; //Fill IP Adress bar getSomeElement("input", "type", "submit", 0).click(); //Click on Go button } else { setNextStep(request, "fillIPOnInternetPage"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button } break; case "goToServerTab": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "signInKnownServer"); getSomeElement("a", "href", "?action=login", 0).click(); //Click on the server login tab } else { window.alert("Hey, it's a bad ip!"); request.job = defaultJob.checkBalance; setNextStep(request, "chooseJob"); goToPage("/internet"); } break; case "signInKnownServer": if (getSomeElement("strong", null, null, 1) != null){//Check if the password is avaiable setNextStep(request, "removeMyClues"); aux = getSomeElement("span", "class", "small pull-left", 0).childNodes[1].nodeValue; aux = aux.substr(2, aux.length - 2); getSomeElement("input", "name", "user", 0).value = aux; //Fill the user field with the user on screen aux = getSomeElement("span", "class", "small pull-left", 1).childNodes[1].nodeValue; aux = aux.substr(2, aux.length - 2); getSomeElement("input", "type", "password", 0).value = aux; //Fill the password field with the password on screen getSomeElement("input", "type", "submit", 1).click(); //Click on the Login button } else { //Go to server invader //window.alert("Come on man! You need to have access to this IP first!"); //request.job = defaultJob.checkBalance; //setNextStep(request, "chooseJob"); //goToPage("/internet"); //Go to server invader setNextStep(request, "signInNew-KnownServer"); goToPage("/internet?action=hack&method=bf"); //Atack by brute force method } break; case "signInNew-KnownServer": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ setNextStep(request, "signInKnownServer"); //getSomeElement("a", "href", "?action=login", 0).click(); //Click on the server login tab } else { window.alert("Come on, man. Your cracker is a shit!"); request.job = defaultJob.checkBalance; setNextStep(request, "chooseJob"); goToPage("/internet"); } break; case "removeMyClues": logs = " "; try{ logs = getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue; //Get all log datas }catch(error){ console.log(error.message); } if (logs != undefined){ request = extractDataFromLogs(request, logs); } setNextStep(request, "waitForEditLogProcess"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data ButtongoToPage("/missions"); break; case "waitForEditLogProcess": if (request.account.length == 0){ //setNextStep(request, "listenForActivities"); setNextStep(request, "goToMyOwnLog"); } else { setNextStep(request, "startExtractMoney"); } if (getSomeElement("div", "class", "alert alert-error", 0) == null){ //Do nothing } else { getSomeElement("a", "href", "?view=logs", 0).click(); //reload the log page } break; case "listenForActivities": counterDelay = 0; delay = setInterval( function(){ counterDelay++; if (counterDelay >= 5){ clearInterval(delay); logs = " "; try{ logs = getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue; //Get all log datas }catch(error){ console.log(error.message); } amountAccount = request.account.length; if (logs != undefined){ request = extractDataFromLogs(request, logs); } if (amountAccount != request.account.length){ setNextStep(request, "waitForEditLogProcessOnListening"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 1).click(); //Click on the Edit Log Data ButtongoToPage("/missions"); } else { setNextStep(request, "listenForActivities"); getSomeElement("a", "href", "?view=logs", 0).click(); } } }, 1000); //Wait the specified time on the page break; case "waitForEditLogProcessOnListening": //if (request.account.length >= AMOUNT_BUFFERED_ACCOUNTS){ setNextStep(request, "startExtractMoney"); //} else { // setNextStep(request, "listenForActivities"); //} if (getSomeElement("div", "class", "alert alert-error", 0) == null){ //Do nothing } else { getSomeElement("a", "href", "?view=logs", 0).click(); } break; case "startExtractMoney": setNextStep(request, "acessBankIP"); getSomeElement("a", "href", "?view=logout", 0).click(); //Click on the Logout Button break; case "acessBankIP": setNextStep(request, "accessHackAccountTab"); getSomeElement("input", "class", "browser-bar", 0).value = request.ip[0]; //Fill IP Adress bar getSomeElement("input", "type", "submit", 0).click(); //Click on Go button break; case "accessHackAccountTab": setNextStep(request, "hackAccount"); goToPage("/internet?action=hack&type=bank"); break; case "hackAccount": setNextStep(request, "waitForEditAccountHackProcess"); getSomeElement("input", "name", "acc", 0).value = request.account[request.account.length - 1]; //Fill Account to hack bar getSomeElement("button", "type", "submit", 0).click(); //Click on Hack button break; case "waitForEditAccountHackProcess": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ //Check for error message setNextStep(request, "signInAccount"); } else { if (getSomeElement("strong", null, null, 1) != null){ //ssswindow.alert("You have ever access this account"); setNextStep(request, "transferMoney"); getSomeElement("input", "name", "acc", 0).value = request.account[request.account.length - 1]; //Fill the account field getSomeElement("input", "name", "pass", 0).value = getSomeElement("strong", null, null, 1).childNodes[0].nodeValue; //Fill the password field with the password on screen getSomeElement("input", "type", "submit", 1).click(); //Click on the Login button } else { //Next account request.account.pop(); //Remove last element from account array if (request.account.length > 0){ setNextStep(request, "accessHackAccountTab"); } else { setNextStep(request, "goToServerTab"); } getSomeElement("input", "type", "submit", 0).click(); //Click on Go button } } break; case "signInAccount": if (getSomeElement("div", "class", "alert alert-error", 0) == null){ //Check for success message setNextStep(request, "transferMoney"); getSomeElement("input", "name", "acc", 0).value = request.account[request.account.length - 1]; //Fill the account field getSomeElement("input", "name", "pass", 0).value = getSomeElement("strong", null, null, 1).childNodes[0].nodeValue; //Fill the password field with the password on screen getSomeElement("input", "type", "submit", 1).click(); //Click on the Login button } else { request.account.pop(); //Remove last element from account array setNextStep(request, "goToServerTab"); goToPage("/internet"); } break; case "transferMoney": counterDelay = 0; delay = setInterval( function(){ if (request.amount = getSomeElement("strong", null, null, 0).childNodes[0].nodeValue != "$0"){ counterDelay++; if (counterDelay >= 1){ clearInterval(delay); getSomeElement("input", "name", "acc", 0).value = request.myAccount; //Fill the To field getSomeElement("input", "name", "ip", 1).value = request.ip[0]; //Fill the Bank IP field request.account.pop(); //Remove last element from account array setNextStep(request, "goOutToTheAccount"); getSomeElement("button", "class", "btn btn-success", 0).click(); //Click on the Transfer Money button } } else { clearInterval(delay); request.account.pop(); //Remove last element from account array setNextStep(request, "goOutToTheAccount"); location.reload(true); //Reload the page } }, 1000); //Wait the specified time on the page break; case "goOutToTheAccount": setNextStep(request, "goToServerTab"); getSomeElement("a", "href", "?bAction=logout", 0).click(); //Click on the account logout button break; case "goToMyOwnLog": setNextStep(request, "cleanOwnLog"); goToPage("/log"); break; case "cleanOwnLog": setNextStep(request, "waitForEditOwnLogProcess"); try{ getSomeElement("textarea", "class", "logarea", 0).childNodes[0].nodeValue = " "; //Clean the logs }catch(error){}; getSomeElement("input", "type", "submit", 0).click(); //Click on the Edit Log Data Button break; case "waitForEditOwnLogProcess": //request.counter = 0; setNextStep(request, "goToListenServer"); if (getSomeElement("div", "class", "alert alert-error", 0) == null){ } else { location.reload(true); } break; case "goToListenServer": setNextStep(request, "listenForActivities"); goToPage("/internet"); break; default: break; } } //mail-unread label label-important //1 //Execute the steps function executeMissionStep(request){ var aux, count, aux2; switch(request.stepId){ case "chooseJob": //It shows the first choice panel aux = document.createElement("div"); aux.id = "gen-modal"; aux.className = "modal hide in"; aux.tabindex = "0"; aux['aria-hidden'] = false; aux.style.display = "block"; aux.innerHTML = '
'+ '