Skip to content

Commit 6661e1a

Browse files
committed
De-committing based on suggestions from Meatballs1 and jlee-r7.
1 parent 3fd7610 commit 6661e1a

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

lib/rex/post/meterpreter/client_core.rb

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -228,48 +228,6 @@ def migrate( pid )
228228

229229
if client.passive_service
230230

231-
# Replace the user agent string with our option
232-
i = blob.index("METERPRETER_UA\x00")
233-
if i
234-
str = client.exploit_datastore['MeterpreterUserAgent'][0,255] + "\x00"
235-
blob[i, str.length] = str
236-
end
237-
238-
# Activate a custom proxy
239-
i = blob.index("METERPRETER_PROXY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
240-
if i
241-
if client.exploit_datastore['PROXYHOST']
242-
if client.exploit_datastore['PROXYHOST'].to_s != ""
243-
proxyhost = client.exploit_datastore['PROXYHOST'].to_s
244-
proxyport = client.exploit_datastore['PROXYPORT'].to_s || "8080"
245-
proxyinfo = proxyhost + ":" + proxyport
246-
if proxyport == "80"
247-
proxyinfo = proxyhost
248-
end
249-
if client.exploit_datastore['PROXY_TYPE'].to_s == 'HTTP'
250-
proxyinfo = 'http://' + proxyinfo
251-
else #socks
252-
proxyinfo = 'socks=' + proxyinfo
253-
end
254-
proxyinfo << "\x00"
255-
blob[i, proxyinfo.length] = proxyinfo
256-
#Optional authentification
257-
unless (client.exploit_datastore['PROXY_USERNAME'].nil? or datastore['PROXY_USERNAME'].empty?) or
258-
(client.exploit_datastore['PROXY_PASSWORD'].nil? or datastore['PROXY_PASSWORD'].empty?) or
259-
client.exploit_datastore['PROXY_TYPE'] == 'SOCKS'
260-
261-
proxy_username_loc = blob.index("METERPRETER_USERNAME_PROXY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
262-
proxy_username = client.exploit_datastore['PROXY_USERNAME'] << "\x00"
263-
blob[proxy_username_loc, proxy_username.length] = proxy_username
264-
265-
proxy_password_loc = blob.index("METERPRETER_PASSWORD_PROXY\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
266-
proxy_password = client.exploit_datastore['PROXY_PASSWORD'] << "\x00"
267-
blob[proxy_password_loc, proxy_password.length] = proxy_password
268-
end
269-
end
270-
end
271-
end
272-
273231
# Replace the transport string first (TRANSPORT_SOCKET_SSL
274232
i = blob.index("METERPRETER_TRANSPORT_SSL")
275233
if i

0 commit comments

Comments
 (0)