Skip to content

Commit 02d202d

Browse files
author
us3r777
committed
Refactor Jboss mixin
Use send_request_cgi and vars_get rand_text_alpha -> Rex::Text.rand_text_alpha
1 parent 919eec2 commit 02d202d

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

lib/msf/http/jboss/base.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ def auto_target(available_targets)
7373
end
7474

7575
def query_serverinfo
76-
path = normalize_uri(target_uri.path.to_s, '/HtmlAdaptor?action=inspectMBean&name=jboss.system:type=ServerInfo')
77-
res = send_request_raw(
76+
path = normalize_uri(target_uri.path.to_s, 'HtmlAdaptor')
77+
res = send_request_cgi(
7878
{
7979
'uri' => path,
80-
'method' => http_verb
80+
'method' => http_verb,
81+
'vars_get' =>
82+
{
83+
'action' => 'inspectMBean',
84+
'name' => 'jboss.system:type=ServerInfo'
85+
}
8186
})
8287

8388
unless res && res.code == 200

lib/msf/http/jboss/deployment_file_repository_scripts.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ module Msf::HTTP::JBoss::DeploymentFileRepositoryScripts
1010
# @param stager_jsp [String] The name name of the jsp stager.
1111
# @return [String] The JSP head stager.
1212
def head_stager_jsp(stager_base, stager_jsp_name)
13-
content_var = rand_text_alpha(8+rand(8))
14-
file_path_var = rand_text_alpha(8+rand(8))
15-
jboss_home_var = rand_text_alpha(8+rand(8))
16-
fos_var = rand_text_alpha(8+rand(8))
17-
bw_var = rand_text_alpha(8+rand(8))
13+
content_var = Rex::Text.rand_text_alpha(8+rand(8))
14+
file_path_var = Rex::Text.rand_text_alpha(8+rand(8))
15+
jboss_home_var = Rex::Text.rand_text_alpha(8+rand(8))
16+
fos_var = Rex::Text.rand_text_alpha(8+rand(8))
17+
bw_var = Rex::Text.rand_text_alpha(8+rand(8))
1818
head_stager_jsp_code = <<-EOT
1919
<%@page import="java.io.*,
2020
java.util.*"

0 commit comments

Comments
 (0)