Last active
August 29, 2015 14:18
-
-
Save gabbaybr/3fefc723fd15861bbd76 to your computer and use it in GitHub Desktop.
Easter egg to open hidden page. HOW TO USE: Open page, press CTRL+SHIFT+X, type "sql" and hit ENTER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
/* | |
* ----------------------------------------------------------------------- | |
* ORIGINAL SHORTCUTS KEYBOARD SCRIPT FOR "DO MAGIC" PROJECT | |
* http://www.openjs.com/scripts/events/keyboard_shortcuts/ | |
* | |
* Used 2 obfuscators, following sequence: | |
* 1- http://marijnhaverbeke.nl/uglifyjs | |
* 2- http://www.jsobfuscate.com/index.php | |
* | |
* HOW TO USE: | |
* 1- Open page in browser; | |
* 2- Press CTRL+SHIFT+X; | |
* 3- Type: "sql" (without quotes); | |
* 4- Hit ENTER. | |
* ----------------------------------------------------------------------- | |
var sKey1 = 'S', sKey2 = 'Q', sKey3 = 'L'; | |
var sKey4 = 's', sKey5 = 'q', sKey6 = 'l'; | |
var finalsKey1 = sKey1+sKey2+sKey3; | |
var finalsKey2 = sKey4+sKey5+sKey6; | |
var sc1 = 'CT', sc2 = 'RL', sc3='SH', sc4='IFT' | |
var finalSc = sc1+sc2+'+'+sc3+sc4; | |
shortcut = { | |
'all_shortcuts':{},//All the shortcuts are stored in this array | |
'add': function(shortcut_combination,callback,opt) { | |
//Provide a set of default options | |
var default_options = { | |
'type':'keydown', | |
'propagate':false, | |
'disable_in_input':false, | |
'target':document, | |
'keycode':false | |
} | |
if(!opt) opt = default_options; | |
else { | |
for(var dfo in default_options) { | |
if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; | |
} | |
} | |
var ele = opt.target; | |
if(typeof opt.target == 'string') ele = document.getElementById(opt.target); | |
var ths = this; | |
shortcut_combination = shortcut_combination.toLowerCase(); | |
//The function to be called at keypress | |
var func = function(e) { | |
e = e || window.event; | |
if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields | |
var element; | |
if(e.target) element=e.target; | |
else if(e.srcElement) element=e.srcElement; | |
if(element.nodeType==3) element=element.parentNode; | |
if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; | |
} | |
//Find Which key is pressed | |
if (e.keyCode) code = e.keyCode; | |
else if (e.which) code = e.which; | |
var character = String.fromCharCode(code).toLowerCase(); | |
if(code == 188) character=","; //If the user presses , when the type is onkeydown | |
if(code == 190) character="."; //If the user presses , when the type is onkeydown | |
var keys = shortcut_combination.split("+"); | |
//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked | |
var kp = 0; | |
//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken | |
var shift_nums = { | |
"`":"~", | |
"1":"!", | |
"2":"@", | |
"3":"#", | |
"4":"$", | |
"5":"%", | |
"6":"^", | |
"7":"&", | |
"8":"*", | |
"9":"(", | |
"0":")", | |
"-":"_", | |
"=":"+", | |
";":":", | |
"'":"\"", | |
",":"<", | |
".":">", | |
"/":"?", | |
"\\":"|" | |
} | |
//Special Keys - and their codes | |
var special_keys = { | |
'esc':27, | |
'escape':27, | |
'tab':9, | |
'space':32, | |
'return':13, | |
'enter':13, | |
'backspace':8, | |
'scrolllock':145, | |
'scroll_lock':145, | |
'scroll':145, | |
'capslock':20, | |
'caps_lock':20, | |
'caps':20, | |
'numlock':144, | |
'num_lock':144, | |
'num':144, | |
'pause':19, | |
'break':19, | |
'insert':45, | |
'home':36, | |
'delete':46, | |
'end':35, | |
'pageup':33, | |
'page_up':33, | |
'pu':33, | |
'pagedown':34, | |
'page_down':34, | |
'pd':34, | |
'left':37, | |
'up':38, | |
'right':39, | |
'down':40, | |
'f1':112, | |
'f2':113, | |
'f3':114, | |
'f4':115, | |
'f5':116, | |
'f6':117, | |
'f7':118, | |
'f8':119, | |
'f9':120, | |
'f10':121, | |
'f11':122, | |
'f12':123 | |
} | |
var modifiers = { | |
shift: { wanted:false, pressed:false}, | |
ctrl : { wanted:false, pressed:false}, | |
alt : { wanted:false, pressed:false}, | |
meta : { wanted:false, pressed:false} //Meta is Mac specific | |
}; | |
if(e.ctrlKey) modifiers.ctrl.pressed = true; | |
if(e.shiftKey) modifiers.shift.pressed = true; | |
if(e.altKey) modifiers.alt.pressed = true; | |
if(e.metaKey) modifiers.meta.pressed = true; | |
for(var i=0; k=keys[i],i<keys.length; i++) { | |
//Modifiers | |
if(k == 'ctrl' || k == 'control') { | |
kp++; | |
modifiers.ctrl.wanted = true; | |
} else if(k == 'shift') { | |
kp++; | |
modifiers.shift.wanted = true; | |
} else if(k == 'alt') { | |
kp++; | |
modifiers.alt.wanted = true; | |
} else if(k == 'meta') { | |
kp++; | |
modifiers.meta.wanted = true; | |
} else if(k.length > 1) { //If it is a special key | |
if(special_keys[k] == code) kp++; | |
} else if(opt['keycode']) { | |
if(opt['keycode'] == code) kp++; | |
} else { //The special keys did not match | |
if(character == k) kp++; | |
else { | |
if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase | |
character = shift_nums[character]; | |
if(character == k) kp++; | |
} | |
} | |
} | |
} | |
if(kp == keys.length && | |
modifiers.ctrl.pressed == modifiers.ctrl.wanted && | |
modifiers.shift.pressed == modifiers.shift.wanted && | |
modifiers.alt.pressed == modifiers.alt.wanted && | |
modifiers.meta.pressed == modifiers.meta.wanted) { | |
callback(e); | |
if(!opt['propagate']) { //Stop the event | |
//e.cancelBubble is supported by IE - this will kill the bubbling process. | |
e.cancelBubble = true; | |
e.returnValue = false; | |
//e.stopPropagation works in Firefox. | |
if (e.stopPropagation) { | |
e.stopPropagation(); | |
e.preventDefault(); | |
} | |
return false; | |
} | |
} | |
} | |
this.all_shortcuts[shortcut_combination] = { | |
'callback':func, | |
'target':ele, | |
'event': opt['type'] | |
}; | |
//Attach the function with the event | |
if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); | |
else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); | |
else ele['on'+opt['type']] = func; | |
}, | |
//Remove the shortcut - just specify the shortcut and I will remove the binding | |
'remove':function(shortcut_combination) { | |
shortcut_combination = shortcut_combination.toLowerCase(); | |
var binding = this.all_shortcuts[shortcut_combination]; | |
delete(this.all_shortcuts[shortcut_combination]) | |
if(!binding) return; | |
var type = binding['event']; | |
var ele = binding['target']; | |
var callback = binding['callback']; | |
if(ele.detachEvent) ele.detachEvent('on'+type, callback); | |
else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); | |
else ele['on'+type] = false; | |
} | |
} | |
shortcut.add(finalSc + "+X",function() { | |
cleanMagicField(); | |
document.getElementById('magic').focus(); | |
}); | |
function doMagic(){ | |
if(document.getElementById('magic').value != finalsKey1 && document.getElementById('magic').value != finalsKey2){ | |
cleanMagicField(); | |
return false; | |
} | |
window.showModalDialog('shortcut - full.html',window,'help:no;scroll:no;Status:NO;dialogWidth:950px;dialogHeight:700px'); | |
} | |
function cleanMagicField(){ | |
document.getElementById('magic').value = ''; | |
} | |
*/ | |
// Pass 1 - Generated by: http://marijnhaverbeke.nl/uglifyjs | |
//function doMagic(){return document.getElementById("magic").value!=finalsKey1&&document.getElementById("magic").value!=finalsKey2?(cleanMagicField(),!1):(window.showModalDialog("shortcut - full.html",window,"help:no;scroll:no;Status:NO;dialogWidth:950px;dialogHeight:700px"),void 0)}function cleanMagicField(){document.getElementById("magic").value=""}var sKey1="S",sKey2="Q",sKey3="L",sKey4="s",sKey5="q",sKey6="l",finalsKey1=sKey1+sKey2+sKey3,finalsKey2=sKey4+sKey5+sKey6,sc1="CT",sc2="RL",sc3="SH",sc4="IFT",finalSc=sc1+sc2+"+"+sc3+sc4;shortcut={all_shortcuts:{},add:function(a,b,c){var d={type:"keydown",propagate:!1,disable_in_input:!1,target:document,keycode:!1};if(c)for(var e in d)"undefined"==typeof c[e]&&(c[e]=d[e]);else c=d;var f=c.target;"string"==typeof c.target&&(f=document.getElementById(c.target)),a=a.toLowerCase();var h=function(d){if(d=d||window.event,c.disable_in_input){var e;if(d.target?e=d.target:d.srcElement&&(e=d.srcElement),3==e.nodeType&&(e=e.parentNode),"INPUT"==e.tagName||"TEXTAREA"==e.tagName)return}d.keyCode?code=d.keyCode:d.which&&(code=d.which);var f=String.fromCharCode(code).toLowerCase();188==code&&(f=","),190==code&&(f=".");var g=a.split("+"),h=0,i={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"},j={esc:27,escape:27,tab:9,space:32,"return":13,enter:13,backspace:8,scrolllock:145,scroll_lock:145,scroll:145,capslock:20,caps_lock:20,caps:20,numlock:144,num_lock:144,num:144,pause:19,"break":19,insert:45,home:36,"delete":46,end:35,pageup:33,page_up:33,pu:33,pagedown:34,page_down:34,pd:34,left:37,up:38,right:39,down:40,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123},l={shift:{wanted:!1,pressed:!1},ctrl:{wanted:!1,pressed:!1},alt:{wanted:!1,pressed:!1},meta:{wanted:!1,pressed:!1}};d.ctrlKey&&(l.ctrl.pressed=!0),d.shiftKey&&(l.shift.pressed=!0),d.altKey&&(l.alt.pressed=!0),d.metaKey&&(l.meta.pressed=!0);for(var m=0;k=g[m],m<g.length;m++)"ctrl"==k||"control"==k?(h++,l.ctrl.wanted=!0):"shift"==k?(h++,l.shift.wanted=!0):"alt"==k?(h++,l.alt.wanted=!0):"meta"==k?(h++,l.meta.wanted=!0):k.length>1?j[k]==code&&h++:c.keycode?c.keycode==code&&h++:f==k?h++:i[f]&&d.shiftKey&&(f=i[f],f==k&&h++);return h!=g.length||l.ctrl.pressed!=l.ctrl.wanted||l.shift.pressed!=l.shift.wanted||l.alt.pressed!=l.alt.wanted||l.meta.pressed!=l.meta.wanted||(b(d),c.propagate)?void 0:(d.cancelBubble=!0,d.returnValue=!1,d.stopPropagation&&(d.stopPropagation(),d.preventDefault()),!1)};this.all_shortcuts[a]={callback:h,target:f,event:c.type},f.addEventListener?f.addEventListener(c.type,h,!1):f.attachEvent?f.attachEvent("on"+c.type,h):f["on"+c.type]=h},remove:function(a){a=a.toLowerCase();var b=this.all_shortcuts[a];if(delete this.all_shortcuts[a],b){var c=b.event,d=b.target,e=b.callback;d.detachEvent?d.detachEvent("on"+c,e):d.removeEventListener?d.removeEventListener(c,e,!1):d["on"+c]=!1}}},shortcut.add(finalSc+"+X",function(){cleanMagicField(),document.getElementById("magic").focus()}); | |
// Pass 2 - Generated by http://www.jsobfuscate.com/index.php from pass 1 result | |
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('v 1L(){E u.B("G").J!=1r&&u.B("G").J!=Z?(T(),!1):(R.2a("N - 29.28",R,"2g:1h;16:1h;1W:1V;1Y:23;22:1Z"),1t 0)}v T(){u.B("G").J=""}p 1m="S",V="Q",Y="L",1g="s",1f="q",1b="l",1r=1m+V+Y,Z=1g+1f+1b,1c="1X",10="1T",1d="1S",1e="1U",1j=1c+10+"+"+1d+1e;N={C:{},1i:v(a,b,c){p d={A:"24",1u:!1,17:!1,r:u,K:!1};D(c)1a(p e 25 d)"2d"==18 c[e]&&(c[e]=d[e]);2e c=d;p f=c.r;"2f"==18 c.r&&(f=u.B(c.r)),a=a.H();p h=v(d){D(d=d||R.U,c.17){p e;D(d.r?e=d.r:d.12&&(e=d.12),3==e.2c&&(e=e.1R),"2b"==e.11||"26"==e.11)E}d.14?t=d.14:d.15&&(t=d.15);p f=2h.1P(t).H();1x==t&&(f=","),1v==t&&(f=".");p g=a.1y("+"),h=0,i={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"1z","=":"+",";":":","\'":\'"\',",":"<",".":">","/":"?","\\\\":"|"},j={1D:27,1B:27,1C:9,1A:32,"E":13,1Q:13,1E:8,1M:I,1N:I,16:I,1K:20,1G:20,1F:20,1H:M,1I:M,1J:M,1O:19,"1w":19,21:3b,2U:36,"1p":2Y,2X:35,2Z:33,2W:33,2V:33,2i:34,2S:34,2T:34,31:37,30:38,3a:39,2P:2t,2s:2u,2v:2x,2w:2r,2q:2l,2Q:2k,2j:2m,2n:2p,2o:2y,2z:2K,2J:2L,2M:2O,2N:2I},l={z:{n:!1,o:!1},y:{n:!1,o:!1},x:{n:!1,o:!1},w:{n:!1,o:!1}};d.2H&&(l.y.o=!0),d.W&&(l.z.o=!0),d.2C&&(l.x.o=!0),d.2B&&(l.w.o=!0);1a(p m=0;k=g[m],m<g.P;m++)"y"==k||"2A"==k?(h++,l.y.n=!0):"z"==k?(h++,l.z.n=!0):"x"==k?(h++,l.x.n=!0):"w"==k?(h++,l.w.n=!0):k.P>1?j[k]==t&&h++:c.K?c.K==t&&h++:f==k?h++:i[f]&&d.W&&(f=i[f],f==k&&h++);E h!=g.P||l.y.o!=l.y.n||l.z.o!=l.z.n||l.x.o!=l.x.n||l.w.o!=l.w.n||(b(d),c.1u)?1t 0:(d.2D=!0,d.2E=!1,d.1q&&(d.1q(),d.2G()),!1)};O.C[a]={1k:h,r:f,U:c.A},f.1s?f.1s(c.A,h,!1):f.1o?f.1o("F"+c.A,h):f["F"+c.A]=h},2F:v(a){a=a.H();p b=O.C[a];D(1p O.C[a],b){p c=b.U,d=b.r,e=b.1k;d.1l?d.1l("F"+c,e):d.1n?d.1n(c,e,!1):d["F"+c]=!1}}},N.1i(1j+"+X",v(){T(),u.B("G").2R()});',62,198,'|||||||||||||||||||||||wanted|pressed|var||target||code|document|function|meta|alt|ctrl|shift|type|getElementById|all_shortcuts|if|return|on|magic|toLowerCase|145|value|keycode||144|shortcut|this|length||window||cleanMagicField|event|sKey2|shiftKey||sKey3|finalsKey2|sc2|tagName|srcElement||keyCode|which|scroll|disable_in_input|typeof||for|sKey6|sc1|sc3|sc4|sKey5|sKey4|no|add|finalSc|callback|detachEvent|sKey1|removeEventListener|attachEvent|delete|stopPropagation|finalsKey1|addEventListener|void|propagate|190|break|188|split|_|space|escape|tab|esc|backspace|caps|caps_lock|numlock|num_lock|num|capslock|doMagic|scrolllock|scroll_lock|pause|fromCharCode|enter|parentNode|SH|RL|IFT|NO|Status|CT|dialogWidth|700px||insert|dialogHeight|950px|keydown|in|TEXTAREA||html|full|showModalDialog|INPUT|nodeType|undefined|else|string|help|String|pagedown|f6|116|115|117|f7|f8|118|f4|114|f1|40|112|f2|f3|113|119|f9|control|metaKey|altKey|cancelBubble|returnValue|remove|preventDefault|ctrlKey|123|f10|120|121|f11|f12|122|down|f5|focus|page_down|pd|home|pu|page_up|end|46|pageup|up|left|||||||||right|45'.split('|'))) | |
</script> | |
</head> | |
<body> | |
<form onsubmit="doMagic()" autocomplete="off"> | |
<!--<input type="text" id="magic" style="display:none" /> --> | |
<input type="text" id="magic" style="width:1px; length:1px; border:0" /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment