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
OJ 2017-06-16 09:01:29 +10:00
parent c4288fb35a
commit 2c0f41ee8f
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597
1 changed files with 3 additions and 3 deletions

View File

@ -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']