File tree Expand file tree Collapse file tree 3 files changed +17
-13
lines changed
ui/console/command_dispatcher Expand file tree Collapse file tree 3 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -98,15 +98,15 @@ def cleanup_meterpreter
98
98
pivot . pivoted_session . shutdown_passive_dispatcher
99
99
end
100
100
101
- if not self . skip_cleanup
101
+ unless self . skip_cleanup
102
102
ext . aliases . each_value do | extension |
103
103
extension . cleanup if extension . respond_to? ( 'cleanup' )
104
104
end
105
105
end
106
106
107
107
dispatcher_thread . kill if dispatcher_thread
108
108
109
- if not self . skip_cleanup
109
+ unless self . skip_cleanup
110
110
core . shutdown rescue nil
111
111
end
112
112
Original file line number Diff line number Diff line change @@ -118,8 +118,8 @@ def Pivot.create_named_pipe_listener(client, opts={})
118
118
stage = stager . stage_payload ( stage_opts )
119
119
120
120
url = "pipe://#{ opts [ :pipe_host ] } /#{ opts [ :pipe_name ] } "
121
- stage = "#{ opts [ :arch ] } /#{ opts [ :platform ] } "
122
- pivot_listener = PivotListener . new ( ::Msf ::Sessions ::Meterpreter_x86_Win , url , stage )
121
+ stage_config = "#{ opts [ :arch ] } /#{ opts [ :platform ] } "
122
+ pivot_listener = PivotListener . new ( ::Msf ::Sessions ::Meterpreter_x86_Win , url , stage_config )
123
123
124
124
request . add_tlv ( TLV_TYPE_PIVOT_STAGE_DATA , stage )
125
125
request . add_tlv ( TLV_TYPE_PIVOT_STAGE_DATA_SIZE , stage . length )
Original file line number Diff line number Diff line change @@ -202,16 +202,20 @@ def cmd_pivot(*args)
202
202
Pivot . remove_listener ( client , listener_id )
203
203
print_good ( "Successfully removed pivot: #{ opts [ :guid ] } " )
204
204
when 'list' , 'show' , 'print'
205
- tbl = Rex ::Text ::Table . new (
206
- 'Header' => 'Currently active pivot listeners' ,
207
- 'Indent' => 4 ,
208
- 'Columns' => [ 'Id' , 'URL' , 'Stage' ] )
209
-
210
- client . pivot_listeners . each do |k , v |
211
- tbl << v . to_row
205
+ if client . pivot_listeners . length > 0
206
+ tbl = Rex ::Text ::Table . new (
207
+ 'Header' => 'Currently active pivot listeners' ,
208
+ 'Indent' => 4 ,
209
+ 'Columns' => [ 'Id' , 'URL' , 'Stage' ] )
210
+
211
+ client . pivot_listeners . each do |k , v |
212
+ tbl << v . to_row
213
+ end
214
+ print_line
215
+ print_line ( tbl . to_s )
216
+ else
217
+ print_status ( 'There are no active pivot listeners' )
212
218
end
213
- print_line
214
- print_line ( tbl . to_s )
215
219
when 'add'
216
220
unless opts [ :type ]
217
221
print_error ( 'Pivot type must be specified (-t)' )
You can’t perform that action at this time.
0 commit comments