From 1cefe4232a3bc3675c514f087f3fdb1a411d329d Mon Sep 17 00:00:00 2001 From: Andras32 Date: Mon, 27 Jan 2020 14:41:36 -0600 Subject: [PATCH] added dependencies and cleanup (#803) * added dependencies and cleanup * Update T1010.yaml Fixed Circle CI error * Adjusting T1010.yaml Using Invoke-WebRequest over .Net.WebClient no longer deleting dependencies * moved cs and exe files to TEMP directory * T1010.cs back to atomics folder Co-authored-by: Carrie Roberts --- atomics/T1010/T1010.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/atomics/T1010/T1010.yaml b/atomics/T1010/T1010.yaml index c44d0418..89a62315 100644 --- a/atomics/T1010/T1010.yaml +++ b/atomics/T1010/T1010.yaml @@ -11,6 +11,10 @@ atomic_tests: - windows input_arguments: + input_url: + description: URL to source code in Atomic-Red-Team git repository + type: Url + default: https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1010/src/T1010.cs input_source_code: description: Path to source of C# code type: path @@ -18,7 +22,16 @@ atomic_tests: output_file_name: description: Name of output binary type: string - default: T1010.exe + default: $env:TEMP\T1010.exe + + dependency_executor_name: powershell + dependencies: + - description: | + T1010.cs must exist on disk at specified location (#{input_source_code}) + prereq_command: | + if (Test-Path #{input_source_code}) {exit 0} else {exit 1} + get_prereq_command: | + Invoke-WebRequest "#{input_URL}" -OutFile "#{input_source_code}" executor: name: command_prompt @@ -26,3 +39,5 @@ atomic_tests: command: | C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe -out:#{output_file_name} #{input_source_code} #{output_file_name} + cleanup_command: | + del #{output_file_name}