Readline mode disabledby defualt for interactive sessios
Fixed an issue with exploit.rb directly running a session command after the session command had been renamed git-svn-id: file:///home/svn/framework3/trunk@3774 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
817c4c189f
commit
a2592959c3
|
@ -138,7 +138,7 @@ class Exploit
|
||||||
if (bg == false and session.interactive?)
|
if (bg == false and session.interactive?)
|
||||||
print_line
|
print_line
|
||||||
|
|
||||||
driver.run_single("session -q -i #{session.sid}")
|
driver.run_single("sessions -q -i #{session.sid}")
|
||||||
# Otherwise, log that we created a session
|
# Otherwise, log that we created a session
|
||||||
else
|
else
|
||||||
print_status("Session #{session.sid} created in the background.")
|
print_status("Session #{session.sid} created in the background.")
|
||||||
|
|
|
@ -19,7 +19,17 @@ begin
|
||||||
@@rl_thread = nil
|
@@rl_thread = nil
|
||||||
@@rl_pipes = nil
|
@@rl_pipes = nil
|
||||||
@@rl_prompt = ''
|
@@rl_prompt = ''
|
||||||
@@rl_history = true;
|
@@rl_history = true
|
||||||
|
|
||||||
|
#
|
||||||
|
# Enable readline mode by setting rl_usestdio to false
|
||||||
|
# Address the following items before switching:
|
||||||
|
#
|
||||||
|
# XXX: Find a way to emulate ^Z when in readline mode
|
||||||
|
# XXX: Create histories/tab completion for shells
|
||||||
|
# XXX: Capture remote shell prompt and use for readline
|
||||||
|
#
|
||||||
|
@@rl_usestdio = true
|
||||||
|
|
||||||
#
|
#
|
||||||
# Initializes the readline-aware Input instance for text.
|
# Initializes the readline-aware Input instance for text.
|
||||||
|
@ -35,6 +45,7 @@ begin
|
||||||
# Start the readline thread
|
# Start the readline thread
|
||||||
#
|
#
|
||||||
def readline_start
|
def readline_start
|
||||||
|
return if @@rl_usestdio
|
||||||
return if @@rl_thread
|
return if @@rl_thread
|
||||||
@@rl_pipes = Rex::Compat.pipe
|
@@rl_pipes = Rex::Compat.pipe
|
||||||
@@rl_thread = ::Thread.new do
|
@@rl_thread = ::Thread.new do
|
||||||
|
@ -84,6 +95,8 @@ begin
|
||||||
# Calls sysread on the standard input handle.
|
# Calls sysread on the standard input handle.
|
||||||
#
|
#
|
||||||
def sysread(len = 1)
|
def sysread(len = 1)
|
||||||
|
return $stdin.sysread(len) if @@rl_usestdio
|
||||||
|
|
||||||
if (! readline_status)
|
if (! readline_status)
|
||||||
$stderr.puts "ERROR: sysread() called outside of thread mode: " + caller(1).to_s
|
$stderr.puts "ERROR: sysread() called outside of thread mode: " + caller(1).to_s
|
||||||
return ''
|
return ''
|
||||||
|
@ -95,6 +108,8 @@ begin
|
||||||
# Fake gets using readline
|
# Fake gets using readline
|
||||||
#
|
#
|
||||||
def gets()
|
def gets()
|
||||||
|
return $stdin.gets() if @@rl_usestdio
|
||||||
|
|
||||||
if (! readline_status)
|
if (! readline_status)
|
||||||
$stderr.puts "ERROR: gets() called outside of thread mode: " + caller(1).to_s
|
$stderr.puts "ERROR: gets() called outside of thread mode: " + caller(1).to_s
|
||||||
return ''
|
return ''
|
||||||
|
@ -113,7 +128,6 @@ begin
|
||||||
|
|
||||||
#
|
#
|
||||||
# Prompt-based getline using readline.
|
# Prompt-based getline using readline.
|
||||||
# XXX: Incompatible with thread mode
|
|
||||||
#
|
#
|
||||||
def pgets
|
def pgets
|
||||||
if (readline_status)
|
if (readline_status)
|
||||||
|
@ -134,6 +148,8 @@ begin
|
||||||
# Returns the output pipe handle
|
# Returns the output pipe handle
|
||||||
#
|
#
|
||||||
def fd
|
def fd
|
||||||
|
return $stdin if @@rl_usestdio
|
||||||
|
|
||||||
if (! readline_status)
|
if (! readline_status)
|
||||||
$stderr.puts "fd called outside of thread mode: " + caller(1).to_s
|
$stderr.puts "fd called outside of thread mode: " + caller(1).to_s
|
||||||
return ''
|
return ''
|
||||||
|
|
Loading…
Reference in New Issue