Skip to content

Commit

Permalink
convert encoding for all files
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbuff committed Dec 28, 2023
1 parent 0eedc36 commit 7250851
Show file tree
Hide file tree
Showing 26 changed files with 1,120 additions and 1,120 deletions.
196 changes: 98 additions & 98 deletions Invoke-AtomicRedTeam.psd1
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
@{

# Script module or binary module file associated with this manifest.
RootModule = 'Invoke-AtomicRedTeam.psm1'

# Version number of this module.
ModuleVersion = '2.0.6'

# ID used to uniquely identify this module
GUID = '8f492621-18f8-432e-9532-b1d54d3e90bd'

# Author of this module
Author = 'Casey Smith @subTee, Josh Rickard @MSAdministrator, Carrie Roberts @OrOneEqualsOne, Matt Graeber @mattifestation'

# Company or vendor of this module
CompanyName = 'Red Canary, Inc.'

# Copyright statement for this module
Copyright = '(c) 2021 Red Canary. All rights reserved.'

# Description of the functionality provided by this module
Description = 'A PowerShell module that runs Atomic Red Team tests from yaml definition files.'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('powershell-yaml')

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# AtomicClassSchema.ps1 needs to be present in the caller's scope in order for the built-in classes to surface properly.
ScriptsToProcess = @('Private\AtomicClassSchema.ps1', 'Public\config.ps1')

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
'Invoke-AtomicTest',
'Get-AtomicTechnique',
'New-AtomicTechnique',
'New-AtomicTest',
'New-AtomicTestInputArgument',
'New-AtomicTestDependency',
'Start-AtomicGUI',
'Stop-AtomicGUI',
'Invoke-SetupAtomicRunner',
'Invoke-GenerateNewSchedule',
'Invoke-RefreshExistingSchedule',
'Invoke-AtomicRunner',
'Get-Schedule',
'Invoke-KickoffAtomicRunner',
'Get-PreferredIPAddress'
)

# Variables to export from this module
VariablesToExport = '*'

NestedModules = @(
"Public\Default-ExecutionLogger.psm1",
"Public\Attire-ExecutionLogger.psm1",
"Public\Syslog-ExecutionLogger.psm1",
"Public\WinEvent-ExecutionLogger.psm1"
)

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('Security', 'Defense')

# A URL to the license for this module.
LicenseUri = 'https://github.com/redcanaryco/invoke-atomicredteam/blob/master/LICENSE.txt'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/redcanaryco/invoke-atomicredteam'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = @'
1.0.2
-----
* Add support for custom execution loggers
1.0.1
-----
* Adding 'powershell-yaml' to RequiredModules in the module manifest
1.0.0
-----
* Initial release for submission to the PowerShell Gallery
'@

} # End of PSData hashtable

} # End of PrivateData hashtable
}
@{

# Script module or binary module file associated with this manifest.
RootModule = 'Invoke-AtomicRedTeam.psm1'

# Version number of this module.
ModuleVersion = '2.0.6'

# ID used to uniquely identify this module
GUID = '8f492621-18f8-432e-9532-b1d54d3e90bd'

# Author of this module
Author = 'Casey Smith @subTee, Josh Rickard @MSAdministrator, Carrie Roberts @OrOneEqualsOne, Matt Graeber @mattifestation'

# Company or vendor of this module
CompanyName = 'Red Canary, Inc.'

# Copyright statement for this module
Copyright = '(c) 2021 Red Canary. All rights reserved.'

# Description of the functionality provided by this module
Description = 'A PowerShell module that runs Atomic Red Team tests from yaml definition files.'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.0'

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('powershell-yaml')

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# AtomicClassSchema.ps1 needs to be present in the caller's scope in order for the built-in classes to surface properly.
ScriptsToProcess = @('Private\AtomicClassSchema.ps1', 'Public\config.ps1')

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
'Invoke-AtomicTest',
'Get-AtomicTechnique',
'New-AtomicTechnique',
'New-AtomicTest',
'New-AtomicTestInputArgument',
'New-AtomicTestDependency',
'Start-AtomicGUI',
'Stop-AtomicGUI',
'Invoke-SetupAtomicRunner',
'Invoke-GenerateNewSchedule',
'Invoke-RefreshExistingSchedule',
'Invoke-AtomicRunner',
'Get-Schedule',
'Invoke-KickoffAtomicRunner',
'Get-PreferredIPAddress'
)

# Variables to export from this module
VariablesToExport = '*'

NestedModules = @(
"Public\Default-ExecutionLogger.psm1",
"Public\Attire-ExecutionLogger.psm1",
"Public\Syslog-ExecutionLogger.psm1",
"Public\WinEvent-ExecutionLogger.psm1"
)

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('Security', 'Defense')

# A URL to the license for this module.
LicenseUri = 'https://github.com/redcanaryco/invoke-atomicredteam/blob/master/LICENSE.txt'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/redcanaryco/invoke-atomicredteam'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = @'
1.0.2
-----
* Add support for custom execution loggers
1.0.1
-----
* Adding 'powershell-yaml' to RequiredModules in the module manifest
1.0.0
-----
* Initial release for submission to the PowerShell Gallery
'@

} # End of PSData hashtable

} # End of PrivateData hashtable
}
108 changes: 54 additions & 54 deletions Private/AtomicClassSchema.ps1
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
class AtomicDependency {
[String] $description
[String] $prereq_command
[String] $get_prereq_command
}

class AtomicInputArgument {
[String] $description
[String] $type
[String] $default
}

class AtomicExecutorBase {
[String] $name
[Bool] $elevation_required

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.Name
}
}

class AtomicExecutorDefault : AtomicExecutorBase {
[String] $command
[String] $cleanup_command
}

class AtomicExecutorManual : AtomicExecutorBase {
[String] $steps
[String] $cleanup_command
}

class AtomicTest {
[String] $name
[String] $auto_generated_guid
[String] $description
[String[]] $supported_platforms
# I wish this didn't have to be a hashtable but I don't
# want to change the schema and introduce a breaking change.
[Hashtable] $input_arguments
[String] $dependency_executor_name
[AtomicDependency[]] $dependencies
[AtomicExecutorBase] $executor

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.name
}
}

class AtomicTechnique {
[String[]] $attack_technique
[String] $display_name
[AtomicTest[]] $atomic_tests
class AtomicDependency {
[String] $description
[String] $prereq_command
[String] $get_prereq_command
}

class AtomicInputArgument {
[String] $description
[String] $type
[String] $default
}

class AtomicExecutorBase {
[String] $name
[Bool] $elevation_required

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.Name
}
}

class AtomicExecutorDefault : AtomicExecutorBase {
[String] $command
[String] $cleanup_command
}

class AtomicExecutorManual : AtomicExecutorBase {
[String] $steps
[String] $cleanup_command
}

class AtomicTest {
[String] $name
[String] $auto_generated_guid
[String] $description
[String[]] $supported_platforms
# I wish this didn't have to be a hashtable but I don't
# want to change the schema and introduce a breaking change.
[Hashtable] $input_arguments
[String] $dependency_executor_name
[AtomicDependency[]] $dependencies
[AtomicExecutorBase] $executor

# Implemented to facilitate improved PS object display
[String] ToString() {
return $this.name
}
}

class AtomicTechnique {
[String[]] $attack_technique
[String] $display_name
[AtomicTest[]] $atomic_tests
}
2 changes: 1 addition & 1 deletion Private/Get-PrereqExecutor.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-PrereqExecutor ($test) {
function Get-PrereqExecutor ($test) {
if ($nul -eq $test.dependency_executor_name) { $executor = $test.executor.name }
else { $executor = $test.dependency_executor_name }
$executor
Expand Down
2 changes: 1 addition & 1 deletion Private/Get-TargetInfo.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-TargetInfo($Session) {
function Get-TargetInfo($Session) {
$tmpDir = "$env:TEMP\"
$isElevated = $false
$targetHostname = hostname
Expand Down
2 changes: 1 addition & 1 deletion Private/Invoke-ExecuteCommand.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Invoke-ExecuteCommand ($finalCommand, $executor, $executionPlatform, $TimeoutSeconds, $session = $null, $interactive) {
function Invoke-ExecuteCommand ($finalCommand, $executor, $executionPlatform, $TimeoutSeconds, $session = $null, $interactive) {
$null = @(
if ($null -eq $finalCommand) { return 0 }
$finalCommand = $finalCommand.trim()
Expand Down
2 changes: 1 addition & 1 deletion Private/Invoke-Process.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The Invoke-Process function is loosely based on code from https://github.com/guitarrapc/PowerShellUtil/blob/master/Invoke-Process/Invoke-Process.ps1
# The Invoke-Process function is loosely based on code from https://github.com/guitarrapc/PowerShellUtil/blob/master/Invoke-Process/Invoke-Process.ps1
function Invoke-Process {
[OutputType([PSCustomObject])]
[CmdletBinding()]
Expand Down
4 changes: 2 additions & 2 deletions Private/Show-Details.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Invoke-CleanupDescription() {
function Invoke-CleanupDescription() {
$ret1 = $test.description.ToString().trim() -replace '(?<!\n)\n(?!\n)', ' ' #replace single linefeeds with a space
$ret1 -replace '\n\n', "`n" #replace double linefeeds with a single linefeed
}
Expand Down Expand Up @@ -48,4 +48,4 @@ function Show-Details ($test, $testCount, $technique, $customInputArgs, $PathToA
# Footer
Write-Host -ForegroundColor Magenta "[!!!!!!!!END TEST!!!!!!!]`n`n"

}
}
2 changes: 1 addition & 1 deletion Private/Write-KeyValue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ function Write-KeyValue ($key, $value) {
}
}
Write-Host ""
}
}
2 changes: 1 addition & 1 deletion Public/Attire-ExecutionLogger.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Attire-ExecutionLogger.psm1
# Attire-ExecutionLogger.psm1
# Copyright 2023 Security Risk Advisors

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”),
Expand Down
2 changes: 1 addition & 1 deletion Public/Default-ExecutionLogger.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Start-ExecutionLog($startTime, $logPath, $targetHostname, $targetUser, $commandLine, $isWindows) {
function Start-ExecutionLog($startTime, $logPath, $targetHostname, $targetUser, $commandLine, $isWindows) {

}

Expand Down
2 changes: 1 addition & 1 deletion Public/Get-AtomicTechnique.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
filter Get-AtomicTechnique {
filter Get-AtomicTechnique {
<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-PreferredIPAddress.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-PreferredIPAddress($isWindows) {
function Get-PreferredIPAddress($isWindows) {
if ($isWindows) {
return (Get-NetIPAddress | Where-Object { $_.PrefixOrigin -ne "WellKnown" }).IPAddress
}
Expand Down
Loading

0 comments on commit 7250851

Please sign in to comment.