-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathClear-Workstation.ps1
More file actions
28 lines (28 loc) · 1.36 KB
/
Clear-Workstation.ps1
File metadata and controls
28 lines (28 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$filesOrfolders = @("nuclei", "nuclei-templates", "sqlmap", "Mozilla", "Mozilla Firefox", "Notepad++", "ffuf", "Chromium", "BurpSuiteCommunity", "BurpSuite")
$baseFolders = @("$env:USERPROFILE", "$env:LOCALAPPDATA", "$env:APPDATA")
$foldersToClean = @("$env:TEMP", "$env:USERPROFILE\Downloads", "$env:USERPROFILE\Pictures", "$env:USERPROFILE\Documents")
foreach ($baseFolder in $baseFolders) {
foreach ($fileOrfolder in $filesOrfolders) {
$target = "$baseFolder\$fileOrfolder"
Write-Host "[>] Removing if exists file or folder '$target'..." -NoNewline
if (Test-Path "$target" -PathType Leaf) {
Remove-Item -Path "$target" -Force -ErrorAction SilentlyContinue
}
elseif (Test-Path "$target" -PathType Container) {
Remove-Item -Path "$target" -Force -Recurse -ErrorAction SilentlyContinue
}
if (Test-Path "$target") {
Write-Host "Failed!" -ForegroundColor Red
}
else {
Write-Host "Done." -ForegroundColor Green
}
}
}
foreach ($folderToClean in $foldersToClean) {
Write-Host "[>] Cleaning folder '$folderToClean'..." -NoNewline
Remove-Item -Path "$folderToClean\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Host "Done." -ForegroundColor Green
}
Write-Host "[>] Search any BurpSuite local CA installed in the Windows certificate store..."
Get-ChildItem Cert:\ -Recurse | Where-Object { $_.Issuer -like "*PortSwigger*" }