Arras Outbound Packet Sniffer

Logs outbound packets from arras

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Arras Outbound Packet Sniffer
// @namespace    EFdatastuff_Arras_Outbound
// @version      1.0.1
// @description  Logs outbound packets from arras
// @author       EternalFrostrOrig (@EternalFrost#0955 /u/PineappleNarwhal)
// @match        http://arras.io/
// @match        http://arras-proxy.surge.sh/
// @grant        none
// ==/UserScript==

/* global Arras */

(function() {
    'use strict';
    try {

        Function.prototype.clone = function() {
            var that = this;
            var temp = function temporary() { return that.apply(this, arguments); };
            for(var key in this) {
                if (this.hasOwnProperty(key)) {
                    temp[key] = this[key];
                }
            }
            return temp;
        };

        function log(data) {
            console.log("AOPS - ", data)
        }

        var mainObj = Arras(1337)

        var isInjected = false

        var captured_talk

        function inject() {
            if (mainObj.socket != undefined && mainObj.socket.talk != undefined) {
                log("Socket methods ready, beginging injection...")
                clearInterval(injectLoop)

                captured_talk = mainObj.socket.talk.clone()

                log("Captured talk() method, injecting middleman function...")

                mainObj.socket.talk = function(...data) {
                    log(data)

                    switch (data.length) {
                        case 1:
                            captured_talk(data[0])
                            break;
                        case 2:
                            captured_talk(data[0], data[1])
                            break;
                        case 3:
                            captured_talk(data[0], data[1], data[2])
                            break;
                        case 4: captured_talk(data[0], data[1], data[2], data[3])
                            break;
                        default:
                            log("UNABLE TO PROCESS DATA AMOUNT OF LENGTH " + data.length)
                            break;
                    }
                }
                log("Injected sucessfully")
            }
        }

        var injectLoop = setInterval(inject, 3)
        } catch(e) {}
})();