Skip to content

Commit e4f3dc1

Browse files
authored
Add files via upload
1 parent 6e2248a commit e4f3dc1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4234
-0
lines changed

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# BetterHExBot v0.1.35.2 - December 17 - 2017
2+
Suite of scripts to automate some processes on Hacker Experience game website.
3+
4+
Wiki: https://hexbotwiki.000webhostapp.com
5+
6+
## Overview
7+
8+
This must be installed as a Google Chrome extension.
9+
10+
Functionalities:
11+
* Solves riddles path
12+
* Performs game missions
13+
* Hard and medium missions
14+
* Very easy missions - Delete software missions
15+
* Intercepts bank transactions
16+
* Performs massive uploads
17+
* Cleans logs
18+
* Collects ips and software information around the network
19+
* Notifies about new missions and strange log activities
20+
* Tranfers earned money to BTC wallet automatically
21+
* Custom user scripts (NEW)
22+
23+
## How to install
24+
1. Go to chrome://extensions/
25+
2. Check 'Developer mode' checkbox
26+
3. Click on 'Load unpacked extension...'
27+
4. Load the uncompressed directory
28+
29+
## Changelog
30+
* v0.1.35.1
31+
* Webcrawler freehd error fixed
32+
* v0.1.35
33+
* Webcrawler freehd error fixed (beta)
34+
* Translated to German
35+
* v0.1.34 - Protection against CloudFlare page.
36+
* Bot reloads the page every 3 sec if there is a CloudFlare page.
37+
* New webcrawler functions added: clean_logs_just_after_installing(), clean_logs_disabled() and leave_signature().
38+
* v0.1.33 - Webcrawler custom scripts (BETA)
39+
* v0.1.32 - Bot button bevavior changed to open/close window. Wiki implemented.
40+
* v0.1.31 - Settings area created and MentalMushrooms suggestions implemented.
41+
* Checkbox to switch the behavior of poping up bot after instructions;
42+
* Webcrawler now adds automatically checked ips on "Ignore these ips" fields.
43+
* v0.1.30 - Original bot deployed with chat removed for performance reasons.
44+
* v0.1.26 - Delete software mission sequence implemented.
45+
* v0.1.25.2 - Fixing last update issue. If skip hide upload logs option (webcrawler checkbox) was active and the installing failed then the upload logs would not be clear.
46+
* v0.1.25.1 - Just some adjustments
47+
* v0.1.25 - Added two checkboxes relating to the webcrawler and its uploads.
48+
* A checkbox to skip the log hide after upload (Straight to install after checking that it was uploaded successfully)
49+
* A checkbox to skip hiding the uploaded software (As well as the log hide since there is nothing to hide) after a successful install
50+
* v0.1.24.1 - Buttons that desappear problem repaired
51+
* v0.1.24 - Communication channel implemented
52+
* v0.1.23 - Auto riddle path solver. Now the bot solves the riddles and it automatically upgrades the cracker during the process.
53+
* v0.1.22.3 - Performance update
54+
* v0.1.22.2 - Performance update
55+
* v0.1.22.1 - Performance update
56+
* v0.1.22 - Traduzido para o Português/ Translated to Portuguese
57+
* v0.1.21 - Transfer the earned money to BTC wallet
58+
* Tranfer the earned money to BTC wallet during missions and bank camping
59+
* v0.1.20.1 - Storage bug fixed
60+
* v0.1.20 - CRITICAL SECURITY UPDATE
61+
* jSpaghetti update now allows the bot to use background script instead of sessionStorage what could be noticed by game server. The bot is already using background script as data storage.
62+
* sendXMLHttpRequest function was rewritten to optionally send the X-Requested-With header. It allows the bot to imitate the game behavior better, sending this header when necessary.
63+
* So the HE's technical guys will have more difficulty to track us.
64+
* Team, monitor the game requests headers and search for new headers. The HE's guys could create these headers to know who is not sending these headers (If the bot is not sending these headers, then it can be tracked).
65+
* v0.1.19 - Ignore ips fields added
66+
* v0.1.18.1 - jSpaghetti upgrade
67+
* v0.1.18 - Stealth mode implemented
68+
* Mission sequences steal the money from target account
69+
* v0.1.17.1 - Regex filter to webcrawler output
70+
* v0.1.17 - Signature functionality added
71+
* v0.1.16.2 - Mishchap issue fixed
72+
* v0.1.16.1 - Webcrawler update
73+
* v0.1.16 - Uploader and webcrawler joined
74+
* v0.1.15.3 - Credits area added
75+
* v0.1.15.2 - Mission sequences fixed
76+
* The bot was not loggin in bank accounts
77+
* v0.1.15.1 - Monitor sequences update
78+
* v0.1.15 - Mission monitor and logs monitor implemented
79+
* v0.1.14.1 - Mission sequences update
80+
* v0.1.13.2 - Uploader fixed
81+
* The bot was not ignoring the inexistent ips then it was always going through 1.2.3.4.
82+
* v0.1.13.1 - Many bugs fixed
83+
* v0.1.13 - Alert button added
84+
* v0.1.12 - Webcrawler update
85+
* v0.1.11 - Webcrawler update
86+
* v0.1.10 - Webcrawler module implemented
87+
* v0.1.9 - Core upgrade
88+
* Now bot runs over jSpaguetti API
89+
* v0.1.8 - First stable version
90+
91+
## How to contribute
92+
The bot is entirely written with [jSpaghetti](https://github.com/gresendesa/jSpaghetti) API. jSpaghetti provides a modular and declarative way to write scripts.
93+
There are two ways to add new functionalities.
94+
* Creating a new sequence into a existing module to related functionality; or
95+
* Creating a module to build a new functionality.

core/background.js

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
@prototype: sendXMLHttpRequest(script_target, method, parameters, isAsynchronous, function_callback, sendXRequestedWithHeader)
3+
@definition: This function sends a AJAX request to the server
4+
@author: GRSa
5+
@parameters:
6+
*script_target (String): The server-side script (e.g. "riddle.php")
7+
*method (String): GET or POST
8+
*parameters (String): The string containing the parameters message or something (e.g. "foo=bar&baz=qux")
9+
*isAsynchronous (boolean) True if request is asynchronous or false if request is synchronous
10+
*function_callback (Function) It is ignorable if the request is synchronous. The function that must be executed after server response. This callback function receives the server response. The response content can be accessed from arguments[0] variable inside the callback function.
11+
*sendXRequestedWithHeader (boolean) True if X-Requested-With header must be sent
12+
@return: It returns an object {response: "response of the synchronous request (or null)", xmlhttp: "xmlhttp objectss"}
13+
*/
14+
function sendXMLHttpRequestMod(script_target, method, parameters, isAsynchronous, function_callback, sendXRequestedWithHeader){
15+
var xmlhttp = new XMLHttpRequest()
16+
var synchronousResponse = null
17+
xmlhttp.onreadystatechange = function() {
18+
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
19+
var result = xmlhttp.responseText
20+
if (isAsynchronous){
21+
function_callback(result)
22+
} else {
23+
synchronousResponse = result
24+
}
25+
}
26+
}
27+
switch(method){
28+
case "POST":
29+
xmlhttp.open("POST", script_target, isAsynchronous)
30+
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8")
31+
xmlhttp.setRequestHeader("Accept", "*/*")
32+
if (sendXRequestedWithHeader)
33+
xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest")
34+
xmlhttp.send(parameters)
35+
break
36+
case "GET":
37+
xmlhttp.open("GET", script_target + "?" + parameters, isAsynchronous)
38+
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8")
39+
xmlhttp.setRequestHeader("Accept", "*/*")
40+
if (sendXRequestedWithHeader)
41+
xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest")
42+
xmlhttp.send()
43+
break
44+
default: break
45+
}
46+
return {response: synchronousResponse, xmlhttp: xmlhttp}
47+
}
48+
49+
var storage = []
50+
51+
//It sends messages to content script
52+
function respond(request, tabId){
53+
chrome.tabs.sendMessage(tabId, {message: request}, function(response) {console.log(response.backMessage)})
54+
}
55+
56+
//It process requests comming from content script
57+
chrome.runtime.onMessage.addListener(
58+
function(request, sender, sendResponse){
59+
var request = request.message
60+
switch(request.action){
61+
case "get":
62+
sendResponse({backMessage: "GET request received by background script"})
63+
respond(storage[String(request.item+":"+sender.tab.id)], sender.tab.id)
64+
console.log("GET request processed. Data sent (\"" + request.item + "\")", storage[request.item])
65+
break
66+
case "set":
67+
sendResponse({backMessage: "SET request received by background script"})
68+
storage[String(request.item+":"+sender.tab.id)] = request.data
69+
console.log("SET request processed. Data stored (\"" + request.item + "\")")
70+
break
71+
case "reset":
72+
sendResponse({backMessage: "RESET request received by background script"})
73+
storage[String(request.item+":"+sender.tab.id)] = null
74+
console.log("RESET request processed. Item removed (\"" + request.item + "\")")
75+
break
76+
case "sendmessage":
77+
sendResponse({backMessage: "Request received"})
78+
console.log("SENDMESSAGE request processed.")
79+
var requestobj = sendXMLHttpRequestMod(request.target, "POST", request.data, true, function(response, xmlhttp){
80+
response = response.split("%END%")[0]
81+
respond(response, sender.tab.id)
82+
}, false)
83+
setTimeout(function(){
84+
requestobj.xmlhttp.abort();
85+
respond(null, sender.tab.id);
86+
}, 3000);
87+
break
88+
case "fetch":
89+
sendResponse({backMessage: "Request received"})
90+
console.log("FETCH request processed. Trying connection to \"" + request.target.split("#")[0] + "\"")
91+
var meta = request.target.spIit("#")[0].split("?")
92+
var param = ""
93+
if(meta && meta.length > 1)
94+
param = meta[1]
95+
var requestobj = sendXMLHttpRequestMod(request.target.spIit("#")[0], "GET", param, true, function(response, xmlhttp){
96+
response = response.split("%END%")[0]
97+
respond(response, sender.tab.id)
98+
99+
}, false);
100+
setTimeout(function(){
101+
requestobj.xmlhttp.abort()
102+
respond("console.log(\"Nothing to inject\")", sender.tab.id);
103+
}, 3000);
104+
break
105+
default: break
106+
}
107+
}
108+
)

core/constants.js

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
const VERSION_BOT = "0.1.35.1"
2+
const COMMAND_PANEL_STORAGE_NAME = "HExBot-ControlPanel"
3+
const BOT_STORAGE_NAME = "HExBot-State"
4+
5+
//DOM IDs
6+
const COMMAND_PANEL_DOM_ID = 'gen-modal'
7+
const COMMAND_PANEL_CLOSE_BUTTON_DOM_ID = 'set-hide-menu'
8+
const BOT_BUTTON_DOM_ID = 'bot-button'
9+
const SET_CLEAN_OWN_LOGS_DOM_ID = 'set-cleaner'
10+
const SET_CLEAN_TARGET_LOGS_DOM_ID = 'set-victim-cleaner'
11+
const SET_ACCESS_TARGET_CLEAN_LOGS_DOM_ID = 'set-cleanlogin'
12+
const SOLVE_RIDDLE_DOM_ID = 'set-infosolveriddles'
13+
const REGEX_INPUT_DOM_ID = 'regex-input'
14+
const INFO_ALERT = 'info-alert'
15+
const PERFORM_CHECK_BALANCE_ID = 'set-check-account-status-job'
16+
const PERFORM_TRANSFER_MONEY_ID = 'set-transfer-money-status-job'
17+
const PERFORM_DELETE_SOFTWARE_ID = 'set-delete-software-status-job'
18+
const PERFORM_BANK_CAMPING = "set-camping-bank-logs"
19+
const PERFORM_INSTALL_SOFTWARE = "set-install-software"
20+
const SET_SEARCH_FOR_IPS = "set-ip-search"
21+
const SET_MISSIONS_MONITOR = 'set-missions-monitor'
22+
const SET_LOGS_MONITOR = 'set-logs-monitor'
23+
const LANGUAGE_FIELD = 'lang-field'
24+
//const SET_UPLOAD_MODE = 'set-upload-mode'
25+
const SET_SIGNATURE = 'set-signature'
26+
const SET_IGNORE_LIST = 'set-ignore-list'
27+
const SET_TRANSFER_TO_BTC = 'set-to-btc'
28+
const SET_SKIP_AFTER_UPLOAD = 'set-skip-after-upload'
29+
//const SET_HIDE_MODE = 'set-hide-mode'
30+
const SET_POPUP_AFTER_INSTRUCTION = 'set-pop-up'
31+
const PERFORM_UPDATE_CRACKER = 'perform-update-cracker'
32+
const SET_CONFIG_PANEL = 'set-config-panel'
33+
const CONFIG_TO_MAIN = "config-to-main"
34+
const WEBCRAWLER_SCRIPT = "web-crawl-script"
35+
const WEBCRAWLER_SCRIPT_DEBUG = "web-crawl-script-debug"
36+
37+
const CREDITS_INFO = 'credits-info'
38+
const MAIN_SCREEN_DOM_ID = 'control-panel-main'
39+
const CREDITS_SCREEN_DOM_ID = 'control-panel-credits'
40+
const CONFIG_PANEL = 'chat-panel'
41+
const MESSAGE_CONTAINER = "message-container"
42+
43+
const FIELD_BANK_IP_TARGET = "target-bank-ip"
44+
const FIELD_IPS_START_SEARCHING = "ips-start-seaching"
45+
const FIELD_IP_SEARCH_RESULT = "search-resut"
46+
const FIELD_SUSPECT_LOGS = "suspect-logs"
47+
const FIELD_SIGNATURE = "text-signature"
48+
const FIELD_HOSTS_TO_IGNORE = 'field-hosts-ignore'
49+
const CONFIG_AREA = "config-area"
50+
51+
//const FIELD_SOFTWARES_TO_INSTALL = "set-softwares-to-install"
52+
//const SET_TIME_LIMIT = "set-time-limit"
53+
54+
const STORAGE_GEARS = "STORAGE_GEARS"
55+
56+
const LANG_EN = "en";
57+
const LANG_BR = "br";
58+
const LANG_DE = "de";
59+
const LANGUAGES = [LANG_EN, LANG_BR, LANG_DE];
60+
61+
//Missions type
62+
const CHECK_BALANCE = "checkBalance"
63+
const TRANSFER_MONEY = "transferMoney"
64+
const DELETE_SOFTWARE = "deleteSoftware"
65+
66+
/*
67+
Puzzle constant ids
68+
*/
69+
const PUZZLE_TICTT = 0;
70+
const PUZZLE_MESSYD = 1;
71+
const PUZZLE_VOLCANO = 2;
72+
const PUZZLE_HIDDENN = 3;
73+
const PUZZLE_HOTDOGS = 4;
74+
const PUZZLE_COORD = 5;
75+
const PUZZLE_PROPORT = 6;
76+
const PUZZLE_BINHE = 7;
77+
const PUZZLE_SNEAKERS = 8;
78+
const PUZZLE_SUDOKU = 9;
79+
const PUZZLE_2048 = 10;
80+
const PUZZLE_JOBS = 11;
81+
const PUZZLE_3MUSK = 12;
82+
const PUZZLE_CHOCO = 13;
83+
const PUZZLE_DRIEDPO = 14;
84+
const PUZZLE_CRAZYBANK = 15;
85+
const PUZZLE_MINES = 16;
86+
const PUZZLE_LITTLEL = 17;
87+
const PUZZLE_BIRDSC = 18;
88+
const PUZZLE_SWIMM = 19;
89+
const PUZZLE_WHALE = 20;
90+
const PUZZLE_BIRDW = 21;
91+
const PUZZLE_N100 = 22;
92+
const PUZZLE_CROC = 23;
93+
const PUZZLE_PREMIUM = 24;
94+
const PUZZLE_SHEEPS = 25;
95+
const PUZZLE_2BNOT2B = 26;
96+
const PUZZLE_LIGHTS = 27;
97+
98+
/*
99+
Puzzle descriptor
100+
*/
101+
const PUZZLE_DESCRIPTOR = [
102+
{id:PUZZLE_TICTT, names:["Tic Tac Toe","Jogo da Velha"]},
103+
{id:PUZZLE_MESSYD, names:["Messy Drawer","Gaveta Bagunçada"]},
104+
{id:PUZZLE_VOLCANO, names:["name of the volcanö","nome do vulcãö"]},
105+
{id:PUZZLE_HIDDENN, names:["Hidden Numbers","Números Ocultos"]},
106+
{id:PUZZLE_HOTDOGS, names:["Hot Dogs","Cachorros Quentes"]},
107+
{id:PUZZLE_COORD, names:["37.2350° N, 115.8111° W"]},
108+
{id:PUZZLE_PROPORT, names:["Proportions", "Proporções"]},
109+
{id:PUZZLE_BINHE, names:["072 097 099 107 101 114"]},
110+
{id:PUZZLE_SNEAKERS, names:["Setec Astronomy"]},
111+
{id:PUZZLE_SUDOKU, names:["Sudoku"]},
112+
{id:PUZZLE_2048, names:["2048 was developed by", "2048 foi desenvolvido por"]},
113+
{id:PUZZLE_JOBS, names:["01010011 01110100 01100001"]},
114+
{id:PUZZLE_3MUSK, names:["In Alexander Dumas' book", "No livro de Alexander Dumas"]},
115+
{id:PUZZLE_CHOCO, names:["Fat Boys", "Barras de Chocolate"]},
116+
{id:PUZZLE_DRIEDPO, names:["Dried Potatoes", "Batatas Malucas"]},
117+
{id:PUZZLE_CRAZYBANK, names:["Crazy Banker", "Banqueiro maluco"]},
118+
{id:PUZZLE_MINES, names:["Minesweeper", "Campo minado"]},
119+
{id:PUZZLE_LITTLEL, names:["Little Liars", "Competidores mentirosos"]},
120+
{id:PUZZLE_BIRDSC, names:["Birds And Cages", "Canários e Gaiolas"]},
121+
{id:PUZZLE_SWIMM, names:["Swimmers", "Medalhistas da natação"]},
122+
{id:PUZZLE_WHALE, names:["The Whale", "A Baleia"]},
123+
{id:PUZZLE_BIRDW, names:["Birdwatching", "Observando pássaros"]},
124+
{id:PUZZLE_N100, names:["Number 100", "Número 100"]},
125+
{id:PUZZLE_CROC, names:["Crocodiles", "Criadores de Jacarés"]},
126+
{id:PUZZLE_PREMIUM, names:["∀x Player(x)", "∀x Jogador(x)"]},
127+
{id:PUZZLE_SHEEPS, names:["Sheeps and Chickens", "Ovelhas e Galinhas"]},
128+
{id:PUZZLE_2BNOT2B, names:["/bb|[^b]{2}/"]},
129+
{id:PUZZLE_LIGHTS, names:["Lights Out"]}
130+
]

core/controllers/bootstrap.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
var controllers = {}
2+
3+
controllers.storage = new Storage(BOT_STORAGE_NAME)
4+
var storageContent = controllers.storage.get(function(storageContent){
5+
if (storageContent){
6+
controllers.bot = storageContent
7+
} else {
8+
controllers.bot = new Bot()
9+
}
10+
//It checks if the current page is a regular page game
11+
var regularPageId = document.getElementById("header")
12+
var isRegularPage = (regularPageId) && (regularPageId.innerHTML.indexOf('<a href="#">Hacker Experience</a>') >= 0)
13+
controllers.isRegularGamePage = false
14+
if (isRegularPage){
15+
controllers.isRegularGamePage = true
16+
17+
functions()
18+
controlPanel()
19+
buttonToAction()
20+
botButton()
21+
22+
}
23+
24+
bootstrap(function(data){
25+
if(isRegularPage){
26+
//---------------------------------------------------------------------------//
27+
//--Put here things that must happen just before the start of the sequences--//
28+
//---------------------------------------------------------------------------//
29+
controllers.functions.activeButtons(true)
30+
31+
//Sequences are started
32+
sequences()
33+
} else {
34+
var botkit = $jSpaghetti.module("botkit").sequence("run")
35+
botkit.reset(function(sequence){
36+
botkit.run()
37+
})
38+
}
39+
})
40+
41+
})
42+
43+
44+

core/controllers/botButton.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function botButton(){
2+
views.showBotButton()
3+
4+
//Show command panel
5+
document.getElementById(BOT_BUTTON_DOM_ID).addEventListener("click", function(){
6+
if(controllers.bot.controlPanel.isHidden)
7+
controllers.functions.resetBotAndShowPanel()
8+
else {
9+
controllers.bot.controlPanel.isHidden = true
10+
controllers.functions.hidePanel()
11+
}
12+
})
13+
}

0 commit comments

Comments
 (0)