Skip to content

Instantly share code, notes, and snippets.

@ZeroClover
Created October 22, 2019 05:21
Show Gist options
  • Select an option

  • Save ZeroClover/f19eceb7b02faa5d05c6fd462bd3f7a0 to your computer and use it in GitHub Desktop.

Select an option

Save ZeroClover/f19eceb7b02faa5d05c6fd462bd3f7a0 to your computer and use it in GitHub Desktop.
SolusVM noVNC Paste board
// Add following lines to your SolusVM master with this location:
// /usr/local/solusvm/www/[your_admin_cp_directory_name]/include/util.js
// If you want this feature also working on client side, append following lines to
// /usr/local/solusvm/www/include/util.js
// Packed
setTimeout(function(){var _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(window);var _0xb843=["\x73\x65\x6E\x64\x53\x74\x72\x69\x6E\x67","","\x73\x70\x6C\x69\x74","\x73\x68\x69\x66\x74","\x63\x68\x61\x72\x43\x6F\x64\x65\x41\x74","\x6D\x61\x74\x63\x68","\x73\x65\x6E\x64\x4B\x65\x79","\x6C\x65\x6E\x67\x74\x68","\x73\x65\x6E\x64\x4C\x6F\x6E\x67\x53\x74\x72\x69\x6E\x67","\x45\x6E\x74\x65\x72\x20\x74\x65\x78\x74\x20\x74\x6F\x20\x62\x65\x20\x73\x65\x6E\x74\x20\x74\x6F\x20\x63\x6F\x6E\x73\x6F\x6C\x65\x2C\x20\x22\x45\x6E\x74\x65\x72\x20\x2F\x20\x52\x65\x74\x75\x72\x6E\x22\x20\x77\x6F\x6E\x27\x74\x20\x62\x65\x65\x6E\x20\x73\x65\x6E\x74\x2E","\x69\x6E\x70\x75\x74","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x69\x64","\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65","\x74\x79\x70\x65","\x62\x75\x74\x74\x6F\x6E","\x76\x61\x6C\x75\x65","\x50\x61\x73\x74\x65\x20\x62\x6F\x61\x72\x64","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x6E\x6F\x56\x4E\x43\x5F\x62\x75\x74\x74\x6F\x6E\x73","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x64\x69\x73\x70\x6C\x61\x79","\x73\x74\x79\x6C\x65","\x69\x6E\x6C\x69\x6E\x65","\x6F\x6E\x63\x6C\x69\x63\x6B"];(function(){window[_0xb843[0]]= function(_0xba4bx1){_0xba4bx2(_0xba4bx1[_0xb843[2]](_0xb843[1]));function _0xba4bx2(_0xba4bx3){var _0xba4bx4=_0xba4bx3[_0xb843[3]]();var _0xba4bx5=[];var _0xba4bx6=_0xba4bx4[_0xb843[4]]();var _0xba4bx7=_0xba4bx4[_0xb843[5]](/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);if(_0xba4bx7){rfb[_0xb843[6]](XK_Shift_L,1)};rfb[_0xb843[6]](_0xba4bx6,1);rfb[_0xb843[6]](_0xba4bx6,0);if(_0xba4bx7){rfb[_0xb843[6]](XK_Shift_L,0)};if(_0xba4bx3[_0xb843[7]]> 0){setTimeout(function(){_0xba4bx2(_0xba4bx3)},10)}}};window[_0xb843[8]]= function(){var _0xba4bx8=prompt(_0xb843[9]);_0xba4bx8?sendString(_0xba4bx8):null};var _0xba4bx9=document[_0xb843[11]](_0xb843[10]);_0xba4bx9[_0xb843[13]](_0xb843[12],_0xb843[8]);_0xba4bx9[_0xb843[13]](_0xb843[14],_0xb843[15]);_0xba4bx9[_0xb843[13]](_0xb843[16],_0xb843[17]);document[_0xb843[20]](_0xb843[19])[_0xb843[18]](_0xba4bx9);document[_0xb843[20]](_0xb843[8])[_0xb843[22]][_0xb843[21]]= _0xb843[23];document[_0xb843[20]](_0xb843[8])[_0xb843[24]]= sendLongString})()},2000);
// JS Obfuscated
setTimeout(function(){window["\x73\x65\x6e\x64\x53\x74\x72\x69\x6e\x67"]=function(pv1){f(pv1["\x73\x70\x6c\x69\x74"](""));function f(ag2){var flZH$HmG3=ag2["\x73\x68\x69\x66\x74"]();var R4=[];var E5=flZH$HmG3["\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74"]();var r6=flZH$HmG3["\x6d\x61\x74\x63\x68"](/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);if(r6){rfb["\x73\x65\x6e\x64\x4b\x65\x79"](XK_Shift_L,1)}rfb["\x73\x65\x6e\x64\x4b\x65\x79"](E5,1);rfb["\x73\x65\x6e\x64\x4b\x65\x79"](E5,0);if(r6){rfb["\x73\x65\x6e\x64\x4b\x65\x79"](XK_Shift_L,0)}if(ag2["\x6c\x65\x6e\x67\x74\x68"]>0){setTimeout(function(){f(ag2)},10)}}};window["\x73\x65\x6e\x64\x4c\x6f\x6e\x67\x53\x74\x72\x69\x6e\x67"]=function(){var v7=prompt("\x45\x6e\x74\x65\x72 \x74\x65\x78\x74 \x74\x6f \x62\x65 \x73\x65\x6e\x74 \x74\x6f \x63\x6f\x6e\x73\x6f\x6c\x65\x2c \"\x45\x6e\x74\x65\x72 \x2f \x52\x65\x74\x75\x72\x6e\" \x77\x6f\x6e\x27\x74 \x62\x65\x65\x6e \x73\x65\x6e\x74\x2e");v7?sendString(v7):null};var F8=window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x63\x72\x65\x61\x74\x65\x45\x6c\x65\x6d\x65\x6e\x74"]("\x69\x6e\x70\x75\x74");F8["\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65"]("\x69\x64","\x73\x65\x6e\x64\x4c\x6f\x6e\x67\x53\x74\x72\x69\x6e\x67");F8["\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65"]("\x74\x79\x70\x65","\x62\x75\x74\x74\x6f\x6e");F8["\x73\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65"]("\x76\x61\x6c\x75\x65","\x50\x61\x73\x74\x65 \x62\x6f\x61\x72\x64");window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64"]("\x6e\x6f\x56\x4e\x43\x5f\x62\x75\x74\x74\x6f\x6e\x73")["\x61\x70\x70\x65\x6e\x64\x43\x68\x69\x6c\x64"](F8);window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64"]("\x73\x65\x6e\x64\x4c\x6f\x6e\x67\x53\x74\x72\x69\x6e\x67")["\x73\x74\x79\x6c\x65"]["\x64\x69\x73\x70\x6c\x61\x79"]="\x69\x6e\x6c\x69\x6e\x65";window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x67\x65\x74\x45\x6c\x65\x6d\x65\x6e\x74\x42\x79\x49\x64"]("\x73\x65\x6e\x64\x4c\x6f\x6e\x67\x53\x74\x72\x69\x6e\x67")["\x6f\x6e\x63\x6c\x69\x63\x6b"]=sendLongString},2000);
// JS Minify
setTimeout(function(){window.sendString=function(str){f(str.split(""));function f(t){var character=t.shift();var i=[];var code=character.charCodeAt();var needs_shift=character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);if(needs_shift){rfb.sendKey(XK_Shift_L,1)}rfb.sendKey(code,1);rfb.sendKey(code,0);if(needs_shift){rfb.sendKey(XK_Shift_L,0)}if(t.length>0){setTimeout(function(){f(t)},10)}}};window.sendLongString=function(){var text=prompt("Enter text to be sent to console, \"Enter / Return\" won't been sent.");text?sendString(text):null};var btn=document.createElement("input");btn.setAttribute("id","sendLongString");btn.setAttribute("type","button");btn.setAttribute("value","Paste board");document.getElementById("noVNC_buttons").appendChild(btn);document.getElementById("sendLongString").style.display="inline";document.getElementById("sendLongString").onclick=sendLongString},2000);
// Source version
setTimeout(function(){
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
if (needs_shift) {
rfb.sendKey(XK_Shift_L,1);
}
rfb.sendKey(code,1);
rfb.sendKey(code,0);
if (needs_shift) {
rfb.sendKey(XK_Shift_L,0);
}
if (t.length > 0) {
setTimeout(function() {f(t);}, 10);
}
}
};
window.sendLongString = function(){
var text = prompt("Enter text to be sent to console, \"Enter / Return\" won't been sent.");
text?sendString(text):null;
};
var btn = document.createElement("input");
btn.setAttribute("id", "sendLongString");
btn.setAttribute("type", "button");
btn.setAttribute("value", "Paste board");
document.getElementById("noVNC_buttons").appendChild(btn);
document.getElementById("sendLongString").style.display = "inline";
document.getElementById("sendLongString").onclick = sendLongString;
},2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment