Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC] Implementation of CTRL+Z in reverse shell session #10450

Merged
merged 4 commits into from
Oct 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/msf/core/session/interactive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _interrupt
if !intent
# TODO: Check the shell is interactive or not
# If the current shell is not interactive, the ASCII Control Character will not work
print_status("Aborting foreground process in the shell session")
self.rstream.write("\u0003")
return
end
Expand All @@ -139,9 +140,15 @@ def _usr1
#
def _suspend
# Ask the user if they would like to background the session
if (prompt_yesno("Background session #{name}?") == true)
self.interacting = false
intent = prompt_yesno("Background session #{name}?")
if !intent
# User does not want to background the current session
# Just want to STOP the foreground process on the target machine
print_status("Backgrounding foreground process in the shell session")
self.rstream.write("\u001A")
return
end
self.interacting = false
end

#
Expand Down