more msfweb console code
git-svn-id: file:///home/svn/framework3/trunk@4284 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
90e92a63e2
commit
f178656cd4
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, L.M.H. <lmh@info-pull.com>
|
||||
* Copyright (c) 2006, LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
* -- Part of 'msfweb', the web interface for the Metasploit Framework.
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/* web msfconsole (console.js)
|
||||
* Copyright (c) 2006 LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
* Inspired by Jesse Ruderman's Javascript Shell.
|
||||
*/
|
||||
|
||||
var console_history = new Array(); // Commands history
|
||||
var console_hindex = 0; // Index to current command history
|
||||
var console_input; // Object to console input
|
||||
var console_output; // Object to console output
|
||||
|
||||
function console_refocus() {}
|
||||
function console_tabcomplete() {
|
||||
// TODO:
|
||||
}
|
||||
|
||||
function console_execute() {}
|
||||
|
||||
function console_keydown(e) {
|
||||
if (e.keyCode == 13) { // enter
|
||||
console_history.push(console_input.value);
|
||||
try { console_execute(); } catch(er) { alert(er); };
|
||||
setTimeout(function() { console_input.value = ""; }, 0);
|
||||
} else if (e.keyCode == 38) { // up
|
||||
// TODO: place upper cmd in history on console_input.value
|
||||
} else if (e.keyCode == 40) { // down
|
||||
// TODO: place lower cmd in history on console_input.value
|
||||
} else if (e.keyCode == 9) { // tab
|
||||
console_tabcomplete();
|
||||
setTimeout(function() { console_refocus(); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function console_init() {
|
||||
|
||||
console_input = document.getElementById("console_input");
|
||||
console_output = document.getElementById("console_output");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2006, LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Standards compliant:
|
||||
* Valid, warning-free CSS: http://jigsaw.w3.org/css-validator
|
||||
*/
|
||||
|
||||
html,body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: #444;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#output {
|
||||
white-space: pre;
|
||||
white-space: -moz-pre-wrap;
|
||||
}
|
||||
|
||||
#input {
|
||||
width: 100%;
|
||||
border: none;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.input {
|
||||
border: none;
|
||||
font: inherit;
|
||||
font-weight: bold;
|
||||
margin-top: .5em;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, L.M.H. <lmh@info-pull.com>
|
||||
* Copyright (c) 2006, LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, L.M.H. <lmh@info-pull.com>
|
||||
* Copyright (c) 2006, LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Standards compliant:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, L.M.H. <lmh@info-pull.com>
|
||||
* Copyright (c) 2006, LMH <lmh@info-pull.com>
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Standards compliant:
|
||||
|
|
Loading…
Reference in New Issue