Skip to content
Snippets Groups Projects

cowrie/wardenfiler: Store credentials for both successful and unsuccessful attempts

Open Pavel Valach requested to merge cowrie-credentials into master
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -253,7 +253,7 @@ class Output(cowrie.core.output.Output):
if s in self.sessions:
self.sessions[s]["input"] = []
self.sessions[s]["loggedin"] = True
self.sessions[s]["credentials"].append({"Username": u, "Password": p, "Accepted": True})
self.sessions[s]["credentials"].append({"Username": u, "Password": p, "Type": ["AcceptedByServer"]})
elif entry["eventid"] == "cowrie.login.failed":
u, p = entry["username"], entry["password"]
@@ -403,7 +403,7 @@ class Output(cowrie.core.output.Output):
attach["ContentEncoding"] = "base64"
event["Attach"] = [attach]
if self.sessions[s]["credentials"]:
accepted_creds = [ c for c in self.sessions[s]["credentials"] if "Accepted" in c ]
accepted_creds = [ c for c in self.sessions[s]["credentials"] if "Type" in c and "AcceptedByServer" in c["Type"] ]
event["Credentials"] = list(accepted_creds)
self.save_event(event)
Loading