allow reusing the already-generated payload uuid in generate_uri_uuid_mode
parent
a580055491
commit
e74239b30f
|
@ -26,6 +26,7 @@ module Payload::Android::ReverseHttp
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_config(opts={})
|
def generate_config(opts={})
|
||||||
|
opts[:uuid] ||= generate_payload_uuid
|
||||||
opts[:uri] ||= luri + generate_uri(opts)
|
opts[:uri] ||= luri + generate_uri(opts)
|
||||||
super(opts)
|
super(opts)
|
||||||
end
|
end
|
||||||
|
@ -46,7 +47,7 @@ module Payload::Android::ReverseHttp
|
||||||
raise ArgumentError, "Minimum StagerURILength is 5"
|
raise ArgumentError, "Minimum StagerURILength is 5"
|
||||||
end
|
end
|
||||||
|
|
||||||
generate_uri_uuid_mode(:init_java, uri_req_len)
|
generate_uri_uuid_mode(:init_java, uri_req_len, uuid: opts[:uuid])
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -30,7 +30,7 @@ module Msf::Payload::UUID::Options
|
||||||
# @param len [Fixnum] The length of the URI not including the leading slash, optionally nil for random
|
# @param len [Fixnum] The length of the URI not including the leading slash, optionally nil for random
|
||||||
# @return [String] A URI with a leading slash that hashes to the checksum, with an optional UUID
|
# @return [String] A URI with a leading slash that hashes to the checksum, with an optional UUID
|
||||||
#
|
#
|
||||||
def generate_uri_uuid_mode(mode,len=nil)
|
def generate_uri_uuid_mode(mode, len = nil, uuid: nil)
|
||||||
sum = uri_checksum_lookup(mode)
|
sum = uri_checksum_lookup(mode)
|
||||||
|
|
||||||
# The URI length may not have room for an embedded UUID
|
# The URI length may not have room for an embedded UUID
|
||||||
|
@ -42,7 +42,7 @@ module Msf::Payload::UUID::Options
|
||||||
return "/" + generate_uri_checksum(sum, len, prefix="")
|
return "/" + generate_uri_checksum(sum, len, prefix="")
|
||||||
end
|
end
|
||||||
|
|
||||||
uuid = generate_payload_uuid
|
uuid ||= generate_payload_uuid
|
||||||
uri = generate_uri_uuid(sum, uuid, len)
|
uri = generate_uri_uuid(sum, uuid, len)
|
||||||
record_payload_uuid_url(uuid, uri)
|
record_payload_uuid_url(uuid, uri)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue