File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: binary -*-
2
2
require 'msf/core'
3
3
require 'msf/core/option_container'
4
+ require 'msf/core/payload/transport_config'
4
5
5
6
###
6
7
#
9
10
###
10
11
module Msf ::Payload ::Stager
11
12
13
+ include Msf ::Payload ::TransportConfig
14
+
12
15
def initialize ( info = { } )
13
16
super
14
17
@@ -22,6 +25,28 @@ def initialize(info={})
22
25
23
26
end
24
27
28
+ #
29
+ # Perform attempt at detecting the appropriate transport config.
30
+ # Call the determined config with passed options.
31
+ # Override this in stages/stagers to use specific transports
32
+ #
33
+ def transport_config ( opts = { } )
34
+ if self . refname =~ /reverse_/
35
+ direction = 'reverse'
36
+ else
37
+ direction = 'bind'
38
+ end
39
+
40
+ if self . refname =~ /_tcp/
41
+ proto = 'tcp'
42
+ elsif self . refname =~ /_https/
43
+ proto = 'https'
44
+ else
45
+ proto = 'http'
46
+ end
47
+ send ( "transport_config_#{ direction } _#{ proto } " , opts )
48
+ end
49
+
25
50
#
26
51
# Sets the payload type to a stager.
27
52
#
You can’t perform that action at this time.
0 commit comments