full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/LevonBecker_VmwareTools/ParentScripts/Get-VMInfo_1.0.0.ps1
Get-VMInfo_1.0.0.ps1
#requires –version 2.0 Function Get-VMInfo { #region Help <# .SYNOPSIS Automation Script. .DESCRIPTION Script for automating a process. .NOTES VERSION: 2.5.5 AUTHOR: Levon Becker EMAIL: PowerShell.Guru@BonusBits.com ENV: Powershell v2.0, CLR 4.0+ TOOLS: PowerGUI Script...
PowerShellCorpus/Github/LevonBecker_VmwareTools/ParentScripts/Get-VMTCommand_1.0.2.ps1
Get-VMTCommand_1.0.2.ps1
#requires –version 2.0 Function Get-VMTCommand { #region Help <# .SYNOPSIS WindowsPatching Module Help Script. .DESCRIPTION Script to list WindowsPatching Module commands. .NOTES VERSION: 1.0.2 AUTHOR: Levon Becker EMAIL: PowerShell.Guru@BonusBits.com ENV: Powershell v2.0, CL...
PowerShellCorpus/Github/LevonBecker_VmwareTools/ParentScripts/Set-VmwareToolsDefaults_1.0.5.ps1
Set-VmwareToolsDefaults_1.0.5.ps1
#requires –version 2.0 Function Set-VmwareToolsDefaults { #region Help <# .SYNOPSIS Sets a global variable with a default vCenter Hostname. .DESCRIPTION This is used with several of the Windows Patching scripts to reduce parameter typing and keep the scripts universal. .NOTES AUTHOR: Levon Becker S...
PowerShellCorpus/Github/LevonBecker_VmwareTools/ParentScripts/Update-VM_1.0.0.ps1
Update-VM_1.0.0.ps1
#requires –version 2.0 Function Update-VM { #region Help <# .SYNOPSIS Install approved Windows patches from a WSUS server and check/upgrade Vmware Tools/Hardware if needed. .DESCRIPTION This Powershell script can be used to install Windows patches distributed from a WSUS server. Plus upgrade Vmware ...
PowerShellCorpus/Github/LevonBecker_VmwareTools/2DO/Copy-ResourcePools_1.0.4.ps1
Copy-ResourcePools_1.0.4.ps1
#requires –version 2.0 #region Help <# .SYNOPSIS Copy Resource Pools from one VI environment and create on another. .DESCRIPTION Script to make a copy of Resource Pools from one Vmware Infrustructure to another. .INPUTS Items to take action on. .OUTPUTS Log Files. .NOTES TITLE: Copy Resource ...
PowerShellCorpus/Github/LevonBecker_VmwareTools/2DO/Get-WWN_1.0.1.ps1
Get-WWN_1.0.1.ps1
#requires –version 2.0 #region Help <# .SYNOPSIS Get a List of WWN for a single or multiple vmware hosts. .DESCRIPTION Get a List of WWN for a single or multiple vmware hosts. .EXAMPLE .\Get-WWN.ps1 .PARAMETER filepath Root Path to backup. .PARAMETER scriptbackuppath Where to write the script back...
PowerShellCorpus/Github/LevonBecker_VmwareTools/2DO/Set-ESXSyslog_1.0.1.ps1
Set-ESXSyslog_1.0.1.ps1
#requires –version 2.0 #region Help <# .SYNOPSIS Automation Script. .DESCRIPTION Script for automating a process. .INPUTS Items to take action on. .OUTPUTS Log Files. .NOTES TITLE: Change Syslog IP and Port on ESX Host VERSION: 1.0.0 DATE: 10/01/2011 STATE: Alpha AUTHOR: ...
PowerShellCorpus/Github/jfigg_Powershell/HelloWorld.ps1
HelloWorld.ps1
write-host "Hello World! 5"
PowerShellCorpus/Github/jfigg_Powershell/CurrentUpdates.ps1
CurrentUpdates.ps1
$updates = @() $server = "localhost" write-host -fore DarkGreen "Checking $server" Try { $osname = (Get-WmiObject -computername "$server" Win32_OperatingSystem).Name $osname = $osname.Substring(0, $osname.IndexOf('|')) $current = (get-hotfix -ComputerName "$server" -ErrorA...
PowerShellCorpus/Github/jfigg_Powershell/PostMDT sudo code.ps1
PostMDT sudo code.ps1
$success = 0 $installdf = 1 $checkthawstate = 2 $windowscleanup = 3 $finalizehost = 4 $createvolumes = 5 $rebootfrozen = 6 while ($true) { write-host "read reg key to $regkey" switch ($regkey) { $success { writ-host "exit" } $installdf { write-host "check df inst...
PowerShellCorpus/Github/jfigg_Powershell/write-logfunction.ps1
write-logfunction.ps1
$script:loglocation = "C:\Windows\CCM\Logs\PostDeploy.log" function write-log { param ($message) #Write to the screen the state write-host $message #Store date $date = get-date -format G #Format message $message = "{0}{1}: {2}" -f ('-' * 30),$date,$message.ToUpper() $message = $...
PowerShellCorpus/Github/jfigg_Powershell/TEMP.TempPoint.ps1
TEMP.TempPoint.ps1
$loglocation = "%SystemRoot%\CCM\Logs" Out-File $loglocation\Success.txt
PowerShellCorpus/Github/jfigg_Powershell/PostMDT Powershell.ps1
PostMDT Powershell.ps1
$script:loglocation = "C:\users\nhti\desktop\test.log" function write-log { param ($message) #Write to the screen the state write-host $message #Store date $date = get-date -format G #Format message $message = "{0}{1}: {2}" -f ('-' * 30), $date, $message.ToUpper() $message = $message.PadRight(100, '-'...
PowerShellCorpus/Github/jfigg_Powershell/Windows10Cleanup_DiagTrack.ps1
Windows10Cleanup_DiagTrack.ps1
#Remove Windows 10 Apps #Use Get-AppxPackage to find other package names (you only need the short name as wildcards are used) #Array that stores all windows apps to be removed $AppsToBeRemoved = @("3dbuilder","windowscommunicationsapps","windowscamera","officehub","skypeapp","getstarted","zune","windowsmap","solit...
PowerShellCorpus/Github/jfigg_Powershell/FindServerUpdates.ps1
FindServerUpdates.ps1
$pathCSV = "C:\Users\jfigg\Documents\admin.csv" $serverList= Get-Content $pathCSV -ErrorAction Stop $onlineServers = [System.Collections.ArrayList]@() $updates = @() foreach($server in $serverList) { write-host -fore DarkGreen "Pinging $server" #ping code if (Test-Connection -Computer...
PowerShellCorpus/Github/jfigg_Powershell/PostMDT Powershell.TempPoint.ps1
PostMDT Powershell.TempPoint.ps1
$success = 0 $installdf = 1 $checkthawstate = 2 $windowscleanup = 3 $finalizehost = 4 $createvolumes = 5 $rebootfrozen = 6 $textfilelocation = "C:\Users\NHTI\Desktop" while ($true) { $currentregvalue = Get-ItemPropertyValue "HKLM:\SOFTWARE\NHTI" "PostDeployInProgress" switch ($currentregvalue) ...
PowerShellCorpus/Github/jfigg_Powershell/TEMP.ps1
TEMP.ps1
$script:drivename = (Get-PSDrive $env:SystemDrive.Substring(0, 1)).description $drivename
PowerShellCorpus/Github/jfigg_Powershell/xmlread.ps1
xmlread.ps1
[xml]$XmlDocument = Get-Content -Path C:\users\nhti\desktop\test.xml #$XmlDocument | select ChildNodes | % { write-host $_.applications } #$XmlDocument.postdeploydata.regkeys.delete | % { write-host $_ } $XmlDocument.postdeploydata.regkeys.delete | % { reg delete "$_" }
PowerShellCorpus/Github/jfigg_Powershell/PostMDT Structure Code.ps1
PostMDT Structure Code.ps1
$success = 0 $installdf = 1 $checkthawstate = 2 $windowscleanup = 3 $finalizehost = 4 $createvolumes = 5 $rebootfrozen = 6 $textfilelocation = "C:\Users\NHTI\Desktop" while ($true) { $currentregvalue = Get-ItemPropertyValue "HKLM:\SOFTWARE\NHTI" "PostDeployInProgress" switch ($currentregvalue) ...
PowerShellCorpus/Github/jfigg_Powershell/FindServerDNSServer.ps1
FindServerDNSServer.ps1
$pathCSV = "C:\Users\jfigg.NHTI\Documents\admin.csv" $serverList= Get-Content $pathCSV -ErrorAction Stop $onlineServers = [System.Collections.ArrayList]@() $ServersExport = @("Server Name") $DNSExport = @("Primary DNS Server") $exportlist = @() $updates = @() foreach($server in $serverList) {...
PowerShellCorpus/Github/jfigg_Powershell/Complete.ps1
Complete.ps1
$MDTDriveLetter = 'K' $LocalWimStore = 'D:\ITMDT\' $WimShareLocation = 'Operating Systems\GenLab\' $WimName = 'install.wim' $SharePass="Readonly2014"| ConvertTo-SecureString -AsPlainText -Force $ShareCred = New-Object System.Management.Automation.PsCredential('MDT',$SharePass) $WimMount = 'C:\Offline\' $VHDLocat...
PowerShellCorpus/Github/CyberSecDef_CSTS/scans2poam.ps1
scans2poam.ps1
<# .SYNOPSIS This is a script will parse scan results and generate an excel POAM .DESCRIPTION This is a script will parse scan results and generate an excel POAM. It can accept StigViewer Checklists, ACAS .Nessus files and SCAP XCCDF files .PARAMETER scanLocation The path to the scan results .PARAMETER recur...
PowerShellCorpus/Github/CyberSecDef_CSTS/console.ps1
console.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/fixDotNet.ps1
fixDotNet.ps1
<# .SYNOPSIS This is a script will attempt to fix issues with dot net and certificate issues which prevent windows udpate from installing updates. .DESCRIPTION This is a script will attempt to fix issues with dot net and certificate issues which prevent windows udpate from installing updates. .PARAMETER host...
PowerShellCorpus/Github/CyberSecDef_CSTS/userCount.ps1
userCount.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to t...
PowerShellCorpus/Github/CyberSecDef_CSTS/parseEventlogs.ps1
parseEventlogs.ps1
<# .SYNOPSIS This is a script that will parse through archived event logs, looking for important alerts .DESCRIPTION This is a script that will parse through archived event logs, looking for important alerts .PARAMETER computer The computer to pull the archive from .PARAMETER archiveLocation The location th...
PowerShellCorpus/Github/CyberSecDef_CSTS/updateStig.ps1
updateStig.ps1
<# .SYNOPSIS This script copies all user input data from one STIG file to another. .DESCRIPTION This Script is designed to make updating to a new STIG Checklist version faster and easier. It will move the asset data and all comments, finding details, status, severity override and justifications from...
PowerShellCorpus/Github/CyberSecDef_CSTS/preventSleep.ps1
preventSleep.ps1
<# .SYNOPSIS This is a script will attempt to change the power scheme on a remote computer and prevent sleep. .DESCRIPTION This is a script will attempt to change the power scheme on a remote computer and prevent sleep. It can accept a single or multiple hosts via AD calls, CSV files and command line parameters ...
PowerShellCorpus/Github/CyberSecDef_CSTS/systemManager.ps1
systemManager.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/iavmStatus.ps1
iavmStatus.ps1
<# .SYNOPSIS This is a script that will scan computers and determine the status of an IAVM (KB HotFix) .DESCRIPTION This is a script that will scan computers and determine the status of an IAVM (KB HotFix). It can accept a single or multiple hosts via AD calls, CSV files and command line parameters .PARAMETER h...
PowerShellCorpus/Github/CyberSecDef_CSTS/imagePatcher.ps1
imagePatcher.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/setWallpaper.ps1
setWallpaper.ps1
<# .SYNOPSIS [ALPHA LEVEL SCRIPT!] This is a script that will set the users wallpaper to be a data dump of pertinent host information. .DESCRIPTION [ALPHA LEVEL SCRIPT!] This is a script that will set the users wallpaper to be a data dump of pertinent host information like hostname, disk usage and logon times. ....
PowerShellCorpus/Github/CyberSecDef_CSTS/applyPolicies.ps1
applyPolicies.ps1
########################################################## # Powershell Documentation ########################################################## # .SYNOPSIS # This is a script that will attempt to apply machine and user policies without the user logging on # .DESCRIPTION # This is a script that will attempt t...
PowerShellCorpus/Github/CyberSecDef_CSTS/server.ps1
server.ps1
. "$pwd\conf\webConfig.ps1" clear $error.clear() . .\lib\PSClass.ps1 (gci .\lib) | % { . "$($_.FullName)" } $ServerClass = New-PSClass Server{ note -private Listener constructor{ param($port = "") if($port -ne "" -and $port -ne $null){ $config.port = $port } } method Start{ $this.St...
PowerShellCorpus/Github/CyberSecDef_CSTS/fileVerification.ps1
fileVerification.ps1
<# .SYNOPSIS This script will generate hashes for submitted folder paths to determine if the files have changed. .DESCRIPTION This script will generate hashes for submitted folder paths to determine if the files have changed. .PARAMETER CheckFolder Folder which needs to be scanned for file changes .PARAMET...
PowerShellCorpus/Github/CyberSecDef_CSTS/vram2acasVulnerabilities.ps1
vram2acasVulnerabilities.ps1
<# .SYNOPSIS This is a script that will generate a report showing which hosts have open IAVMs per VRAM .DESCRIPTION This is a script that will generate a report showing which hosts have open IAVMs per VRAM .PARAMETER acasFilePath The path to a CSV export from ACAS of all open findings for the department .PARA...
PowerShellCorpus/Github/CyberSecDef_CSTS/mergeNessus.ps1
mergeNessus.ps1
<# .SYNOPSIS This is a script will merge multiple nessus scan files into one for upload into vram .DESCRIPTION This is a script will merge multiple nessus scan files into one for upload into vram .PARAMETER scanPath The path to a folder containing all the scan results .PARAMETER targetSize The target size f...
PowerShellCorpus/Github/CyberSecDef_CSTS/portScan.ps1
portScan.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/vram2AcasScanPolicy.ps1
vram2AcasScanPolicy.ps1
<# .SYNOPSIS This script will create an ACAS Scan Policy for the audits that VRAM needs input from .DESCRIPTION This script will create an ACAS Scan Policy for the audits that VRAM needs input from .PARAMETER auditPath The path to the VRAM Audits (csv format) .EXAMPLE C:\PS>.\vram2AcasScanPolicy.ps1 -auditP...
PowerShellCorpus/Github/CyberSecDef_CSTS/manageLocalAdmins.ps1
manageLocalAdmins.ps1
<# .SYNOPSIS This is a script that will manage the local admins on a machine .DESCRIPTION This is a script that will manage the local admins on a machine .PARAMETER hostCsvPath The path the a CSV File containing hosts .PARAMETER computers A comma separated list of hostnames .PARAMETER OU An Organizationa...
PowerShellCorpus/Github/CyberSecDef_CSTS/hwSwLists.ps1
hwSwLists.ps1
########################################################## # Powershell Documentation ########################################################## # .SYNOPSIS # This is a script that will pull the hardware and software lists for a list of computers # .DESCRIPTION # This is a script that will pull the hardware...
PowerShellCorpus/Github/CyberSecDef_CSTS/findDormantAccounts.ps1
findDormantAccounts.ps1
<# .SYNOPSIS This script will search for and display accounts that have not been logged in for a selected number of days. .DESCRIPTION This script will search for and display accounts that have not been logged in for a selected number of days. This script searches for both local and active directory accounts...
PowerShellCorpus/Github/CyberSecDef_CSTS/cleanScapFolder.ps1
cleanScapFolder.ps1
########################################################## # Powershell Documentation ########################################################## # .SYNOPSIS # This is a script that will clean up dead entries in a scap results folder # .DESCRIPTION # This is a script that will clean up dead entries in a scap r...
PowerShellCorpus/Github/CyberSecDef_CSTS/acheievement.ps1
acheievement.ps1
[CmdletBinding()] param ( $text = "Test Accomplishment Goes Here", $out = "achievement_$((get-date).ToString('yyyyMMddHHmmss')).png", $font = 14 ) Begin{ try{ Add-Type -AssemblyName System.Drawing $bmp = new-object System.Drawing.Bitmap "$pwd\images\achievement.png" $headerFont = new-object Sys...
PowerShellCorpus/Github/CyberSecDef_CSTS/wakeOnLan.ps1
wakeOnLan.ps1
<# .SYNOPSIS This is a script will attempt to wake up computers via network calls .DESCRIPTION This is a script will attempt to wake up computers via network calls. It can accept a single or multiple hosts via AD calls, CSV files and command line parameters .PARAMETER hostCsvPath The path the a CSV File con...
PowerShellCorpus/Github/CyberSecDef_CSTS/cleanUsbHistory.ps1
cleanUsbHistory.ps1
<# .SYNOPSIS This script will clean up the history of usb devices connected to a selected machine .DESCRIPTION This script will clean up the history of usb devices connected to a selected machine .PARAMETER hostCsvPath The path the a CSV File containing hosts .PARAMETER computers A comma separated list of...
PowerShellCorpus/Github/CyberSecDef_CSTS/packageManager.ps1
packageManager.ps1
<# .SYNOPSIS [Incomplete script!] This script helps manage DIACAP Package Evidence Submission. .DESCRIPTION [Incomplete script!] This script helps manage DIACAP Package Evidence Submission. .EXAMPLE C:\PS>.\packageManager.ps1 This will bring up the packageManager manager console. .INPUTS There are no inpu...
PowerShellCorpus/Github/CyberSecDef_CSTS/setup.ps1
setup.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/genHelp.ps1
genHelp.ps1
<# .SYNOPSIS This script generates a document with the help information for all the scripts in the suite. .DESCRIPTION This script generates a document with the help information for all the scripts in the suite. .EXAMPLE C:\PS>.\genHelp.ps1 This will create a readme.txt file in the docs folder of the suite ...
PowerShellCorpus/Github/CyberSecDef_CSTS/pixelData.ps1
pixelData.ps1
<# .SYNOPSIS This script returns the pixel color information for a pixel under the mouse cursor. .DESCRIPTION This script returns the pixel color information for a pixel under the mouse cursor. .EXAMPLE .\pixelData.ps1 This starts the pixel data tool .INPUTS There are no inputs that can be directed to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/software2stig.ps1
software2stig.ps1
<# .SYNOPSIS This is a script that will scan computers and determine which STIGs need to be executed .DESCRIPTION This is a script that will scan computers and determine which STIGs need to be executed. It can accept a single or multiple hosts via AD calls, CSV files and command line parameters .PARAMETER hostC...
PowerShellCorpus/Github/CyberSecDef_CSTS/template.ps1
template.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/archiveEventlogs.ps1
archiveEventlogs.ps1
########################################################## # Powershell Documentation ########################################################## # .SYNOPSIS # This is a script that will archive the event logs from remote computers to a local directory # .DESCRIPTION # This is a script that will archive the even...
PowerShellCorpus/Github/CyberSecDef_CSTS/stigWindows.ps1
stigWindows.ps1
<# .SYNOPSIS This is a script that will apply the Non-GPO settings to STIG the asset. .DESCRIPTION This is a script that will apply the Non-GPO settings to STIG the asset. It can accept a single or multiple hosts via AD calls, CSV files and command line parameters .PARAMETER hostCsvPath The path the a CSV Fi...
PowerShellCorpus/Github/CyberSecDef_CSTS/wsusOffline.ps1
wsusOffline.ps1
<# .SYNOPSIS This script will create DVD ISOs with all windows update patches installed. .DESCRIPTION This script will create DVD ISOs with all windows update patches installed. .PARAMETER reDownload If present, patches will be redownloaded even if they have been previously downloaded .PARAMETER threads T...
PowerShellCorpus/Github/CyberSecDef_CSTS/mineSweeper.ps1
mineSweeper.ps1
<# .SYNOPSIS This is a mine sweeper app .DESCRIPTION This is a mine sweeper app .PARAMETER side The number of cells per side, defaults to 16 .PARAMETER mines The number of mines to find, defaults to 40 .PARAMETER easy Sets the game to be an 8x8 grid, with 10 mines to find .PARAMETER mediuam Sets the g...
PowerShellCorpus/Github/CyberSecDef_CSTS/scap2report.ps1
scap2report.ps1
<# .SYNOPSIS This is a script that will generate a report based on the current SCAP Scans .DESCRIPTION This is a script that will generate a report based on the current SCAP Scans .EXAMPLE C:\PS>.\scap2report.ps1 -acasFilePath "C:\scans\acasHosts.csv" -vramFilePath "C:\scans\vramAudits.csv" -hostMapFilePath "C...
PowerShellCorpus/Github/CyberSecDef_CSTS/missingScans.ps1
missingScans.ps1
<# .SYNOPSIS This is a script that will generate a report showing which hosts have open IAVMs per VRAM .DESCRIPTION This is a script that will generate a report showing which hosts have open IAVMs per VRAM .PARAMETER acasFilePath The path to a CSV export from ACAS of all open findings for the department .PARA...
PowerShellCorpus/Github/CyberSecDef_CSTS/stig2gpo.ps1
stig2gpo.ps1
<# .SYNOPSIS This is a script will parse either a STIG or SCAP Results and generate a GPO .DESCRIPTION This is a script will parse either a STIG or SCAP Results and generate a GPO. It can accept either STIG or SCAP XCCDF/OVAL files .PARAMETER profile which profile, if any, should be selected from the STIG .P...
PowerShellCorpus/Github/CyberSecDef_CSTS/secureWipe.ps1
secureWipe.ps1
<# .SYNOPSIS This script will securely wipe a user selected hard drive. .DESCRIPTION This script will securely wipe a user selected hard drive. It does this by creating a random, temporary file that fills up all the free space on the partition. .EXAMPLE C:\PS>.\wipe -targetPartition "c:\" -wipeType Random T...
PowerShellCorpus/Github/CyberSecDef_CSTS/updateHosts.ps1
updateHosts.ps1
<# .SYNOPSIS This is a script that will execute updates on a list of hosts .DESCRIPTION This is a script that will execute updates on a list of hosts .PARAMETER hostCsvPath The path the a CSV File containing hosts .PARAMETER computers A comma separated list of hostnames .PARAMETER OU An Organizational U...
PowerShellCorpus/Github/CyberSecDef_CSTS/restartSystem.ps1
restartSystem.ps1
<# .SYNOPSIS This is a script will attempt to restart systems at a designated time .DESCRIPTION This is a script will attempt to restart systems at a designated time .PARAMETER hostCsvPath The path the a CSV File containing hosts .PARAMETER computers A comma separated list of hostnames .PARAMETER OU An O...
PowerShellCorpus/Github/CyberSecDef_CSTS/serviceQuotes.ps1
serviceQuotes.ps1
<# .SYNOPSIS This is a script that will analyze a list of hosts and ensure all services with spaces are properly quoted .DESCRIPTION This is a script that will analyze a list of hosts and ensure all services with spaces are properly quoted .PARAMETER hosts A comma separated list of hosts specified in the CA Pl...
PowerShellCorpus/Github/CyberSecDef_CSTS/processManager.ps1
processManager.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/policyManager.ps1
policyManager.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/scan4wifiBluetooth.ps1
scan4wifiBluetooth.ps1
<# .SYNOPSIS This is a script will scan for systems that have active bluetooth or wifi adapters .DESCRIPTION This is a script will scan for systems that have active bluetooth or wifi adapters .PARAMETER hostCsvPath The path the a CSV File containing hosts .PARAMETER computers A comma separated list of hostn...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/ckl.ps1
ckl.ps1
method -private showCkl{ $i = 0 $webVars = @{} $tmp = $( $private.xml.cstsPackage.scans.ckls.scan | sort { $_.title } | % { $i = $i + 1; @" <tr> <td><input type="checkbox" class="asset_checkbox" id="ckl_$($_.id)" /></td> <td>$($i)</td> <td>$($_.title)</td> <td>$( if( $_.version -ne '' -and $_.rele...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/requirements.ps1
requirements.ps1
method -private showRequirements{ $webVars = @{} $private.showWait(); $i = 0 $webVars['reqSummaryTab'] = $( "<tr><td><input type='checkbox'/></td><td>ACAS</td><td>Credentialed ACAS Scan</td><td>NA</td><td>NA</td><td>" $private.xml.selectNodes("//cstsPackage/assets/asset[@id=//cstsPackage/requirements...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/findings.ps1
findings.ps1
method -private showFindings{ $webVars = @{} $private.showWait(); $webVars['pwd'] = $pwd $webVars['package'] = $private.package.toUpper() $webVars['acasFindings'] = $private.findings.selectNodes("//cstsPackage/findings/acas/finding[rawRisk!='None']") | sort { $_.rawRisk, $_.riskStatement } $webVars['...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/hardware.ps1
hardware.ps1
method -private showHardware{ $private.loadDb() $private.showWait(); $i = 0 $webVars = @{} $tmp = $( $private.xml.cstsPackage.assets.asset | sort { $_.hostName } | % { $i= $i + 1; @" <tr> <td><input type="checkbox" class="asset_checkbox" id="host_$($_.id)" /></td> <td> <a href="#" on...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/mainForm.ps1
mainForm.ps1
method -private onClick_mnuFileClose{ write-host "the File Close Button was clicked" $private.gui.Form.close() } method -private onClick_mnuFileOpen{ write-host "the File Open Button was clicked" } method -private OnClick_openToolStripMenuItem{ write-host "in here" } method -private handleClickEven...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/acas.ps1
acas.ps1
method -private showACAS{ $i = 0 $webVars = @{} $tmp = $( $private.xml.cstsPackage.scans.acas.scan | sort { $_.fileName } | % { $i = $i + 1; @" <tr> <td><input type="checkbox" class="asset_checkbox" id="acas_$($_.id)" /></td> <td>$($i)</td> <td>$($_.fileName)</td> <td>$($_.policyName)</td> <td>$...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/scans.ps1
scans.ps1
method -private showScans{ $private.showWait() $i = 0 $webVars = @{} $webVars['acasOldScan30'] = $( $private.xml.cstsPackage.scans.acas.scan | ? { (new-timespan -start ([datetime]"$($_.scanDate)") -end (get-date) | select -expand days) -ge 30 -and (new-timespan -start ([datetime]"$($_.scanDate)") -end (ge...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/software.ps1
software.ps1
method -private showSoftware{ $webVars = @{} $i = 0 $private.showWait(); $applications = $private.xml.selectNodes("//cstsPackage/applications/application") | sort { $_.name } $tmp = "" foreach($app in $applications){ $i = $i + 1; $tmp += @" <tr> <td><input type="checkbox" class="asset_check...
PowerShellCorpus/Github/CyberSecDef_CSTS/modules/packageManager/scap.ps1
scap.ps1
method -private showScap{ $i = 0 $webVars = @{} $tmp = $( $private.xml.cstsPackage.scans.scap.scan | sort { $_.benchmark } | % { $i = $i + 1; @" <tr> <td><input type="checkbox" class="asset_checkbox" id="scap_$($_.id)" /></td> <td>$($i)</td> <td>$($_.benchmark)</td> <td>V$($_.version)R$($_.relea...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/log.ps1
log.ps1
$loggerClass = New-PSClass Logger{ method -static Log{ param($Request) $LogDate = Get-Date -format yyyy-MM-dd $LogTime = Get-Date -format HH:mm:ss $LogSiteName = $config.HostName if ($LogSiteName -eq "+") { $LogSiteName = "localhost" } $LogComputerName = Get-Content env:computername $L...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/request.ps1
request.ps1
$RequestClass = New-PSClass Request{ note -private Request note -private InputStream note -private ContentEncoding note Get note Post note Cookies note -private Context constructor{ param($context) $private.Context = $context $private.Request = $Context.Request $InputStream = $private...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/PSClass.ps1
PSClass.ps1
# ######################################################################### # Class: psClass # creates a pseudo-object oriented architecture within powershell # ######################################################################### function New-PSClass( [string] $ClassName = { Throw "ClassName required for N...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/iso.ps1
iso.ps1
$isoClass = New-PSClass Iso{ note -static MediaType @{CDR=2; CDRW=3; DVDRAM=5; DVDPLUSR=6; DVDPLUSRW=7; DVDPLUSR_DUALLAYER=8; DVDDASHR=9; DVDDASHRW=10; DVDDASHR_DUALLAYER=11; DISK=12; DVDPLUSRW_DUALLAYER=13; BDR=18; BDRE=19; MAX=19 } note -private Path note -private Target note -private Media note -privat...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/hostsGui.ps1
hostsGui.ps1
$HostGuiClass = new-PSClass HostGui{ note -private LdapRoot note -private domain note -private gui note -private onDomain note -private hostcsvpath note -private computers note -private ou property HostCsvPath -get { $private.hostcsvpath } property Computers -get...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/speech.ps1
speech.ps1
$speechClass = New-PSClass Speech{ note -private speaker method speak{ param( [string] $msg ) $private.speaker.speak($msg) } constructor{ $private.speaker = new-object -com SAPI.SpVoice } }
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/utils.ps1
utils.ps1
$utilities = New-PSClass Utilities{ note -static timer method -static GetTitleCase{ param($msg) $msg -split " " | % { $_.substring(0,1).toUpper()+$_.substring(1) } } method -static startTimer{ $this.timer = [system.diagnostics.stopWatch]::startNew() } method -static stopTimer{ ...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/gpo.ps1
gpo.ps1
if(!(test-path "$pwd\bin\PolFileEditor.dll")){ Add-Type -Language CSharpVersion3 -TypeDefinition ([System.IO.File]::ReadAllText("$pwd\types\PolFileEditor.cs")) -OutputAssembly "$pwd\bin\PolFileEditor.dll" -outputType Library } if(!("TJX.PolFileEditor.PolFile" -as [type])){ Add-Type -path "$pwd\bin\PolFileEditor.d...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/filters.ps1
filters.ps1
#filters that accept a piped parameter and return boolean results filter isIp{ return $_ -match "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" } filter isNumeric{ return ( ($_ -match "^[\d\.]+$") -and ( ( $_.toString().toCharArray() | ? { $_ -eq '.' } | Measure-Object)...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/dism.ps1
dism.ps1
<# .SYNOPSIS [Incomplete script!] This is a template for new scripts .DESCRIPTION [Incomplete script!] This is a template for new scripts .EXAMPLE C:\PS>.\template.ps1 This will bring up the new script .INPUTS There are no inputs that can be directed to this script .OUTPUTS All outputs are sent to th...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/rsop.ps1
rsop.ps1
if(!(test-path "$pwd\bin\PolFileEditor.dll")){ Add-Type -Language CSharpVersion3 -TypeDefinition ([System.IO.File]::ReadAllText("$pwd\types\PolFileEditor.cs")) -OutputAssembly "$pwd\bin\PolFileEditor.dll" -outputType Library } if(!("TJX.PolFileEditor.PolFile" -as [type])){ Add-Type -path "$pwd\bin\PolFileEditor.d...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/csts.ps1
csts.ps1
$cstsClass = New-PSClass csts{ property verbose -static -get { return ([System.Management.Automation.ActionPreference]::SilentlyContinue -ne $VerbosePreference) } }
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/secpol.ps1
secpol.ps1
$secPolClass = new-PSClass SecPol{ note -private infFilePath note -private entries @() property entries -get {return ,$private.entries} method parseSecPol{ $secPolItems = $utilities.GetRegContent($private.infFilePath) foreach($secPolItem in $secPolItems.getEnumerator() ){ $action = "U" $name = $...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/enums.ps1
enums.ps1
if(!(test-path "$pwd\bin\enumerations.dll")){ Add-Type -Language CSharpVersion3 -TypeDefinition ([System.IO.File]::ReadAllText("$pwd\types\enums.cs")) -OutputAssembly "$pwd\bin\enumerations.dll" -outputType Library } if(!("export.mergeType" -as [type])){ Add-Type -path "$pwd\bin\enumerations.dll" }
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/response.ps1
response.ps1
$ResponseClass = New-PSClass Response{ note Response constructor{ param($Context) $this.Response = $Context.Response $this.Response.Headers.Add("Accept-Encoding","gzip"); $this.Response.Headers.Add("Server","PowerShell Server"); $this.Response.Headers.Add("X-Powered-By","Microsoft PowerShell"...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/db.ps1
db.ps1
import-module "$pwd\modules\SQLite" $dbClass = New-PSClass Db{ note -static singleton note -private dbConnection #database connection note -private dbCommand constructor{ if ([System.IntPtr]::Size -eq 4) { [void][System.Reflection.Assembly]::LoadFrom("$pwd\bin\SQLite\x32\System.Data.SQLite.dll") ...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/users.ps1
users.ps1
$users = New-PSClass Users{ method -static getDomainUser{ param ( [string] $ou, [string] $userName ) if($utilities.isBlank( $ou ) -eq $false -and $utilities.isBlank($userName) -eq $false){ $root = [ADSI] "LDAP://$($ou)" $searcher = new-object System.DirectoryServices.DirectorySearcher(...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/pdf.ps1
pdf.ps1
Add-Type -Path "$pwd\bin\iTextSharp\itextsharp.dll" # ######################################################################### # Class: PdfClass # Creates a PDF document as the end product for a script # # See Also: # <excelClass> # ######################################################################### $P...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/export.ps1
export.ps1
# ######################################################################### # Class: ExportClass # Creates an Excel document as the end product for a script # # See Also: # <excelClass> # ######################################################################### $ExportClass = new-PSClass Export{ # Section...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/crypto.ps1
crypto.ps1
#todo -> rsa import certificates # $crypto = $cryptoClass.New() # $crypto.hashTypes.keys | % { write-host -noNewLine "$_ --> "; write-host $crypto.getHash("this is a test",$_ ) } # $iv = $crypto.gen3DesIV() # write-host "3Des Random Key --> $($crypto.gen3DesKey())"; # write-host # write-host "3Des Random IV -->...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/registry.ps1
registry.ps1
$regFileClass = new-PSClass RegFile{ note -private regFilePath note -private entries @() property entries -get {return ,$private.entries} method parseReg{ $regItems = $utilities.GetRegContent($private.regFilePath) foreach($regItem in $regItems.getEnumerator() ){ $name = $regItem.Name.ToString() ...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/scap.ps1
scap.ps1
$scapClass = New-PSClass scap{ note -private xccdfPath note -private xccdfXml note -private xccdfNs note -private ovalPath note -private ovalXml note -private ovalNs note -private profile note -private entries @() note -private title "" property title -get {return $private.title} pr...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/archives.ps1
archives.ps1
$archiveClass = New-PSClass archive{ note -static singleton note -private archive note -private job property job -get {return $private.job} constructor{ param() } method -static get{ if($utilities.isBlank($archiveClass.singleton) -eq $true){ $archiveClass.singleton = $archiveCl...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/ui.ps1
ui.ps1
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null [reflection.assembly]::loadwithpartialname("System.Drawing.Graphics") | Out-Null [reflection.assembly]::loadwithpartialname("Microsoft.VisualBasic") | Out-Null $forms...
PowerShellCorpus/Github/CyberSecDef_CSTS/lib/hosts.ps1
hosts.ps1
$HostsClass = new-PSClass Hosts{ note -private hostGui note -private Hosts @{} note -private hostCsvPath note -private computers note -private OU property Hosts -get { return $private.Hosts } property Count -get { return $private.Hosts.Count } method -private updateMac{ $runningJobs = get-...