Skip to content

Commit d6ed1f6

Browse files
committed
Make backgrounding messages more consistent
Inspired by the work in rapid7#8896
1 parent 8fdcc14 commit d6ed1f6

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

lib/msf/ui/console/command_dispatcher/auxiliary.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def cmd_run(*args)
9696
}
9797

9898
# Always run passive modules in the background
99-
if (mod.passive or mod.passive_action?(action))
99+
if (mod.passive || mod.passive_action?(action || mod.default_action))
100100
jobify = true
101101
end
102102

@@ -131,8 +131,8 @@ def cmd_run(*args)
131131
return false
132132
end
133133

134-
if (jobify)
135-
print_status("Auxiliary module running as background job")
134+
if (jobify && mod.job_id)
135+
print_status("Auxiliary module running as background job #{mod.job_id}.")
136136
else
137137
print_status("Auxiliary module execution completed")
138138
end

lib/msf/ui/console/command_dispatcher/exploit.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,8 @@ def cmd_exploit(*args)
145145
end
146146
# If we ran the exploit as a job, indicate such so the user doesn't
147147
# wonder what's up.
148-
elsif (jobify)
149-
if mod.job_id
150-
print_status("Exploit running as background job #{mod.job_id}.")
151-
end
148+
elsif (jobify && mod.job_id)
149+
print_status("Exploit running as background job #{mod.job_id}.")
152150
# Worst case, the exploit ran but we got no session, bummer.
153151
else
154152
# If we didn't run a payload handler for this exploit it doesn't

lib/msf/ui/console/command_dispatcher/jobs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def cmd_handler(*args)
339339
framework.jobs[job_id.to_s].send(:name=, job_name)
340340
end
341341

342-
print_status "Payload Handler Started as Job #{job_id}"
342+
print_status "Payload handler running as background job #{job_id}."
343343
end
344344
end
345345
end

lib/msf/ui/console/command_dispatcher/post.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def cmd_run(*args)
131131
return false
132132
end
133133

134-
if (jobify)
135-
print_status("Post module running as background job")
134+
if (jobify && mod.job_id)
135+
print_status("Post module running as background job #{mod.job_id}.")
136136
else
137137
print_status("Post module execution completed")
138138
end

0 commit comments

Comments
 (0)