You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: msploitego/src/msploitego/transforms/common/postgresdb.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,12 @@ def getServices(self,hostid):
57
57
returnself._cur.fetchall()
58
58
59
59
defgetSessions(self,wid):
60
-
sql="SELECT sessions.id, sessions.host_id, sessions.stype, sessions.via_exploit, sessions.via_payload, sessions.desc, sessions.port, sessions.platform,sessions.opened_at, sessions.closed_at, sessions.close_reason, sessions.local_id, sessions.last_seen, sessions.module_run_id, hosts.workspace_id as workspaceid FROM public.sessions, public.hosts, public.workspaces WHERE hosts.id = sessions.host_id AND workspaces.id = hosts.workspace_id AND hosts.workspace_id = {};".format(wid)
60
+
sql="SELECT sessions.id as sessionid, sessions.host_id, sessions.stype, sessions.via_exploit, sessions.via_payload, sessions.desc as sessiondescription, sessions.port, sessions.platform,sessions.opened_at, sessions.closed_at, sessions.close_reason, sessions.local_id, sessions.last_seen, sessions.module_run_id, hosts.workspace_id as workspaceid, hosts.address as ip FROM public.sessions, public.hosts, public.workspaces WHERE hosts.id = sessions.host_id AND workspaces.id = hosts.workspace_id AND hosts.workspace_id = {};".format(wid)
61
+
self._cur.execute(sql)
62
+
returnself._cur.fetchall()
63
+
64
+
defgetSessionsForHost(self,hostid):
65
+
sql="SELECT hosts.address AS ip, sessions.host_id AS hostid, sessions.stype AS sessiontype, sessions.via_exploit, sessions.via_payload, sessions.desc AS sessiondescription, sessions.port, sessions.platform, sessions.opened_at, sessions.closed_at, sessions.close_reason, sessions.local_id AS localid, sessions.last_seen, sessions.module_run_id, sessions.id AS sessionid FROM public.hosts, public.sessions WHERE hosts.id = sessions.host_id AND hosts.id = {};".format(hostid)
0 commit comments