Compare commits

...

19 Commits
main ... Prep

Author SHA1 Message Date
d2e04b43df
Revert 2023-10-30 10:44:39 -05:00
e11c14d382
Revert "allows passing an input path as argument"
This reverts commit af712a22ab447be76d1b2a4bd32794a604017008.
2023-10-30 10:43:42 -05:00
3ebe8a46b7
enabled networking 2023-10-24 11:12:21 -05:00
Audrey Aaliyah Jensen
c0981619bb drop extracted files into the email file's dir 2023-09-08 11:08:13 -05:00
Audrey Aaliyah Jensen
8fb6c693ef error correct trailing slash for input path 2023-09-08 09:45:48 -05:00
Audrey Aaliyah Jensen
087566a737 output files to same input dir 2023-09-08 09:19:47 -05:00
Audrey Aaliyah Jensen
adf5512106 default to current dir 2023-09-08 08:39:27 -05:00
Audrey Aaliyah Jensen
af712a22ab allows passing an input path as argument 2023-09-07 09:01:49 -05:00
Audrey Aaliyah Jensen
47eb51e551 create browser-friendly copies of emails 2023-09-06 11:23:24 -05:00
Audrey Aaliyah Jensen
647bcdfe53 unzip files to desktop 2023-08-28 10:17:25 -05:00
Audrey Aaliyah Jensen
12f647835e only write passwords 2023-08-25 12:08:55 -05:00
Audrey Aaliyah Jensen
1665d6b748 ignore vscode 2023-08-25 12:08:28 -05:00
Audrey Aaliyah Jensen
19ddde9eb3 Don't log file copies 2023-08-25 11:33:25 -05:00
Audrey Aaliyah Jensen
217053000f write multiple passwords 2023-08-25 11:33:10 -05:00
Audrey Aaliyah Jensen
38c5b2f96b lists passwords to console 2023-08-25 11:17:39 -05:00
Audrey Aaliyah Jensen
239a792bf0 copies zips to desktop 2023-08-25 10:38:00 -05:00
Audrey Aaliyah Jensen
8f9b6a9c46 get zips without regex 2023-08-25 10:35:57 -05:00
Audrey Aaliyah Jensen
667acf6b0b Copy zips to desktop 2023-08-25 10:16:17 -05:00
Audrey Aaliyah Jensen
d0057378ee copy extract.py and find all zip files 2023-08-25 09:58:53 -05:00
5 changed files with 56 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
*.zip
*.eml
*.msg
*.mht
*.mht
.vscode

View File

@ -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\vlc.exe" /S
curl -L "https://update.code.visualstudio.com/latest/win32-x64-user/stable" --output C:\users\WDAGUtilityAccount\Downloads\vscode.exe

View File

@ -13,16 +13,27 @@ import os
import email
from email import policy
from multiprocessing import Pool
<<<<<<< HEAD
import sys
import re
EXTENSION = "eml"
OUTREGEX = ".*\\\\"
INREGEX = ".*\\\\$"
=======
EXTENSION = "eml"
>>>>>>> parent of af712a2 (allows passing an input path as argument)
def extract(filename):
"""
Try to extract the attachments from all files in cwd
"""
# 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)
output_count = 0
try:

View File

@ -0,0 +1,39 @@
# Regex the password from the zip's filename. Copy to var
# Open 7zip, extract to desktop, input password.
# take all *.eml and make .mht copies.
#Copy items to desktop
Copy-Item './extract.py' '..';
#Get-ChildItem | Where-Object { $_.name -match '\.zip'} | ForEach-Object {Copy-Item -Path $_.name -Destination '..' }
#Capture zip password from filename
$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);
}
#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;

View File

@ -9,7 +9,7 @@
<Command>"C:\Users\WDAGUtilityAccount\Desktop\Sandbox Scripts\InstallSoftware.cmd"</Command>
</LogonCommand>
<vGPU>Disable</vGPU>
<Networking>Disable</Networking>
<Networking>Enable</Networking>
<AudioInput>Disable</AudioInput>
<VideoInput>Disable</VideoInput>
<ProtectedClient>Enable</ProtectedClient>