├── .gitignore ├── README.md ├── accounts.example.txt ├── bot.js ├── package.json └── protos ├── protos.js └── updater.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | accounts.txt 3 | *.proto 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-csgo-reportbot 2 | 3 | A node-steam plugin for reporting players in Counter-Strike: Global Offensive.
4 | Demo: http://report-service.xyz 5 | 6 | ## Requirements 7 | 8 | | Prerequisite | How to check | How to install 9 | | --------------- | ------------ | ------------- | 10 | | Node.js 0.12.x | `node -v` | [nodejs.org](http://nodejs.org/) | 11 | 12 | Additionally, you will need at least one Steam account with CS:GO, and Steamguard must be deactivated. 13 | 14 | ## Installation 15 | 16 | 1. Download the latest [stable](https://github.com/Askwrite/node-csgo-reportbot/releases/latest) or [development](https://github.com/Askwrite/node-csgo-reportbot/archive/master.zip) version of this package. 17 | 2. Run `npm install` from your terminal 18 | 3. rename `accounts.example.txt` to `accounts.txt` and modify it with your account credentials. You may enter multiple accounts. 19 | 20 | ## Usage 21 | 22 | ``` 23 | npm start 24 | ``` 25 | 26 | You will be prompted to enter the target player's SteamID64 27 | 28 | ![](http://i.imgur.com/PPEIPx8.png) 29 | 30 | ### Updating Protocol Definitions 31 | 32 | ``` 33 | npm run update 34 | ``` 35 | 36 | ## Note 37 | Don't kill the process by yourself!
38 | The process will be killed automatically after it finished to report the target with all the accounts. 39 | 40 | ## Credits 41 | 42 | * Based on [node-steam](https://github.com/seishun/node-steam) by [seishun](https://github.com/seishun) 43 | * Trololo for the idea 44 | -------------------------------------------------------------------------------- /accounts.example.txt: -------------------------------------------------------------------------------- 1 | imtotallylegit:supersecretpassword 2 | somesmurf:Password1! -------------------------------------------------------------------------------- /bot.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"), 2 | Steam = require("steam"), 3 | SteamID = require("steamid"), 4 | IntervalIntArray = {}, 5 | readlineSync = require("readline-sync"), 6 | Protos = require("./protos/protos.js"), 7 | CountReports = 0, 8 | Long = require("long"), 9 | SteamClients = {}, 10 | SteamUsers = {}, 11 | SteamGCs = {}, 12 | SteamFriends = {}, 13 | process = require("process"), 14 | steamID = readlineSync.question("SteamID64 which will be reported: "), 15 | ClientHello = 4006, 16 | ClientWelcome = 4004; 17 | 18 | var accounts = []; 19 | 20 | var arrayAccountsTxt = fs.readFileSync("accounts.txt").toString().split("\n"); 21 | for (i in arrayAccountsTxt) { 22 | var accInfo = arrayAccountsTxt[i].toString().trim().split(":"); 23 | var username = accInfo[0]; 24 | var password = accInfo[1]; 25 | accounts[i] = []; 26 | accounts[i].push({ 27 | username: username, 28 | password: password 29 | }); 30 | } 31 | 32 | arrayAccountsTxt.forEach(processSteamReport); 33 | 34 | function processSteamReport(element, indexElement, array) { 35 | if (element != "") { 36 | var account = element.toString().trim().split(":"); 37 | var account_name = account[0]; 38 | var password = account[1]; 39 | SteamClients[indexElement] = new Steam.SteamClient(); 40 | SteamUsers[indexElement] = new Steam.SteamUser(SteamClients[indexElement]); 41 | SteamGCs[indexElement] = new Steam.SteamGameCoordinator(SteamClients[indexElement], 730); 42 | SteamFriends[indexElement] = new Steam.SteamFriends(SteamClients[indexElement]); 43 | 44 | SteamClients[indexElement].connect(); 45 | 46 | SteamClients[indexElement].on("connected", function() { 47 | SteamUsers[indexElement].logOn({ 48 | account_name: account_name, 49 | password: password 50 | }); 51 | }); 52 | 53 | SteamClients[indexElement].on("logOnResponse", function(res) { 54 | if (res.eresult !== Steam.EResult.OK) { 55 | if (res.eresult == Steam.EResult.ServiceUnavailable) { 56 | console.log("\n[STEAM CLIENT - " + account_name + "] Login failed - STEAM IS DOWN!"); 57 | console.log(res); 58 | SteamClients[indexElement].disconnect(); 59 | process.exit(); 60 | } else { 61 | console.log("\n[STEAM CLIENT - " + account_name + "] Login failed!"); 62 | console.log(res); 63 | SteamClients[indexElement].disconnect(); 64 | SteamClients.splice(indexElement, 1); 65 | SteamFriends.splice(indexElement, 1); 66 | SteamGCs.splice(indexElement, 1); 67 | SteamUsers.splice(indexElement, 1); 68 | IntervalIntArray.splice(indexElement, 1); 69 | } 70 | } else { 71 | SteamFriends[indexElement].setPersonaState(Steam.EPersonaState.Offline); 72 | 73 | SteamUsers[indexElement].gamesPlayed({ 74 | games_played: [{ 75 | game_id: 730 76 | }] 77 | }); 78 | 79 | if (SteamGCs[indexElement]) { 80 | IntervalIntArray[indexElement] = setInterval(function() { 81 | SteamGCs[indexElement].send({ 82 | msg: ClientHello, 83 | proto: {} 84 | }, new Protos.CMsgClientHello({}).toBuffer()); 85 | }, 2000); 86 | } else { 87 | SteamClients[indexElement].disconnect(); 88 | SteamClients.splice(indexElement, 1); 89 | SteamFriends.splice(indexElement, 1); 90 | SteamGCs.splice(indexElement, 1); 91 | SteamUsers.splice(indexElement, 1); 92 | IntervalIntArray.splice(indexElement, 1); 93 | } 94 | } 95 | }); 96 | 97 | SteamClients[indexElement].on("error", function(err) { 98 | console.log("[STEAM CLIENT - " + account_name + "] Account is probably ingame! Logged out!"); 99 | SteamClients[indexElement].disconnect(); 100 | SteamClients.splice(indexElement, 1); 101 | SteamFriends.splice(indexElement, 1); 102 | SteamGCs.splice(indexElement, 1); 103 | SteamUsers.splice(indexElement, 1); 104 | IntervalIntArray.splice(indexElement, 1); 105 | }); 106 | 107 | SteamGCs[indexElement].on("message", function(header, buffer, callback) { 108 | switch (header.msg) { 109 | case ClientWelcome: 110 | clearInterval(IntervalIntArray[indexElement]); 111 | sendReport(SteamGCs[indexElement], SteamClients[indexElement], account_name, steamID); 112 | break; 113 | case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_MatchmakingGC2ClientHello: 114 | break; 115 | case Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportResponse: 116 | CountReports++; 117 | console.log("[GC - " + account_name + "] (" + CountReports + ") Report with confirmation ID: " + Protos.CMsgGCCStrike15_v2_ClientReportResponse.decode(buffer).confirmationId.toString() + " sent!"); 118 | SteamClients[indexElement].disconnect(); 119 | SteamClients.splice(indexElement, 1); 120 | SteamFriends.splice(indexElement, 1); 121 | SteamGCs.splice(indexElement, 1); 122 | SteamUsers.splice(indexElement, 1); 123 | IntervalIntArray.splice(indexElement, 1); 124 | break; 125 | default: 126 | console.log(header); 127 | break; 128 | } 129 | }); 130 | } 131 | } 132 | 133 | function sendReport(GC, Client, account_name) { 134 | var account_id = new SteamID(steamID).accountid; 135 | GC.send({ 136 | msg: Protos.ECsgoGCMsg.k_EMsgGCCStrike15_v2_ClientReportPlayer, 137 | proto: {} 138 | }, new Protos.CMsgGCCStrike15_v2_ClientReportPlayer({ 139 | accountId: account_id, 140 | matchId: 8, 141 | rptAimbot: 2, 142 | rptWallhack: 3, 143 | rptSpeedhack: 4, 144 | rptTeamharm: 5, 145 | rptTextabuse: 6, 146 | rptVoiceabuse: 7 147 | }).toBuffer()); 148 | } 149 | 150 | process.on("uncaughtException", function(err) {}); 151 | 152 | console.log("Initializing ReportBot by askwrite...\nCredits: Trololo - Idea"); 153 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csgo-reportbot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "bot.js", 6 | "dependencies": { 7 | "long": "^3.1.0", 8 | "protobufjs": "^5.0.1", 9 | "q": "^1.4.1", 10 | "readline-sync": "^1.4.4", 11 | "steam": "^1.4.0", 12 | "steamid": "^1.1.0" 13 | }, 14 | "devDependencies": {}, 15 | "scripts": { 16 | "update": "node ./protos/updater.js", 17 | "install": "npm run update", 18 | "start": "node bot.js" 19 | }, 20 | "repository": { 21 | "type": "git", 22 | "url": "node-csgo-reportbot" 23 | }, 24 | "author": "askwrite", 25 | "license": "ISC" 26 | } 27 | -------------------------------------------------------------------------------- /protos/protos.js: -------------------------------------------------------------------------------- 1 | var Protobuf = require("protobufjs"); 2 | 3 | Protobuf.convertFieldsToCamelCase = true; 4 | 5 | var builder = Protobuf.newBuilder(); 6 | Protobuf.loadProtoFile(__dirname + "/base_gcmessages.proto", builder); 7 | Protobuf.loadProtoFile(__dirname + "/cstrike15_gcmessages.proto", builder); 8 | Protobuf.loadProtoFile(__dirname + "/gcsdk_gcmessages.proto", builder); 9 | 10 | module.exports = builder.build(); 11 | -------------------------------------------------------------------------------- /protos/updater.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var https = require("https"); 3 | 4 | var baseUrl = "https://raw.githubusercontent.com/SteamRE/SteamKit/master/Resources/Protobufs/csgo/"; 5 | var protos = [ 6 | "base_gcmessages.proto", 7 | "steammessages.proto", 8 | "cstrike15_gcmessages.proto", 9 | "gcsdk_gcmessages.proto", 10 | "engine_gcmessages.proto" 11 | ]; 12 | 13 | fs.readdir(__dirname, function(err, filenames) { 14 | if (err) { 15 | return err; 16 | } 17 | 18 | filenames.forEach(function(filename) { 19 | if (filename != "protos.js" && filename != "updater.js") { 20 | fs.unlinkSync(__dirname + "/" + filename); 21 | } 22 | }); 23 | 24 | protos.forEach(function(proto) { 25 | var file = fs.createWriteStream(__dirname + "/" + proto); 26 | https.get(baseUrl + proto, function(response) { 27 | response.pipe(file); 28 | }); 29 | }); 30 | }); 31 | --------------------------------------------------------------------------------