File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -108,18 +108,21 @@ def execute_cmdstager(opts = {})
108
108
# @option opts :decoder [Symbol] The decoder stub to use.
109
109
# @param pl [String] String containing the payload to execute
110
110
# @return [Array] The list of commands to execute
111
- # @raise [ArgumentError] raised if the cmd stub cannot be generated
111
+ # @raise [ArgumentError] raised if the exe or cmd stub cannot be generated
112
112
def generate_cmdstager ( opts = { } , pl = nil )
113
113
select_cmdstager ( opts )
114
114
115
115
self . exe = generate_payload_exe ( :code => pl )
116
116
117
+ if exe . nil?
118
+ raise ArgumentError , 'The executable could not be generated'
119
+ end
120
+
117
121
self . stager_instance = create_stager
118
122
cmd_list = stager_instance . generate ( opts_with_decoder ( opts ) )
119
123
120
- if ( cmd_list . nil? || cmd_list . length < 1 )
121
- print_error ( "The command stager could not be generated" )
122
- raise ArgumentError
124
+ if cmd_list . nil? || cmd_list . length . zero?
125
+ raise ArgumentError , 'The command stager could not be generated'
123
126
end
124
127
125
128
cmd_list
You can’t perform that action at this time.
0 commit comments