Fix session guid handling in python 3
I made the mistake of using str.decode() which isn't a thing in python3 (works fine in 2). So this commit fixes it so that the GUID string itself is generated directly as a byte string, so that the call to decode() isn't needed at all.bug/bundler_fix
parent
c4288fb35a
commit
2c0f41ee8f
|
@ -75,11 +75,11 @@ module Payload::Python::MeterpreterLoader
|
|||
met.sub!("PAYLOAD_UUID = \'\'", "PAYLOAD_UUID = \'#{uuid}\'")
|
||||
|
||||
if opts[:stageless] == true
|
||||
session_guid = "00" * 16
|
||||
session_guid = '\x00' * 16
|
||||
else
|
||||
session_guid = SecureRandom.uuid.gsub(/-/, '')
|
||||
session_guid = SecureRandom.uuid.gsub(/-/, '').gsub(/(..)/, '\\x\1')
|
||||
end
|
||||
met.sub!("SESSION_GUID = \'\'", "SESSION_GUID = \'#{session_guid}\'.decode(\'hex\')")
|
||||
met.sub!("SESSION_GUID = \'\'", "SESSION_GUID = \'#{session_guid}\'")
|
||||
|
||||
http_user_agent = opts[:http_user_agent] || ds['MeterpreterUserAgent']
|
||||
http_proxy_host = opts[:http_proxy_host] || ds['PayloadProxyHost'] || ds['PROXYHOST']
|
||||
|
|
Loading…
Reference in New Issue