Fix #5662 by not generating a small uri by default

bug/bundler_fix
HD Moore 2015-07-04 09:27:18 -07:00
parent 5be94c12b6
commit fb2da00bfd
2 changed files with 5 additions and 3 deletions

View File

@ -36,7 +36,7 @@ module Msf::Payload::UUID::Options
# The URI length may not have room for an embedded UUID # The URI length may not have room for an embedded UUID
if len && len < URI_CHECKSUM_UUID_MIN_LEN if len && len < URI_CHECKSUM_UUID_MIN_LEN
# Throw an error if the user set a seed, but there is no room for it # Throw an error if the user set a seed, but there is no room for it
if datastore['PayloadUUIDSeed'].to_s.length > 0 ||datastore['PayloadUUIDRaw'].to_s.length > 0 if datastore['PayloadUUIDSeed'].to_s.length > 0 || datastore['PayloadUUIDRaw'].to_s.length > 0
raise ArgumentError, "A PayloadUUIDSeed or PayloadUUIDRaw value was specified, but this payload doesn't have enough room for a UUID" raise ArgumentError, "A PayloadUUIDSeed or PayloadUUIDRaw value was specified, but this payload doesn't have enough room for a UUID"
end end
return "/" + generate_uri_checksum(sum, len, prefix="") return "/" + generate_uri_checksum(sum, len, prefix="")

View File

@ -46,13 +46,12 @@ module Payload::Windows::ReverseHttp
ssl: opts[:ssl] || false, ssl: opts[:ssl] || false,
host: datastore['LHOST'], host: datastore['LHOST'],
port: datastore['LPORT'], port: datastore['LPORT'],
url: generate_small_uri,
retry_count: datastore['StagerRetryCount'] retry_count: datastore['StagerRetryCount']
} }
# Add extra options if we have enough space # Add extra options if we have enough space
unless self.available_space.nil? || required_space > self.available_space unless self.available_space.nil? || required_space > self.available_space
conf[:url] = generate_uri
conf[:exitfunk] = datastore['EXITFUNC'] conf[:exitfunk] = datastore['EXITFUNC']
conf[:ua] = datastore['MeterpreterUserAgent'] conf[:ua] = datastore['MeterpreterUserAgent']
conf[:proxy_host] = datastore['PayloadProxyHost'] conf[:proxy_host] = datastore['PayloadProxyHost']
@ -60,6 +59,9 @@ module Payload::Windows::ReverseHttp
conf[:proxy_user] = datastore['PayloadProxyUser'] conf[:proxy_user] = datastore['PayloadProxyUser']
conf[:proxy_pass] = datastore['PayloadProxyPass'] conf[:proxy_pass] = datastore['PayloadProxyPass']
conf[:proxy_type] = datastore['PayloadProxyType'] conf[:proxy_type] = datastore['PayloadProxyType']
else
# Otherwise default to small URIs
conf[:url] = generate_small_uri
end end
generate_reverse_http(conf) generate_reverse_http(conf)