Skip to content

Commit

Permalink
Delete session functionality (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
f4rs1ght authored Dec 24, 2024
1 parent e9a8415 commit ee28118
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions conpot/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def get_databus():
def get_session(*args, **kwargs):
return sessionManager.get_session(*args, **kwargs)

def delete_session(*args, **kwargs):
return sessionManager.delete_session(*args, **kwargs)


# file-system related --

Expand Down
6 changes: 6 additions & 0 deletions conpot/core/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def get_session(
self._sessions.append(attack_session)
return attack_session

def delete_session(self, id):
for i, session in enumerate(self._sessions):
if session.id == id:
del self._sessions[i]
break

def purge_sessions(self):
# there is no native purge/clear mechanism for gevent queues, so...
self.log_queue = Queue()

0 comments on commit ee28118

Please sign in to comment.