Last active
July 3, 2019 05:01
-
-
Save blackphreak/38fad4ef75b5e2b560ba0a8ef598feca to your computer and use it in GitHub Desktop.
a s0urce.io bot (last working: 2019-07-03 - 1101) (just for fun, hv bug)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var submitInterval = 300; | |
| var setting = { | |
| port : -1, | |
| id : undefined, | |
| num : -1, | |
| rndMin : 1, | |
| rndMax : 19, | |
| rushToTop: false, | |
| becomeRich: false, | |
| } | |
| var map = { | |
| // set e | |
| "../client/img/word/e/0": "client", | |
| "../client/img/word/e/1": "port", | |
| "../client/img/word/e/2": "add", | |
| "../client/img/word/e/3": "cookies", | |
| "../client/img/word/e/4": "key", | |
| "../client/img/word/e/5": "com", | |
| "../client/img/word/e/6": "val", | |
| "../client/img/word/e/7": "system", | |
| "../client/img/word/e/8": "signal", | |
| "../client/img/word/e/9": "net", | |
| "../client/img/word/e/10": "type", | |
| "../client/img/word/e/11": "bytes", | |
| "../client/img/word/e/12": "upload", | |
| "../client/img/word/e/13": "point", | |
| "../client/img/word/e/14": "loop", | |
| "../client/img/word/e/15": "reset", | |
| "../client/img/word/e/16": "domain", | |
| "../client/img/word/e/17": "remove", | |
| "../client/img/word/e/18": "pass", | |
| "../client/img/word/e/19": "get", | |
| "../client/img/word/e/20": "http", | |
| "../client/img/word/e/21": "send", | |
| "../client/img/word/e/22": "user", | |
| "../client/img/word/e/23": "delete", | |
| "../client/img/word/e/24": "temp", | |
| "../client/img/word/e/25": "part", | |
| "../client/img/word/e/26": "count", | |
| "../client/img/word/e/27": "write", | |
| "../client/img/word/e/28": "call", | |
| "../client/img/word/e/29": "list", | |
| "../client/img/word/e/30": "left", | |
| "../client/img/word/e/31": "data", | |
| "../client/img/word/e/32": "url", | |
| "../client/img/word/e/33": "log", | |
| "../client/img/word/e/34": "dir", | |
| "../client/img/word/e/35": "root", | |
| "../client/img/word/e/36": "buffer", | |
| "../client/img/word/e/37": "poly", | |
| "../client/img/word/e/38": "set", | |
| "../client/img/word/e/39": "ghost", | |
| "../client/img/word/e/40": "host", | |
| "../client/img/word/e/41": "load", | |
| "../client/img/word/e/42": "init", | |
| "../client/img/word/e/43": "join", | |
| "../client/img/word/e/44": "emit", | |
| "../client/img/word/e/45": "event", | |
| "../client/img/word/e/46": "info", | |
| "../client/img/word/e/47": "file", | |
| "../client/img/word/e/48": "num", | |
| "../client/img/word/e/49": "status", | |
| "../client/img/word/e/50": "intel", | |
| "../client/img/word/e/51": "global", | |
| "../client/img/word/e/52": "size", | |
| "../client/img/word/e/53": "socket", | |
| "../client/img/word/e/54": "right", | |
| "../client/img/word/e/55": "add", | |
| "../client/img/word/e/56": "stat", | |
| "../client/img/word/e/57": "xml", | |
| "../client/img/word/e/58": "bit", | |
| "../client/img/word/e/59": "ping", | |
| "../client/img/word/e/60": "handle", | |
| "../client/img/word/e/61": "anon", | |
| // set h | |
| "../client/img/word/h/0": "fileexpresslog", | |
| "../client/img/word/h/1": "disconnectchannel", | |
| "../client/img/word/h/2": "checkhttptype", | |
| "../client/img/word/h/3": "sizeofhexagon", | |
| "../client/img/word/h/4": "respondertimeout", | |
| "../client/img/word/h/5": "create2axisvector", | |
| "../client/img/word/h/6": "getfirewallchannel", | |
| "../client/img/word/h/7": "dodecahedron", | |
| "../client/img/word/h/8": "mergesocket", | |
| "../client/img/word/h/9": "removeoldcookie", | |
| "../client/img/word/h/10": "removenewcookie", | |
| "../client/img/word/h/11": "rootcookieset", | |
| "../client/img/word/h/12": "channelsetpackage", | |
| "../client/img/word/h/13": "hostnewserver", | |
| "../client/img/word/h/14": "loadloggedpassword", | |
| "../client/img/word/h/15": "setnewproxy", | |
| "../client/img/word/h/16": "loadaltevent", | |
| "../client/img/word/h/17": "uploaduserstats", | |
| "../client/img/word/h/18": "emitconfiglist", | |
| "../client/img/word/h/19": "deleteallids", | |
| "../client/img/word/h/20": "loadregisterlist", | |
| "../client/img/word/h/21": "wordcounter", | |
| "../client/img/word/h/22": "joinnetworkclient", | |
| "../client/img/word/h/23": "statusofprocess", | |
| "../client/img/word/h/24": "ghostfilesystem", | |
| "../client/img/word/h/25": "systemportkey", | |
| "../client/img/word/h/26": "generatecodepack", | |
| "../client/img/word/h/27": "blockthreat", | |
| "../client/img/word/h/28": "destroybatch", | |
| "../client/img/word/h/29": "exportconfigpackage", | |
| "../client/img/word/h/30": "getpartoffile", | |
| "../client/img/word/h/31": "systemgridtype", | |
| "../client/img/word/h/32": "create3axisvector", | |
| "../client/img/word/h/33": "encodenewfolder", | |
| "../client/img/word/h/34": "sendintelpass", | |
| "../client/img/word/h/35": "getxmlprotocol", | |
| "../client/img/word/h/36": "bufferpingset", | |
| "../client/img/word/h/37": "changepassword", | |
| "../client/img/word/h/38": "createnewsocket", | |
| "../client/img/word/h/39": "decryptdatabatch", | |
| "../client/img/word/h/40": "patcheventlog", | |
| "../client/img/word/h/41": "createnewpackage", | |
| "../client/img/word/h/42": "eventlistdir", | |
| "../client/img/word/h/43": "callmodule", | |
| "../client/img/word/h/44": "disconnectserver", | |
| "../client/img/word/h/45": "unpacktmpfile", | |
| "../client/img/word/h/46": "getmysqldomain", | |
| "../client/img/word/h/47": "tempdatapass", | |
| "../client/img/word/h/48": "includedirectory", | |
| "../client/img/word/h/49": "encryptunpackedbatch", | |
| "../client/img/word/h/50": "changeusername", | |
| "../client/img/word/h/51": "batchallfiles", | |
| "../client/img/word/h/52": "getdatapassword", | |
| "../client/img/word/h/53": "httpbuffersize", | |
| "../client/img/word/h/54": "createfilethread", | |
| // set m | |
| "../client/img/word/m/0": "config", | |
| "../client/img/word/m/1": "hexagon", | |
| "../client/img/word/m/2": "thread", | |
| "../client/img/word/m/3": "decryptfile", | |
| "../client/img/word/m/4": "package", | |
| "../client/img/word/m/5": "loadbytes", | |
| "../client/img/word/m/6": "generate", | |
| "../client/img/word/m/7": "eventtype", | |
| "../client/img/word/m/8": "module", | |
| "../client/img/word/m/9": "getlog", | |
| "../client/img/word/m/10": "setport", | |
| "../client/img/word/m/11": "export", | |
| "../client/img/word/m/12": "listconfig", | |
| "../client/img/word/m/13": "proxy", | |
| "../client/img/word/m/14": "filedir", | |
| "../client/img/word/m/15": "getpass", | |
| "../client/img/word/m/16": "setnewid", | |
| "../client/img/word/m/17": "getkey", | |
| "../client/img/word/m/18": "decrypt", | |
| "../client/img/word/m/19": "newline", | |
| "../client/img/word/m/20": "process", | |
| "../client/img/word/m/21": "sizeof", | |
| "../client/img/word/m/22": "responder", | |
| "../client/img/word/m/23": "length", | |
| "../client/img/word/m/24": "getinfo", | |
| "../client/img/word/m/25": "vector", | |
| "../client/img/word/m/26": "constructor", | |
| "../client/img/word/m/27": "serverproxy", | |
| "../client/img/word/m/28": "gridwidth", | |
| "../client/img/word/m/29": "newhost", | |
| "../client/img/word/m/30": "encryptfile", | |
| "../client/img/word/m/31": "getfile", | |
| "../client/img/word/m/32": "writefile", | |
| "../client/img/word/m/33": "syscall", | |
| "../client/img/word/m/34": "accountname", | |
| "../client/img/word/m/35": "response", | |
| "../client/img/word/m/36": "threat", | |
| "../client/img/word/m/37": "findpackage", | |
| "../client/img/word/m/38": "fillgrid", | |
| "../client/img/word/m/39": "encrypt", | |
| "../client/img/word/m/40": "disconnect", | |
| "../client/img/word/m/41": "server", | |
| "../client/img/word/m/42": "encode", | |
| "../client/img/word/m/43": "number", | |
| "../client/img/word/m/44": "setping", | |
| "../client/img/word/m/45": "gridheight", | |
| "../client/img/word/m/46": "newserver", | |
| "../client/img/word/m/47": "command", | |
| "../client/img/word/m/48": "setstats", | |
| "../client/img/word/m/49": "userport", | |
| "../client/img/word/m/50": "getid", | |
| "../client/img/word/m/51": "filetype", | |
| "../client/img/word/m/52": "setcookie", | |
| "../client/img/word/m/53": "userid", | |
| "../client/img/word/m/54": "connect", | |
| "../client/img/word/m/55": "protocol", | |
| "../client/img/word/m/56": "account", | |
| "../client/img/word/m/57": "hostserver", | |
| "../client/img/word/m/58": "datatype", | |
| "../client/img/word/m/59": "mysql", | |
| "../client/img/word/m/60": "download", | |
| "../client/img/word/m/61": "username", | |
| "../client/img/word/m/62": "urlcheck", | |
| "../client/img/word/m/63": "getping", | |
| "../client/img/word/m/64": "password", | |
| "../client/img/word/m/65": "channel", | |
| }; | |
| function getRandomInt(min, max) { | |
| return Math.floor(Math.random() * Math.floor(max)) + min; | |
| } | |
| var killFlag = false, | |
| retry = 5; | |
| var pickedPort = "", | |
| loopCounter = 0; | |
| confirmAttack = () => { | |
| if (killFlag) { | |
| return; | |
| } | |
| retry--; | |
| if (retry <= 0) | |
| { | |
| console.error("end game, on99 bug"); | |
| retry = 10; | |
| return; | |
| } | |
| setTimeout(() => { | |
| let btnid = $(".button.window-other-attackbutton-clicked").attr("id"); | |
| if (btnid == pickedPort) { | |
| console.info("[confirmAttack] success, target:", $(".button.window-other-attackbutton-clicked").attr("id")); | |
| console.log(" "); | |
| loopCounter = 0; | |
| reg(); | |
| typeAndSubmit(); | |
| } | |
| else if (btnid == undefined) { | |
| hackNext(); | |
| return; | |
| } | |
| else { | |
| console.warn("[confirmAttack] failed, target is not match.\nCurrent: %s\nWanted: %s", | |
| $(".button.window-other-attackbutton-clicked").attr("id"), | |
| pickedPort | |
| ); | |
| setTimeout(confirmAttack, 700); | |
| } | |
| }, 300); | |
| } | |
| var richPeopleList = {}; | |
| hackNext = () => { | |
| if (killFlag) { | |
| return; | |
| } | |
| loopCounter++; | |
| if (loopCounter > 1) | |
| { | |
| console.warn("[hackNext] loop detected. I will die to prevent loop."); | |
| loopCounter = 0; | |
| return; | |
| } | |
| console.info("[hackNext] called, selecting target."); | |
| let targetNum = (setting["num"] > -1) ? setting["num"] : getRandomInt(setting.rndMin, setting.rndMax); | |
| let id = -1; | |
| let lst = $("#player-list > tr > .list-table-name"); | |
| while (targetNum >= lst.length) | |
| targetNum = getRandomInt(setting.rndMin, lst.length-1); | |
| if (setting.becomeRich) | |
| { | |
| if ($(".window-content").html().indexof("Can't find target.") > -1) | |
| { | |
| richPeopleList = {}; | |
| $("..window-content").html(""); | |
| $(lst[targetNum]).click(); | |
| } | |
| else | |
| { | |
| $(".log-gained").each(item => { | |
| $item = $(item); | |
| uid = $($item.parent().find("#hackedid-form")).attr("data-text"); | |
| money = parseInt($item.html()); | |
| richPeopleList[uid] = money; | |
| }); | |
| richPeopleList[Symbol.iterator] = function* () { | |
| yield* [...this.entries()].sort((a, b) => a[1] - b[1]); | |
| } | |
| // top rich guy | |
| id = richPeopleList.keys().next().value; | |
| $("#targetid-input").val(id); | |
| $("#targetid-button").click(); | |
| } | |
| } | |
| else if (setting.rushToTop) | |
| { | |
| if ($("#leaderboard-first-name").html() != $("#window-my-playername").html()) | |
| { | |
| id = getRandomInt(1, 10); | |
| console.info("[hackNext] rushing to top, lets bully:", id); | |
| $("#targetid-input").val(id); | |
| $("#targetid-button").click(); | |
| } | |
| } | |
| else | |
| { | |
| // select next target | |
| if (setting.id != undefined) | |
| { | |
| id = setting.id; | |
| console.info("[hackNext] target provided:", id); | |
| $("#targetid-input").val(id); | |
| $("#targetid-button").click(); | |
| } | |
| else | |
| { | |
| console.info("[hackNext] pick random ppl on list: #", targetNum); | |
| $(lst[targetNum]).click(); | |
| } | |
| } | |
| // pick a port to hack | |
| setTimeout(() => { | |
| $("#window-other-button").click(); | |
| setTimeout(() => { | |
| pickedPort = "window-other-port" + (setting["port"] > -1 ? setting["port"] : getRandomInt(1, 3)); | |
| $("#" + pickedPort).click(); | |
| retry = 10; | |
| confirmAttack(); | |
| }, 500); | |
| }, 200); | |
| } | |
| typeAndSubmit = () => { | |
| let src = $(".tool-type-img").attr("src"); | |
| if (src == "../client/img/words/template.png") { | |
| dereg(); | |
| $(".button.targetmessage-button-cancel").click(); | |
| // game end, hack next | |
| hackNext(); | |
| return; | |
| } | |
| $("#tool-type-word").val( | |
| map[src] | |
| ); | |
| setTimeout(() => { | |
| $("#tool-type-form").submit(); | |
| }, submitInterval); | |
| } | |
| var watchDogCounter = 0, | |
| watchDogPrevious = "", | |
| resetCounter = 0; | |
| watchDog = () => { | |
| if (killFlag) | |
| { | |
| console.warn("[watchdog] kill flag is true, terminating..."); | |
| return; | |
| } | |
| let src = $(".tool-type-img").attr("src"); | |
| if (src == watchDogPrevious) { | |
| watchDogCounter++; | |
| console.warn("[watchdog] is dead? retrying...\nwatchDogCounter: %d\nresetCounter: %d", watchDogCounter, resetCounter); | |
| dereg(); | |
| reg(); | |
| typeAndSubmit(); | |
| if (watchDogCounter >= 3) { | |
| // 6s timeout | |
| console.error("[watchdog] dead confirmed, reseting."); | |
| watchDogCounter = 0; //reset | |
| resetCounter++; | |
| killFlag = true; | |
| setTimeout(() => { | |
| killFlag = false; | |
| if (resetCounter >= 10) | |
| { | |
| console.error("[watchdog] This script has fatal error, dont use :("); | |
| resetCounter = 0; | |
| return; | |
| } | |
| // re-register event & submit again @ hotfix-2345 | |
| reg(); | |
| typeAndSubmit(); | |
| watchDog(); | |
| }, 3000); | |
| return; | |
| } | |
| } | |
| else | |
| { | |
| watchDogPrevious = src; | |
| watchDogCounter = 0; | |
| resetCounter = 0; | |
| } | |
| doUpgradeCheck(); | |
| setTimeout(watchDog, 2000); | |
| } | |
| doUpgradeCheck = () => { | |
| let myMoney = parseInt($("#window-my-coinamount").html()), | |
| targetMoney = parseInt($("#shop-quantum-server-value").html()); | |
| if (targetMoney > 400000 && myMoney < (targetMoney + 400000)) | |
| // TODO: setting.becomeRich = true; | |
| return; | |
| if (myMoney >= targetMoney) | |
| { | |
| $("#shop-quantum-server").click(); | |
| } | |
| else | |
| return; | |
| setTimeout(doUpgradeCheck, 200); | |
| } | |
| // on img change listener | |
| reg = () => { | |
| $('img.tool-type-img').on('load', function () { | |
| if (killFlag) | |
| return; | |
| typeAndSubmit(); | |
| }); | |
| } | |
| dereg = () => { | |
| $('img.tool-type-img').off('load'); | |
| } | |
| // 120s / 2mins clear console | |
| clearTask = () => { | |
| console.clear(); | |
| setTimeout(clearTask, 120000); | |
| } | |
| // start running | |
| clearTask(); | |
| hackNext(); | |
| watchDog(); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Abandoned.