File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
modules/payloads/singles/cmd/windows Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ class Msf::Sessions::PowerShell < Msf::Sessions::CommandShell
8
8
def process_autoruns ( datastore )
9
9
# Read the initial output (PS banner) and toss it)
10
10
initial_output = shell_read ( -1 , 0.01 )
11
- # TODO: send command for getting the username
12
- # TODO: parse out the username and set it to a variable
13
- # TODO: send command for getting the hostname
14
- # TODO: parse out the hostname and set it to a variable
11
+ if initial_output =~ /running as user ([^ \s ]+) on ([^ \s ]+)/
12
+ username = $1
13
+ hostname = $2
14
+ end
15
15
# Set the session info
16
- self . info = initial_output
16
+ self . info = " #{ username } @ #{ hostname } "
17
17
# Call our parent class's autoruns processing method
18
18
super
19
19
end
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ def initialize(info = {})
31
31
'Arch' => ARCH_CMD ,
32
32
'Handler' => Msf ::Handler ::BindTcp ,
33
33
'Session' => Msf ::Sessions ::PowerShell ,
34
- 'PayloadType' => 'cmd_interact' ,
35
34
'RequiredCmd' => 'generic' ,
36
35
'Payload' =>
37
36
{
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ def initialize(info = {})
31
31
'Arch' => ARCH_CMD ,
32
32
'Handler' => Msf ::Handler ::ReverseTcp ,
33
33
'Session' => Msf ::Sessions ::PowerShell ,
34
- 'PayloadType' => 'cmd_interact' ,
35
34
'RequiredCmd' => 'generic' ,
36
35
'Payload' =>
37
36
{
You can’t perform that action at this time.
0 commit comments