1
1
# -*- coding: binary -*-
2
2
3
3
require 'rex/exploitation/cmdstager'
4
- require 'msf/core/exploit/exe'
5
- require 'msf/base/config'
4
+ require 'msf/core/exploit/cmdstager/http'
6
5
7
6
module Msf
8
7
9
8
# This mixin provides an interface to generating cmdstagers
10
9
module Exploit ::CmdStager
11
10
12
11
include Msf ::Exploit ::EXE
12
+ include Msf ::Exploit ::CmdStager ::Http
13
13
14
14
# Constant for stagers - used when creating an stager instance.
15
15
STAGERS = {
@@ -21,7 +21,9 @@ module Exploit::CmdStager
21
21
:vbs => Rex ::Exploitation ::CmdStagerVBS ,
22
22
:vbs_adodb => Rex ::Exploitation ::CmdStagerVBS ,
23
23
:certutil => Rex ::Exploitation ::CmdStagerCertutil ,
24
- :tftp => Rex ::Exploitation ::CmdStagerTFTP
24
+ :tftp => Rex ::Exploitation ::CmdStagerTFTP ,
25
+ :wget => Rex ::Exploitation ::CmdStagerWget ,
26
+ :curl => Rex ::Exploitation ::CmdStagerCurl
25
27
}
26
28
27
29
# Constant for decoders - used when checking the default flavor decoder.
@@ -124,6 +126,11 @@ def generate_cmdstager(opts = {}, pl = nil)
124
126
end
125
127
126
128
self . stager_instance = create_stager
129
+
130
+ if stager_instance . respond_to? ( :http? ) && stager_instance . http?
131
+ opts [ :payload_uri ] = start_service ( opts )
132
+ end
133
+
127
134
cmd_list = stager_instance . generate ( opts_with_decoder ( opts ) )
128
135
129
136
if cmd_list . nil? || cmd_list . length . zero?
0 commit comments