Skip to content

Commit 5da34e8

Browse files
committed
support RHOST/RPORT
1 parent 5958019 commit 5da34e8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

modules/exploits/linux/misc/drb_remote_codeexec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ def initialize(info = {})
4141

4242
register_options(
4343
[
44-
OptString.new('URI', [true, "The dRuby URI of the target host (druby://host:port)", ""]),
44+
OptString.new('URI',
45+
"The URI of the target host (druby://host:port) (overrides RHOST/RPORT)"),
46+
Opt::RHOST(nil, false),
47+
Opt::RPORT(8787)
4548
])
4649
end
4750

@@ -94,7 +97,11 @@ def method_syscall(p)
9497
end
9598

9699
def exploit
97-
serveruri = datastore['URI']
100+
unless datastore['URI'].blank?
101+
serveruri = datastore['URI']
102+
else
103+
serveruri = "druby://#{datastore['RHOST']}:#{datastore['RPORT']}"
104+
end
98105

99106
DRb.start_service
100107
p = DRbObject.new_with_uri(serveruri)

0 commit comments

Comments
 (0)