Skip to content

Commit 8c1a597

Browse files
committed
Make a Session record before using it
How about that.
1 parent f4977bf commit 8c1a597

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/msf/core/db_manager/session.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,6 @@ def create_mdm_session_from_session(opts)
187187
via_payload: session.via_payload,
188188
}
189189

190-
if session.exploit_task and session.exploit_task.record
191-
session_task = session.exploit_task.record
192-
if session_task.class == Mdm::Task
193-
Mdm::TaskSession.create(task: session_task, session: s )
194-
end
195-
end
196-
197190
# In the case of multi handler we cannot yet determine the true
198191
# exploit responsible. But we can at least show the parent versus
199192
# just the generic handler:
@@ -202,6 +195,14 @@ def create_mdm_session_from_session(opts)
202195
end
203196

204197
s = ::Mdm::Session.create!(sess_data)
198+
199+
if session.exploit_task and session.exploit_task.record
200+
session_task = session.exploit_task.record
201+
if session_task.class == Mdm::Task
202+
Mdm::TaskSession.create(task: session_task, session: s )
203+
end
204+
end
205+
205206
s
206207
}
207208
end

0 commit comments

Comments
 (0)