├── .gitignore ├── README.md ├── package.json ├── LICENSE └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## RoCheck 2 | 3 | Find the IP of a Roblox game server with just a bot cookie, place id and job id. 4 | 5 | ## Get started 6 | 7 | Using this module is very easy - just edit the code snippet below: 8 | 9 | ```JavaScript 10 | const rocheck = require('rocheck') 11 | 12 | rocheck(placeId, jobId, cookie).then(ip => { 13 | console.log(ip) 14 | }).catch(err => { 15 | console.log(err) 16 | }) 17 | ``` 18 | 19 | ## Support 20 | 21 | If you would like support with this module then message me on Discord (grilme99#9830) or the Developer Forum! 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rocheck", 3 | "version": "1.0.2", 4 | "description": "Find the IP of a Roblox game server with just a bot cookie, place id and job id", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/grilme99/RoCheck.git" 12 | }, 13 | "author": "grilme99 (Brooke Rhodes)", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/grilme99/RoCheck/issues" 17 | }, 18 | "homepage": "https://github.com/grilme99/RoCheck#readme", 19 | "dependencies": { 20 | "request": "^2.88.0", 21 | "request-promise": "^4.2.4" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jacob Rhodes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ROCHECK 3 | * 4 | * This module is used to validate that a request is really from Roblox. 5 | * It uses a bot cookie to "fake" a join request to a game and then 6 | * returns the IP address of the game server. 7 | * 8 | * This module should NOT be used for validating a request and should 9 | * only return the IP of the game server. The script using this module 10 | * should compare the IP. 11 | */ 12 | 13 | /** 14 | * Module dependencies 15 | */ 16 | const request = require('request-promise') // Used to make HTTP requests 17 | 18 | /** 19 | * Makes bot (with supplied cookie) initialize a join request to the game, 20 | * then returns the IP of the game server. 21 | * 22 | * @author grilme99 23 | * @param {Number} placeId 24 | * @param {String} jobId 25 | * @param {String} cookie 26 | * @return {Promise} ipAddress, game_data 27 | * @api public 28 | */ 29 | module.exports = (placeId, jobId, cookie) => { 30 | /** 31 | * Return promise 32 | */ 33 | return new Promise(async (resolve, reject) => { 34 | /** 35 | * Initialize the join request. Receives "joinScriptUrl" which will 36 | * reutrn lots of information about the game if successful. 37 | */ 38 | const initial_request = await request({ 39 | uri: `https://assetgame.roblox.com/Game/PlaceLauncher.ashx?request=RequestGameJob&placeId=${placeId}&gameId=${jobId}`, 40 | headers: { 41 | 'User-Agent': 42 | 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36', 43 | Referer: `https://www.roblox.com/games/${placeId}/`, 44 | Origin: 'https://www.roblox.com', 45 | Cookie: `.ROBLOSECURITY=${cookie}; path=/; domain=.roblox.com;` 46 | }, 47 | json: true // Automatically parses the JSON string in the response 48 | }) 49 | .then(response => { 50 | return response 51 | }) 52 | .catch(error => { 53 | reject(error) 54 | }) 55 | 56 | /** 57 | * Check if "joinScriptUrl" was returned 58 | */ 59 | if (initial_request && initial_request.joinScriptUrl) { 60 | /** 61 | * Use the "joinScriptUrl" to get information about the game, 62 | * including the game server IP (MachineAddress) 63 | */ 64 | let game_data = await request({ 65 | uri: initial_request.joinScriptUrl, 66 | json: true 67 | }) 68 | .then(response => { 69 | return response 70 | }) 71 | .catch(error => { 72 | reject(error) 73 | }) 74 | 75 | /** 76 | * Parse the JSON 77 | */ 78 | game_data = JSON.parse(game_data.toString().replace(/--.*\r\n/, '')) 79 | 80 | /** 81 | * Return MachineAddress 82 | */ 83 | resolve(game_data.MachineAddress, game_data) 84 | } else { 85 | reject('Error on initial request to Roblox') 86 | } 87 | }) 88 | } 89 | --------------------------------------------------------------------------------