6677beb174
svn+ssh://metasploit.com/home/svn/framework3/branches/framework-3.1 ........ r5366 | hdm | 2008-01-26 20:30:53 -0600 (Sat, 26 Jan 2008) | 2 lines Update version information ........ r5367 | hdm | 2008-01-26 21:10:57 -0600 (Sat, 26 Jan 2008) | 3 lines Updated for version 3.1 ........ r5369 | hdm | 2008-01-26 21:13:31 -0600 (Sat, 26 Jan 2008) | 3 lines Wipe the private directories from the branch. ........ r5371 | hdm | 2008-01-27 17:24:24 -0600 (Sun, 27 Jan 2008) | 5 lines Timeout options added for dcerpc connect and read times. Addition of novell netware as a supported target platform. Inclusion of the serverprotect exploit (still works on the latest version). Addition of the first remote netware kernel exploit that leads to a shell, addition of netware stager and shell, and first draft of the release notes for 3.1 ........ r5372 | hdm | 2008-01-27 17:30:08 -0600 (Sun, 27 Jan 2008) | 3 lines Formatting, indentation, fixed the static IP embedded in the request ........ r5373 | hdm | 2008-01-27 20:02:48 -0600 (Sun, 27 Jan 2008) | 3 lines Correctly trap exploit errors in a way that works with all of the UIs ........ r5374 | hdm | 2008-01-27 20:23:25 -0600 (Sun, 27 Jan 2008) | 3 lines More last-minute bug fixes ........ r5375 | hdm | 2008-01-27 20:37:43 -0600 (Sun, 27 Jan 2008) | 3 lines Force multi-bind off in netware, correct label display in gtk gui labels ........ r5376 | hdm | 2008-01-27 20:50:03 -0600 (Sun, 27 Jan 2008) | 3 lines More exception handling fun ........ git-svn-id: file:///home/svn/framework3/trunk@5378 4d416f70-5f16-0410-b530-b9f4589650da
104 lines
1.9 KiB
Ruby
104 lines
1.9 KiB
Ruby
require 'msf/base'
|
|
|
|
module Msf
|
|
module Sessions
|
|
|
|
###
|
|
#
|
|
# This class provides basic interaction with a command shell on the remote
|
|
# endpoint. This session is initialized with a stream that will be used
|
|
# as the pipe for reading and writing the command shell.
|
|
#
|
|
###
|
|
class NetwareConsole
|
|
|
|
#
|
|
# This interface supports basic interaction.
|
|
#
|
|
include Msf::Session::Basic
|
|
|
|
#
|
|
# This interface supports interacting with a single command shell.
|
|
#
|
|
include Msf::Session::Provider::SingleCommandShell
|
|
|
|
#
|
|
# Returns the type of session.
|
|
#
|
|
def self.type
|
|
"shell"
|
|
end
|
|
|
|
#
|
|
# Returns the session description.
|
|
#
|
|
def desc
|
|
"NetWare Console"
|
|
end
|
|
|
|
#
|
|
# Calls the class method.
|
|
#
|
|
def type
|
|
self.class.type
|
|
end
|
|
|
|
#
|
|
# The shell will have been initialized by default.
|
|
#
|
|
def init_shell
|
|
return true
|
|
end
|
|
|
|
#
|
|
# Read from the command shell.
|
|
#
|
|
def read_shell(length = nil)
|
|
return rstream.read(length)
|
|
end
|
|
|
|
#
|
|
# Writes to the command shell.
|
|
#
|
|
def write_shell(buf)
|
|
rstream.write(buf)
|
|
end
|
|
|
|
#
|
|
# Closes the shell.
|
|
#
|
|
def close_shell()
|
|
rstream.close
|
|
end
|
|
|
|
def _stream_read_remote_write_local(stream)
|
|
buf = stream.get
|
|
bsize = 25 * 80 +8
|
|
|
|
while buf.length > 0
|
|
data = buf[0, bsize]
|
|
|
|
user_output.print("\e[24A")
|
|
|
|
for i in 0..24
|
|
user_output.print(data[8+i*80, 80] + "\n")
|
|
end
|
|
|
|
col = data[4, 2].unpack('v')[0]
|
|
line = 25-data[6, 2].unpack('v')[0]
|
|
user_output.print("\e[#{line}A")
|
|
user_output.print("\e[#{col}C")
|
|
|
|
if (buf.length == bsize)
|
|
buf = ''
|
|
else
|
|
buf = buf[bsize, buf.length]
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|