Over a million developers have joined DZone.

20-GOTO-10 Webshell Dos Javascript

·
var arrCommandHistory = new Array();
var iCommandHistoryIndex = 0;
var isContactMode = false;
var contactPrompt = '';

function handleKeyPress(keyCode, obj) {
	switch(keyCode)
	{
		case 13:
			handleReturn(obj);
			break;
		case 38:
			if(iCommandHistoryIndex > 0) {
				iCommandHistoryIndex --;
				document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
				document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
			}
			break;
		case 40:
			if(iCommandHistoryIndex < arrCommandHistory.length) {
				if(iCommandHistoryIndex < arrCommandHistory.length-1) {
					iCommandHistoryIndex ++;
				}
				document.getElementById('commandContainer').innerHTML = arrCommandHistory[iCommandHistoryIndex];
				document.getElementById('entryBox').value = arrCommandHistory[iCommandHistoryIndex];
			}
			break;
		default:
			document.getElementById('commandContainer').innerHTML = obj.value.replace(/ /g, ' ');
	}
}

function handleReturn(obj) { 
	arrCommandHistory[arrCommandHistory.length] = obj.value; 
	iCommandHistoryIndex = arrCommandHistory.length;  
	var head=document.getElementsByTagName('head').item(0); 
	var old=document.getElementById('lastScript'); 
	if(old)head.removeChild(old); 
	script=document.createElement('script'); 
	script.src='RPC-Executer.aspx?command='+obj.value+'&random='+(Math.round((Math.random()*1000)+1)); 
	script.type='text/javascript'; script.defer=true; 
	script.id='lastScript'; 
	void(head.appendChild(script));
}

function RPCCallback(sHTML) {
	sHTML = sHTML.replace(/</g, '<');
	var obj = document.getElementById('entryBox');
	var sOutput = '';
	if(!isContactMode) {
		sOutput += '
C:\\> '+obj.value+'
'; setPromptToNormal(); } else { sOutput += '
'+document.getElementById('commandPrompt').innerHTML+' '+obj.value+'
'; document.getElementById('commandPrompt').innerHTML = contactPrompt+': '; } sOutput += sHTML;sOutput += '
'; document.getElementById('outputContainer').innerHTML += sOutput; obj.value = ''; document.getElementById('commandContainer').innerHTML = ''; window.scrollBy(0,10000); } function RPCCallbackClearScreen() { document.getElementById('entryBox').value = ''; document.getElementById('outputContainer').innerHTML = '
'; document.getElementById('commandContainer').innerHTML = ''; window.scrollBy(0,-10000); } function setPromptToNormal() { document.getElementById('commandPrompt').innerHTML = 'C:\\>'; } function popUp(sURL) { var oWin = window.open(sURL, '', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1'); if (oWin==null || typeof(oWin)=="undefined") { alert("It seems that you have a popup blocker enabled. Please disable it and try again."); } } function setFocusToEntryBox() { var o = document.getElementById('entryBox'); o.focus(); o.value = o.value; }
Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}