Skip to content

Commit 4906b8a

Browse files
committed
LAND rapid7#7760, prevent duplicate UUIDs when generating Android HTTP/S payloads
2 parents 9d0ada9 + e74239b commit 4906b8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/msf/core/payload/android/reverse_http.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def transport_config(opts={})
2626
end
2727

2828
def generate_config(opts={})
29+
opts[:uuid] ||= generate_payload_uuid
2930
opts[:uri] ||= luri + generate_uri(opts)
3031
super(opts)
3132
end
@@ -46,7 +47,7 @@ def generate_uri(opts={})
4647
raise ArgumentError, "Minimum StagerURILength is 5"
4748
end
4849

49-
generate_uri_uuid_mode(:init_java, uri_req_len)
50+
generate_uri_uuid_mode(:init_java, uri_req_len, uuid: opts[:uuid])
5051
end
5152

5253
#

lib/msf/core/payload/uuid/options.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(info = {})
3030
# @param len [Fixnum] The length of the URI not including the leading slash, optionally nil for random
3131
# @return [String] A URI with a leading slash that hashes to the checksum, with an optional UUID
3232
#
33-
def generate_uri_uuid_mode(mode,len=nil)
33+
def generate_uri_uuid_mode(mode, len = nil, uuid: nil)
3434
sum = uri_checksum_lookup(mode)
3535

3636
# The URI length may not have room for an embedded UUID
@@ -42,7 +42,7 @@ def generate_uri_uuid_mode(mode,len=nil)
4242
return "/" + generate_uri_checksum(sum, len, prefix="")
4343
end
4444

45-
uuid = generate_payload_uuid
45+
uuid ||= generate_payload_uuid
4646
uri = generate_uri_uuid(sum, uuid, len)
4747
record_payload_uuid_url(uuid, uri)
4848

0 commit comments

Comments
 (0)