Initial commit of more scripts

This commit is contained in:
ackitsme committed 2026-07-24 17:49:02 -07:00
1 parent 141a001806
commit 6b9468d796
6 files changed
+602

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
$scriptVersion = "1.0.0"
$scriptDate = "2025-08-19"
# Display Script Banner
Write-Host "--------------------------------------------------" -ForegroundColor White
Write-Host "Windows IOC & Encryption Checker" -ForegroundColor Green
Write-Host "Version $($scriptVersion) ($($scriptDate))" -ForegroundColor Green
Write-Host "Written by Charlie Silverman" -ForegroundColor Green
Write-Host "--------------------------------------------------" -ForegroundColor White
Write-Host "Scanning for IOCs... " -NoNewLine
$fileList = @("crackmapexec", "kerbrute", "Anydesk", "IamBatMan", "stealer_cli_v2", "rclone", "nmap", "netscan", "mimikatz", "vmxojj", "zfewtu", "xigglo", "qfvtwz", "gkoou", "ofczqp", "videotomp3setup", "amd64.exe", "BaTrCk.exe", "232.bat", "tdsskiller.bat", "killdeff.bat", "logdel.bat", "bdfd47.lock", "processhacker.exe", "PCHunter64.exe", "win_locker.exe", "win_locker.ex_", "netscan.exe", "Syncovery.exe")
$searchDirectory = "C:\"
$files = Get-ChildItem -Path $searchDirectory -Recurse -Include $fileList | Select-Object FullName, LastWriteTime
if ($files.Count -gt 0) {
$files | Export-Csv -Path "C:\IOCScan.csv" -NoTypeInformation
Write-Host "$($files.Count) matching files found." -ForegroundColor Yellow -BackgroundColor Red
Write-Host "File list written to C:\IOCScan.csv"
} else {
Write-Host "No IOCs found." -ForegroundColor Green
}
$drives = Get-PsDrive | Where-Object {$_.Root -like "?:\" -and $_.Used -gt 0} | Select-Object Root
foreach ($drive in $drives) {
$dpath = $drive.Root
Write-Host "Scanning drive $dpath for encrypted files.... " -NoNewLine
$foundfiles = Get-ChildItem -Path $dpath -Recurse -Include "*akira*"
if ($foundfiles.Count -gt 0) {
$foundfiles | Export-Csv -Path "C:\EncryptedFiles-$($dpath[0]).csv"
Write-Host "Found $($foundfiles.Count) encrypted files." -backgroundcolor Red -ForegroundColor Yellow
Write-Host "Encrypted file list exported to C:\EncryptedFiles-$($dpath[0]).csv"
} else {
Write-Host "No encrypted files found" -ForegroundColor Green
}
}
+172
View File
@@ -0,0 +1,172 @@
<#
.SYNOPSIS
Intune Readiness Assessment Script
.DESCRIPTION
Collects the minimum required device information for an Intune deployment:
- Computer Name
- Serial Number
- Manufacturer
- Model
- Windows Edition
- Windows Build
- TPM Status
- Secure Boot Status
- Domain Join Status
- Entra ID Join Status
- Primary User
- BitLocker Status
- Installed Applications Count
- Antivirus Product
.NOTES
Run as Administrator for best results.
#>
# Stop running if script is not run as Administrator
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "ERROR: Script must be run as administrator" -ForegroundColor Yellow -BackgroundColor Red -NoNewLine
Write-Host
Write-Host "Operation aborted."
exit
}
# Get basic computer information
$ComputerSystem = Get-CimInstance Win32_ComputerSystem
$BIOS = Get-CimInstance Win32_BIOS
$OS = Get-CimInstance Win32_OperatingSystem
# Computer Name
$ComputerName = $env:COMPUTERNAME
# Serial Number
$SerialNumber = $BIOS.SerialNumber
# Manufacturer and Model
$Manufacturer = $ComputerSystem.Manufacturer
$Model = $ComputerSystem.Model
# Windows Information
$WindowsEdition = (Get-ComputerInfo).OsName
$WindowsBuild = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | Select-Object DisplayVersion).DisplayVersion
# TPM Information
try {
$TPM = Get-Tpm
if ($TPM.TpmPresent) {
$TPMStatus = "Present"
$TPMVersion = ($TPM.ManufacturerVersion)
}
else {
$TPMStatus = "Not Present"
$TPMVersion = "N/A"
}
}
catch {
$TPMStatus = "Unknown"
$TPMVersion = "Unknown"
}
# Secure Boot
try {
$SecureBoot = Confirm-SecureBootUEFI
}
catch {
$SecureBoot = "Unsupported/Legacy BIOS"
}
# Domain Join Status
$DomainJoined = $ComputerSystem.PartOfDomain
# Entra ID Join Status
$AzureADJoined = "Unknown"
try {
$DsReg = dsregcmd /status
if ($DsReg -match "AzureAdJoined\s*:\s*YES") {
$AzureADJoined = "Yes"
}
elseif ($DsReg -match "AzureAdJoined\s*:\s*NO") {
$AzureADJoined = "No"
}
}
catch {
$AzureADJoined = "Unable to Determine"
}
# Primary User
$PrimaryUser = (Get-CimInstance Win32_ComputerSystem).UserName
# BitLocker Status
try {
$BitLockerVolume = Get-BitLockerVolume -MountPoint "C:"
$BitLockerStatus = $BitLockerVolume.ProtectionStatus
switch ($BitLockerStatus) {
1 { $BitLockerStatus = "Protected" }
0 { $BitLockerStatus = "Not Protected" }
default { $BitLockerStatus = "Unknown" }
}
}
catch {
$BitLockerStatus = "Unknown"
}
# Installed Applications Count
try {
$AppCount = (
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* ,
HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* `
-ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName } |
Measure-Object
).Count
}
catch {
$AppCount = "Unknown"
}
# Antivirus Product
try {
$AV = Get-CimInstance `
-Namespace "root\SecurityCenter2" `
-ClassName AntiVirusProduct `
-ErrorAction Stop
$AntivirusProduct = ($AV.displayName -join "; ")
}
catch {
$AntivirusProduct = "Not Detected"
}
# Create Output Object
$Results = [PSCustomObject]@{
ComputerName = $ComputerName
SerialNumber = $SerialNumber
Manufacturer = $Manufacturer
Model = $Model
WindowsEdition = $WindowsEdition
WindowsBuild = $WindowsBuild
TPMStatus = $TPMStatus
TPMVersion = $TPMVersion
SecureBootEnabled = $SecureBoot
DomainJoined = $DomainJoined
AzureADJoined = $AzureADJoined
PrimaryUser = $PrimaryUser
BitLockerStatus = $BitLockerStatus
InstalledApps = $AppCount
AntivirusProduct = $AntivirusProduct
}
# Display Results
$Results | Format-List
# Export Results
$OutputFile = "$env:PUBLIC\Documents\Intune_Readiness_$ComputerName.csv"
$Results | Export-Csv -Path $OutputFile -NoTypeInformation
Write-Host ""
Write-Host "Assessment complete." -ForegroundColor Green
Write-Host "Results exported to: $OutputFile" -ForegroundColor Cyan
+161
View File
@@ -0,0 +1,161 @@
##
## KISGPOExport.ps1 - Export GPOs for an OU to file
##
## Created by Charlie Silverman - Keep IT Simple
##
## Version History:
## 1.1.0 - Added history
## 1.5.0 - Changed to put exported GPOs into a subfolder based on the OU name.
## 2.0.0 - Added functionality to process all parent OUs. Added help function.
param (
[switch]$Help = $false,
[switch]$Parents = $false
)
function prettyPrintOU($ou) {
$myparts = $ou.split("/")
$result = ""
for ($counter = $myparts.length - 1; $counter -gt 0; --$counter) {
$result += "OU=" + $myparts[$counter] + ","
}
$domainparts = $myparts[0].split(".")
for ($counter = 0; $counter -lt $domainparts.length; ++$counter) {
$result += "DC=" + $domainparts[$counter]
if ($counter -lt $domainparts.length - 1) { $result += "," }
}
return $result
}
$ScriptName = $MyInvocation.MyCommand.Path
$ScriptDate = Get-Item $ScriptName | select LastWriteTime
$ScriptDate = $ScriptDate.LastWriteTime
$ScriptVersion = "2.0.0"
Write-Host "`r`n"
Write-Host "--------------------------------------------------------------" -ForegroundColor Gray
Write-Host " KISGPOExport.ps1" -ForegroundColor Green -NoNewLine
Write-Host " - Group Policy Export Script" -ForegroundColor White
Write-Host " Version $ScriptVersion - $ScriptDate" -ForegroundColor White
Write-Host " Written by" -ForegroundColor White -NoNewLine
Write-Host " Charlie Silverman - Keep IT Simple" -ForegroundColor Green
Write-Host "--------------------------------------------------------------" -ForegroundColor Gray
if ($Help) {
Write-Host
Write-Host "Purpose: Export Group Policy Objects to HTML for a given OU."
Write-Host "Command Syntax:"
Write-Host " KISGPOExport.ps1 (-parents) (-help)`n" -foregroundcolor green
Write-Host "Command Line Options:"
Write-Host
Write-Host -NoNewLine " -parents " -foregroundcolor Green
Write-Host "- Export GPOs for all parent OUs as well."
Write-Host -NoNewLine " -help " -foregroundcolor Green
Write-Host "- Display command help."
}
$OUList = Get-ADOrganizationalUnit -Filter * -Properties CanonicalName | Select-Object CanonicalName | Sort-Object -Property CanonicalName
$prev = ""
$depth = 1
$domainname = $OUList[0].CanonicalName.split("/")[0]
$lastpos = 5
$toppos = 1
$selected = 0
$displaypage = 25
$datestamp = Get-Date -Format FileDate
#$bottompos = $toppos + 19
while ($selected -eq 0) {
Write-Host "`nSelect an OU to scan for linked GPOs:`n"
Write-Host "Domain: $domainname"
For ($x = $toppos-1; $x -lt $toppos + $displaypage - 1; $x++) {
if ($x -ge $OUList.length) { break }
$thisOU = $OUList[$x].CanonicalName
$OUParts = $thisOU.split("/");
$spacing = " |" * ($OUParts.length - 2)
$spacing = "$spacing |__"
if ($depth -lt $OUParts.length - 1) {
$spacing = " |" * ($OUParts.length - 2)
$spacing += " |__"
}
$position = ([string]($x+1)).PadLeft(3) + ":"
Write-Host $position -NoNewLine -ForegroundColor Yellow
Write-Host "$spacing $($OUParts[$OUParts.length - 1])"
# for ($y = 1; $y -lt $OUParts.length; $y++ {
$depth = $OUParts.length
}
$selected = Read-Host -Prompt 'Select line number or P for Previous page, N for next page, or Q to quit [N]'
switch($selected.toLower()) {
"n" {
if ($toppos + $displaypage -lt $OUList.length) {
$toppos += $displaypage
if ($toppos -gt $OUList.length) { $toppos = $OUList.length - 1 }
}
$selected = 0
}
"p" {
$toppos -= $displaypage
if ($toppos -lt 1) { $toppos = 1 }
$selected=0
}
"q" {
exit
}
}
try {
$selected = [int]$selected
} catch {
$selected = 0
}
}
$selectedOU = prettyPrintOU($OUList[$selected-1].CanonicalName)
While (([regex]::Matches($selectedOU, "," )).count -gt 1) {
Write-Host "`n`nProcessing GPOs in $selectedOU`n"
$myou = Get-ADOrganizationalunit $selectedOU
$CNParts = $selectedOU.split(",")
$folderpath = "";
for ($x = $CNParts.length - 1; $x -ge 0; --$x) {
$folderpath = "$folderpath\$($CNParts[$x])"
}
if (-not (Test-Path -Path "$pwd$folderpath")) {
$result = New-Item -ItemType Directory -Path "$pwd$folderpath"
}
$gpolist = $myou | Select-Object -ExpandProperty LinkedGroupPolicyObjects
$x = 1
if ($gpolist -is [string]) {
$gpoguid = $gpolist.split("}")[0].split("{")[1]
try {
$thisgpo = Get-GPO -Guid $gpoguid
Write-Host "Exporting GPO " -NoNewLine -ForegroundColor DarkGray
Write-Host $thisgpo.DisplayName -NoNewLine
Write-Host "..." -NoNewLine -ForegroundColor DarkGray
Get-GPOReport -Guid $gpoguid -ReportType 'HTML' -Path "$pwd\$domainname - $($thisgpo.DisplayName) - 20230530.html"
Write-Host " Complete" -ForegroundColor Green
} catch {
Write-Host "ERROR PROCESSING"
}
} else {
Write-Host "There are a total of $($gpolist.length) GPOs linked to $selectedOU"
for ($x = 0; $x -lt $gpolist.length; ++$x) {
$thisgpo = [string]$gpolist[$x]
$gpoguid = $thisgpo.split("}")[0].split("{")[1]
try {
$thisgpo = Get-GPO -Guid $gpoguid
Write-Host "Exporting GPO " -NoNewLine -ForegroundColor DarkGray
Write-Host $thisgpo.DisplayName -NoNewLine
Write-Host "..." -NoNewLine -ForegroundColor DarkGray
Get-GPOReport -Guid $gpoguid -ReportType 'HTML' -Path "$pwd$folderpath\$domainname - $($thisgpo.DisplayName) - $datestamp.html"
Write-Host " Complete" -ForegroundColor Green
} catch {
Write-Host "ERROR PROCESSING"
}
}
}
if ($Parents) {
$selectedOU = ($myou.distinguishedname -split ',', 2)[1]
} else {
$selectedOU = ""
}
}
Write-Host "`nOperation complete."
Write-Host "$x policies exported to HTML and stored in $pwd$folderpath"