Skip to content

Commit 3ec30d8

Browse files
author
Mattis Swannet
committed
updated log filename configuration to ScriptProperty properties
1 parent e9cba47 commit 3ec30d8

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Public/config.ps1

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ $artConfig = [PSCustomObject]@{
3131

3232
verbose = $true; # set to true for more log output
3333

34-
# [optional] logfile filename configs
34+
# [optional] logfile filename config
3535
logFolder = "AtomicRunner-Logs"
36-
timeLocal = (Get-Date(get-date) -uformat "%Y-%m-%d").ToString()
37-
logFileName = "$($artConfig.timeLocal)`_$($artConfig.basehostname)-ExecLog.csv"
3836

3937
# amsi bypass script block (applies to Windows only)
4038
absb = $null
@@ -44,6 +42,24 @@ $artConfig = [PSCustomObject]@{
4442

4543
}
4644

45+
# For log filenames to update with the current time when they are accessed, they need to initiated as ScriptProperty properties
46+
$scriptParam = @{
47+
MemberType = "ScriptProperty"
48+
InputObject = $PrivateConfig
49+
Name = "timeLocal"
50+
Value = { (Get-Date(get-date) -uformat "%Y-%m-%dT%H-%M").ToString() }
51+
}
52+
Add-Member @scriptParam
53+
54+
$scriptParam = @{
55+
MemberType = "ScriptProperty"
56+
InputObject = $PrivateConfig
57+
Name = "logFileName"
58+
Value = { "$($artConfig.timeLocal)`_$($artConfig.basehostname)-ExecLog.csv" }
59+
}
60+
Add-Member @scriptParam
61+
62+
4763
# If you create a file called privateConfig.ps1 in the same directory as you installed Invoke-AtomicRedTeam you can overwrite any of these settings with your custom values
4864
$root = Split-Path (Split-Path $PSScriptRoot -Parent) -Parent
4965
$pathToPrivateConfig = Join-Path $root "privateConfig.ps1"

0 commit comments

Comments
 (0)