File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ def shell_init
120
120
121
121
end
122
122
123
- def bootstrap ( datastore = { } )
123
+ def bootstrap ( datastore = { } , handler = nil )
124
124
session = self
125
125
126
126
init_session = Proc . new do
@@ -182,9 +182,12 @@ def bootstrap(datastore={})
182
182
end
183
183
184
184
# Process the auto-run scripts for this session
185
- if self . respond_to? ( ' process_autoruns' )
185
+ if self . respond_to? ( : process_autoruns)
186
186
self . process_autoruns ( datastore )
187
187
end
188
+
189
+ # Tell the handler that we have a session
190
+ handler . on_session ( self ) if handler
188
191
end
189
192
190
193
# Defer the session initialization to the Session Manager scheduler
Original file line number Diff line number Diff line change @@ -244,8 +244,11 @@ def register_session(session)
244
244
framework . sessions . register ( session )
245
245
246
246
# Call the handler's on_session() method
247
- on_session ( session )
248
- session . bootstrap ( datastore )
247
+ if session . respond_to? ( :bootstrap )
248
+ session . bootstrap ( datastore , self )
249
+ else
250
+ on_session ( session )
251
+ end
249
252
250
253
# If there is an exploit associated with this payload, then let's notify
251
254
# anyone who is interested that this exploit succeeded
You can’t perform that action at this time.
0 commit comments