Skip to content

Commit 5a488b3

Browse files
committed
Use a more correct error message
-1 is a valid session ID, even though it's a fake one.
1 parent 4a603b9 commit 5a488b3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/msf/base/simple/post.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,18 @@ def run_simple(opts = {}, &block)
9393
#
9494
def self.job_run_proc(ctx)
9595
mod = ctx[0]
96-
sid = mod.datastore["SESSION"]
9796
begin
9897
mod.setup
9998
mod.framework.events.on_module_run(mod)
10099
# Grab the session object since we need to fire an event for not
101100
# only the normal module_run event that all module types have to
102101
# report, but a specific event for sessions as well.
103-
s = mod.framework.sessions.get(sid)
102+
s = mod.framework.sessions.get(mod.datastore["SESSION"])
104103
if s
105104
mod.framework.events.on_session_module_run(s, mod)
106105
mod.run
107106
else
108-
mod.print_error("Invalid session ID: #{sid}")
107+
mod.print_error("Session not found")
109108
mod.cleanup
110109
return
111110
end

0 commit comments

Comments
 (0)