fix T1001.002-1 powershell gen passwords (#3007)

Co-authored-by: Carrie Roberts <clr2of8@gmail.com>
This commit is contained in:
joaovarelas
2024-12-11 00:56:27 +00:00
committed by GitHub
parent 666c877ffc
commit 998b8ff722
4 changed files with 4 additions and 8 deletions
+1 -3
View File
@@ -80404,9 +80404,7 @@ command-and-control:
{exit 0}
}
get_prereq_command: "Write-Output \"Generating random passwords and saving
to file...\"\n$passwords = 1..10 | ForEach-Object { Get-Random -InputObject
('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:,.<>?')
-Count 12 }\n$passwords | Out-File -FilePath \"#{passwords_file}\" \n"
to file...\"\n$passwords = 1..10 | ForEach-Object { -join ((1..12) | ForEach-Object { @('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') + @('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') + @('0','1','2','3','4','5','6','7','8','9') + @('!','@','#','$','%','^','&','*','(','(',')','-','=','+','_','[',']','{','}','|',';',';',':',',','<','>','?') | Get-Random }) }\n$passwords | Out-File -FilePath \"#{passwords_file}\" \n"
- description: "Tarz file to embed in image must exist \n"
prereq_command: |
if (!(Test-Path "#{tar_file}")) {exit 1} else {
+1 -3
View File
@@ -66633,9 +66633,7 @@ command-and-control:
{exit 0}
}
get_prereq_command: "Write-Output \"Generating random passwords and saving
to file...\"\n$passwords = 1..10 | ForEach-Object { Get-Random -InputObject
('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:,.<>?')
-Count 12 }\n$passwords | Out-File -FilePath \"#{passwords_file}\" \n"
to file...\"\n$passwords = 1..10 | ForEach-Object { -join ((1..12) | ForEach-Object { @('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') + @('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') + @('0','1','2','3','4','5','6','7','8','9') + @('!','@','#','$','%','^','&','*','(','(',')','-','=','+','_','[',']','{','}','|',';',';',':',',','<','>','?') | Get-Random }) }\n$passwords | Out-File -FilePath \"#{passwords_file}\" \n"
- description: "Tarz file to embed in image must exist \n"
prereq_command: |
if (!(Test-Path "#{tar_file}")) {exit 1} else {
+1 -1
View File
@@ -83,7 +83,7 @@ if (!(Test-Path "#{passwords_file}")) {exit 1} else {
##### Get Prereq Commands:
```powershell
Write-Output "Generating random passwords and saving to file..."
$passwords = 1..10 | ForEach-Object { Get-Random -InputObject ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:,.<>?') -Count 12 }
$passwords = 1..10 | ForEach-Object { -join ((1..12) | ForEach-Object { @('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') + @('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') + @('0','1','2','3','4','5','6','7','8','9') + @('!','@','#','$','%','^','&','*','(','(',')','-','=','+','_','[',']','{','}','|',';',';',':',',','<','>','?') | Get-Random }) }
$passwords | Out-File -FilePath "#{passwords_file}"
```
##### Description: Tarz file to embed in image must exist
+1 -1
View File
@@ -54,7 +54,7 @@ atomic_tests:
}
get_prereq_command: |
Write-Output "Generating random passwords and saving to file..."
$passwords = 1..10 | ForEach-Object { Get-Random -InputObject ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:,.<>?') -Count 12 }
$passwords = 1..10 | ForEach-Object { -join ((1..12) | ForEach-Object { @('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z') + @('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') + @('0','1','2','3','4','5','6','7','8','9') + @('!','@','#','$','%','^','&','*','(','(',')','-','=','+','_','[',']','{','}','|',';',';',':',',','<','>','?') | Get-Random }) }
$passwords | Out-File -FilePath "#{passwords_file}"
- description: |
Tarz file to embed in image must exist