Compare commits
10 Commits
12f647835e
...
d2e04b43df
| Author | SHA1 | Date | |
|---|---|---|---|
| d2e04b43df | |||
| e11c14d382 | |||
| 3ebe8a46b7 | |||
|
|
c0981619bb | ||
|
|
8fb6c693ef | ||
|
|
087566a737 | ||
|
|
adf5512106 | ||
|
|
af712a22ab | ||
|
|
47eb51e551 | ||
|
|
647bcdfe53 |
@ -1,4 +1,5 @@
|
|||||||
"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\7zip.exe" /S
|
powershell -command 'Set-ExecutionPolicy Unrestricted'
|
||||||
|
powershell -command 'Unblock-File -Path "C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\prepare.ps1"'
|
||||||
"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\python3.exe" /S
|
"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\python3.exe" /S
|
||||||
"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\vlc.exe" /S
|
"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\vlc.exe" /S
|
||||||
curl -L "https://update.code.visualstudio.com/latest/win32-x64-user/stable" --output C:\users\WDAGUtilityAccount\Downloads\vscode.exe
|
curl -L "https://update.code.visualstudio.com/latest/win32-x64-user/stable" --output C:\users\WDAGUtilityAccount\Downloads\vscode.exe
|
||||||
|
|||||||
@ -13,16 +13,27 @@ import os
|
|||||||
import email
|
import email
|
||||||
from email import policy
|
from email import policy
|
||||||
from multiprocessing import Pool
|
from multiprocessing import Pool
|
||||||
|
<<<<<<< HEAD
|
||||||
|
import sys
|
||||||
|
import re
|
||||||
|
|
||||||
|
EXTENSION = "eml"
|
||||||
|
OUTREGEX = ".*\\\\"
|
||||||
|
INREGEX = ".*\\\\$"
|
||||||
|
=======
|
||||||
|
|
||||||
EXTENSION = "eml"
|
EXTENSION = "eml"
|
||||||
|
|
||||||
|
>>>>>>> parent of af712a2 (allows passing an input path as argument)
|
||||||
|
|
||||||
def extract(filename):
|
def extract(filename):
|
||||||
"""
|
"""
|
||||||
Try to extract the attachments from all files in cwd
|
Try to extract the attachments from all files in cwd
|
||||||
"""
|
"""
|
||||||
# ensure that an output dir exists
|
# ensure that an output dir exists
|
||||||
od = "output"
|
filepath = re.findall(OUTREGEX, filename)
|
||||||
|
od = (filepath[0] or "") + "/"
|
||||||
|
|
||||||
os.path.exists(od) or os.makedirs(od)
|
os.path.exists(od) or os.makedirs(od)
|
||||||
output_count = 0
|
output_count = 0
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -4,13 +4,36 @@
|
|||||||
|
|
||||||
#Copy items to desktop
|
#Copy items to desktop
|
||||||
Copy-Item './extract.py' '..';
|
Copy-Item './extract.py' '..';
|
||||||
Get-ChildItem | Where-Object { $_.name -match '\.zip'} | ForEach-Object {Copy-Item -Path $_.name -Destination '..' }
|
#Get-ChildItem | Where-Object { $_.name -match '\.zip'} | ForEach-Object {Copy-Item -Path $_.name -Destination '..' }
|
||||||
|
|
||||||
#Capture zip password from filename
|
#Capture zip password from filename
|
||||||
$pwPattern = [regex] "[A-z 0-9 \-]{1,251}\((?<PW>[A-z0-9]{1,251})\)\.zip";
|
$pwPattern = [regex] "[A-z 0-9 \-]{1,251}\((?<PW>[A-z0-9]{1,251})\)\.zip";
|
||||||
|
$files = @{};
|
||||||
|
Get-ChildItem './Sandbox Scripts'| Where-Object { $_.name -match '\.zip'} | ForEach-Object {
|
||||||
|
$pass = [Regex]::Matches($_, $pwPattern);
|
||||||
|
$files.Add($_.name, $pass.groups[1].Value);
|
||||||
|
}
|
||||||
|
|
||||||
$files = Get-ChildItem;
|
|
||||||
$passwords = [Regex]::Matches($files, $pwPattern);
|
|
||||||
$passwords.groups | Where-Object {$_.Name -match "PW"} | ForEach-Object {Write-Output $_.Value }
|
|
||||||
|
|
||||||
|
#Install 7Zip and extract the zip files to the desktop.
|
||||||
|
Write-Output "Installing Programs...";
|
||||||
|
Start-Process "C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\7zip.exe" -NoNewWindow -Wait -ArgumentList /S;
|
||||||
|
$sevenZip = "C:\Program Files\7-Zip\7z.exe";
|
||||||
|
$outputs = @(); #Keep a record of where our new files are
|
||||||
|
foreach ($file in $files.GetEnumerator()){
|
||||||
|
Write-Output "Extracting $($file.Name)";
|
||||||
|
$archivePath = "C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\$($file.Name)"
|
||||||
|
$outputPath = "C:\Users\WDAGUtilityAccount\Desktop\$($file.Name)";
|
||||||
|
$password = $($file.Value);
|
||||||
|
$arguments = "$($archivePath)", "-o$($outputPath)", "-p$($password)";
|
||||||
|
&$sevenZip e $arguments; #Extract zip
|
||||||
|
$outputs += $outputPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Process the extracted email files
|
||||||
|
foreach( $dir in $outputs.GetEnumerator()){
|
||||||
|
Get-ChildItem "$($dir)\" | Where-Object { $_.name -match '\.eml'} | ForEach-Object{
|
||||||
|
Copy-Item "$($dir)/$($_.name)" "$($dir)/$($_.name).mht"
|
||||||
|
}
|
||||||
|
}
|
||||||
Write-Output Done;
|
Write-Output Done;
|
||||||
@ -9,7 +9,7 @@
|
|||||||
<Command>"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\InstallSoftware.cmd"</Command>
|
<Command>"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\InstallSoftware.cmd"</Command>
|
||||||
</LogonCommand>
|
</LogonCommand>
|
||||||
<vGPU>Disable</vGPU>
|
<vGPU>Disable</vGPU>
|
||||||
<Networking>Disable</Networking>
|
<Networking>Enable</Networking>
|
||||||
<AudioInput>Disable</AudioInput>
|
<AudioInput>Disable</AudioInput>
|
||||||
<VideoInput>Disable</VideoInput>
|
<VideoInput>Disable</VideoInput>
|
||||||
<ProtectedClient>Enable</ProtectedClient>
|
<ProtectedClient>Enable</ProtectedClient>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user