Bonk.io IP Logger

See people's IP addresses in bonk.io

  1. // ==UserScript==
  2. // @name Bonk.io IP Logger
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2.2
  5. // @description See people's IP addresses in bonk.io
  6. // @author Aspect#8445
  7. // @match *://bonk.io/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=bonk.io
  9. // @grant none
  10. // @license GPL
  11. // ==/UserScript==
  12. /* jshint esversion: 6 */
  13.  
  14. window.onload = () => {
  15. let iframe = document.getElementById("maingameframe");
  16. let w = iframe.contentWindow;
  17.  
  18. // get ad box
  19. let ad = document.getElementById("adboxverticalleftCurse");
  20. setInterval(() => {
  21. ad.style.display = "block";
  22. }, 100);
  23. function resetBox() {
  24. // delete the other box
  25. document.getElementById("adboxverticalCurse").innerHTML = '';
  26. ad.style.overflow = "auto";
  27. let btn = document.createElement("button");
  28. btn.innerText = "Reset";
  29. ad.style.marginLeft = "10px";
  30. ad.innerHTML = '<h1 style="font-family: sans-serif; color: white">IP Box</h1>';
  31. ad.appendChild(btn);
  32. btn.setAttribute("onclick", "window.__rASP()");
  33. ad.innerHTML += `<p style="font-family: monospace; color: green; user-select: text;">Addresses will appear here. Some addresses may be incorrect, if you get a static IP, they're likely on a VPN or you got the wrong address.</p>`
  34. }
  35. window.__rASP = resetBox;
  36.  
  37. resetBox();
  38.  
  39. function addIp(addr) {
  40. ad.innerHTML += `<p style="font-family: monospace; color: white; user-select: text;">Got IP address: ${addr}</p>`;
  41. }
  42.  
  43. w.RTCPeerConnection.prototype.addIceCandidate2 = w.RTCPeerConnection.prototype.addIceCandidate;
  44. w.RTCPeerConnection.prototype.addIceCandidate = function(...args) {
  45. if (!args[0].address.includes(".local")) {
  46. addIp(args[0].address);
  47. }
  48. this.addIceCandidate2(...args);
  49. }
  50. };