adds new tests for compiling C,CC,Go

This commit is contained in:
George Allen
2021-11-21 17:01:26 +00:00
parent 4b1bc4557e
commit a0ba29cd43
4 changed files with 92 additions and 1 deletions
+74 -1
View File
@@ -57,4 +57,77 @@ atomic_tests:
executor:
command: |
Invoke-Expression #{input_file}
name: powershell
name: powershell
- name: C compile
description: |
Compile a c file with either gcc or clang on Linux or Macos.
supported_platforms:
- linux
- macos
input_arguments:
input_file:
description: source file
type: Path
default: PathToAtomicsFolder/T1027.004/src/T1027-004-test.c
dependency_executor_name: powershell
dependencies:
- description: |
the source file must exist on disk at specified location (#{input_file})
prereq_command: |
if (Test-Path #{input_file}) {exit 0} else {exit 1}
get_prereq_command: |
Invoke-WebRequest https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1027.004/src/T1027-004-test.c -OutFile #{input_file}
executor:
command: |
gcc #{input_file} && ./a.out
clang #{input_file} && ./a.out
name: bash
- name: CC compile
description: |
Compile a c file with either gcc or clang on Linux or Macos.
supported_platforms:
- linux
- macos
input_arguments:
input_file:
description: source file
type: Path
default: PathToAtomicsFolder/T1027.004/src/T1027-004-test.cc
dependency_executor_name: powershell
dependencies:
- description: |
the source file must exist on disk at specified location (#{input_file})
prereq_command: |
if (Test-Path #{input_file}) {exit 0} else {exit 1}
get_prereq_command: |
Invoke-WebRequest https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1027.004/src/T1027-004-test.c -OutFile #{input_file}
executor:
command: |
g++ #{input_file} && ./a.out
clang++ #{input_file} && ./a.out
name: bash
- name: Go compile
description: |
Compile a c file with either gcc or clang on Linux or Macos.
supported_platforms:
- linux
- macos
input_arguments:
input_file:
description: source file
type: Path
default: PathToAtomicsFolder/T1027.004/src/T1027-004-test.go
dependency_executor_name: powershell
dependencies:
- description: |
the source file must exist on disk at specified location (#{input_file})
prereq_command: |
if (Test-Path #{input_file}) {exit 0} else {exit 1}
get_prereq_command: |
Invoke-WebRequest https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1027.004/src/T1027-004-test.c -OutFile #{input_file}
executor:
command: |
go run #{input_file}
name: bash
+6
View File
@@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("T1027-004-test.c has compiled and executed");
return 0;
}
+5
View File
@@ -0,0 +1,5 @@
#include <iostream>
int main() {
std::cout << "T1027-004-test.cc has compiled and executed\n";
return 0;
}
+7
View File
@@ -0,0 +1,7 @@
package main
import "fmt"
func main() {
fmt.Println("T1027-004-test.go has compiled and executed")
}