Skip to content

Commit 4aae9b8

Browse files
author
Brent Cook
committed
support upgrading a powershell session to meterpreter
1 parent d7887b5 commit 4aae9b8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/msf/base/sessions/powershell.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ def self.type
2727
"powershell"
2828
end
2929

30+
#
31+
# Returns the session platform.
32+
#
33+
def platform
34+
"win"
35+
end
36+
3037
#
3138
# Returns the session description.
3239
#

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,12 +1917,12 @@ def cmd_sessions(*args)
19171917
session.response_timeout = response_timeout
19181918
end
19191919
begin
1920-
if session.type == 'shell'
1920+
if session.type.include? 'shell'
19211921
session.init_ui(driver.input, driver.output)
19221922
session.execute_script('post/multi/manage/shell_to_meterpreter')
19231923
session.reset_ui
19241924
else
1925-
print_error("Session #{sess_id} is not a command shell session, skipping...")
1925+
print_error("Session #{sess_id} is not a command shell session, it is #{session.type}, skipping...")
19261926
next
19271927
end
19281928
ensure

0 commit comments

Comments
 (0)