From d14511b65a0415c77afb5fd3cc90f98cbb5ee909 Mon Sep 17 00:00:00 2001 From: checkymander Date: Mon, 5 Feb 2024 16:26:19 -0500 Subject: [PATCH] updated ls to use updated_deleted key --- .../Agent.Tests/TestClasses/TestAgentConfig.cs | 3 +++ .../Agent.Tests/TestClasses/TestTokenManager.cs | 15 +++++++++++++++ .../athena/athena/agent_code/ls/LocalListing.cs | 2 ++ .../athena/athena/agent_code/ls/RemoteListing.cs | 2 ++ 4 files changed, 22 insertions(+) diff --git a/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestAgentConfig.cs b/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestAgentConfig.cs index 4c72183cf..6cd6c6a50 100644 --- a/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestAgentConfig.cs +++ b/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestAgentConfig.cs @@ -14,6 +14,9 @@ internal class TestAgentConfig : IAgentConfig public string? psk { get; set; } public DateTime killDate { get; set; } public int chunk_size { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool prettyOutput { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public bool debug { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public int inject { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } public event EventHandler? SetAgentConfigUpdated; diff --git a/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestTokenManager.cs b/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestTokenManager.cs index ec4bcbc55..3e65c6265 100644 --- a/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestTokenManager.cs +++ b/Payload_Type/athena/athena/agent_code/Agent.Tests/TestClasses/TestTokenManager.cs @@ -24,6 +24,16 @@ public int getIntegrity() return 1; } + public void HandleFilePluginImpersonated(IFilePlugin plug, ServerJob job, ServerResponseResult response) + { + throw new NotImplementedException(); + } + + public void HandleInteractivePluginImpersonated(IInteractivePlugin plug, ServerJob job, InteractMessage message) + { + throw new NotImplementedException(); + } + public bool Impersonate(int i) { throw new NotImplementedException(); @@ -38,5 +48,10 @@ public bool Revert() { throw new NotImplementedException(); } + + public void RunTaskImpersonated(IPlugin plug, ServerJob job) + { + throw new NotImplementedException(); + } } } diff --git a/Payload_Type/athena/athena/agent_code/ls/LocalListing.cs b/Payload_Type/athena/athena/agent_code/ls/LocalListing.cs index 0644e7986..2547d7ba1 100644 --- a/Payload_Type/athena/athena/agent_code/ls/LocalListing.cs +++ b/Payload_Type/athena/athena/agent_code/ls/LocalListing.cs @@ -57,6 +57,7 @@ internal static FileBrowserResponseResult GetSingleFileLocalListingResult(string name = file.Name, parent_path = LsUtilities.GetParentDirectory(file).TrimEnd(Path.DirectorySeparatorChar), success = true, + update_deleted = false, access_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastAccessTime).ToUnixTimeMilliseconds()), modify_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastWriteTime).ToUnixTimeMilliseconds()), size = 0, @@ -92,6 +93,7 @@ private static FileBrowserResponseResult GetLocalDirectoryListing(string path, s name = file.Name, parent_path = LsUtilities.GetParentDirectory(file).TrimEnd(Path.DirectorySeparatorChar), success = true, + update_deleted = true, access_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastAccessTime).ToUnixTimeMilliseconds()), modify_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastWriteTime).ToUnixTimeMilliseconds()), size = 0, diff --git a/Payload_Type/athena/athena/agent_code/ls/RemoteListing.cs b/Payload_Type/athena/athena/agent_code/ls/RemoteListing.cs index b4bf300fc..f18451aac 100644 --- a/Payload_Type/athena/athena/agent_code/ls/RemoteListing.cs +++ b/Payload_Type/athena/athena/agent_code/ls/RemoteListing.cs @@ -55,6 +55,7 @@ internal static FileBrowserResponseResult GetRemoteSingleFile(UNCPathParser pars name = parser.GetFileName(), parent_path = parser.GetParentPath(true), success = true, + update_deleted = false, access_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastAccessTime).ToUnixTimeMilliseconds()), modify_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastWriteTime).ToUnixTimeMilliseconds()), size = 0, @@ -89,6 +90,7 @@ internal static FileBrowserResponseResult GetRemoteDirectory(UNCPathParser parse permissions = new Dictionary(), name = parser.GetFileName(), parent_path = parser.GetParentPath(true), + update_deleted = true, success = true, access_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastAccessTime).ToUnixTimeMilliseconds()), modify_time = LsUtilities.GetTimeStamp(new DateTimeOffset(file.LastWriteTime).ToUnixTimeMilliseconds()),