This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMD | |
ver | |
# .Net Library - OSVersion property of the System.Environment class | |
[System.Environment]::OSVersion.Version | |
# .Net Library - OSVersion property of the Environment class | |
[Environment]::OSVersion | |
# Check Registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sc query state=all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commands to allow/disallow through Windows Firewall | |
# NETSH | |
netsh firewall set service type = remotedesktop mode = enable | |
# Registry | |
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f | |
# PowerShell | |
$FireWall = New-Object -comObject HNetCfg.FwPolicy2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PS Function to parse Nessus Targets | |
function Scrape-NessusTargets{ | |
$nessusFiles = Get-ChildItem -Filter "*.nessus" | |
$allNessusTargets = @() | |
foreach ($file in $nessusFiles){ | |
[xml]$XmlDocument = New-Object System.Xml.XmlDocument | |
[xml]$XmlDocument = Get-Content $file | |
$NessusPreferences = $XmlDocument.NessusClientData_v2.Policy.Preferences.ServerPreferences.preference | |
$targets = $NessusPreferences | ?{$_.name -eq "target"} | %{$_.value} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default location Windows 2003 | |
%SystemRoot%\System32\Dns | |
# Default location Windows 2008 | |
%SystemRoot%\System32\Winevt\Logs\DNS Server.evtx | |
# Default location of enhanced DNS Windows 2012 R2 | |
%SystemRoot%\System32\Winevt\Logs\Microsoft-Windows-DNSServer%4Analytical.etl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IP Configuration | |
ipconfig /all | |
# Local and DNS Cache | |
ipconfig /displaydns | |
# Show Open Connections | |
netstat -ano | |
# Netstat Loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get List of Users | |
net user | |
# Get List of Local Groups | |
net localgroup | |
# Create user "bmarley" | |
net user /add bmarley S3cretP@ssword /add | |
# Add BMARLEY to local administrators group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UFW Commands to make your life eaiser | |
# Install UFW | |
sudo apt-get update | |
sudo apt-get install ufw | |
# View UFW Status | |
sudo ufw status | |
# Enable UFW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Display all the passwords stored in the Windows Credential Manager | |
Function Get-WindowsCredentialManagerPasswords{ | |
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime] | |
$vault = New-Object Windows.Security.Credentials.PasswordVault | |
$vault.RetrieveAll() | % { $_.RetrievePassword();$_ } | |
} | |
Get-WindowsCredentialManagerPasswords |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Random Exchange Commands | |
# View free space on each DB | |
Get-MailboxDatabase -Status | sort name | select name,@{Name='DB Size (Gb)';Expression={$_.DatabaseSize.ToGb()}},@{Name='Available New Mbx Space Gb)';Expression={$_.AvailableNewMailboxSpace.ToGb()}} | |
# Check Exchange Servers Service Health | |
Test-ServiceHealth | |
# Return list of Databases (Name, Server, isMounted) |
OlderNewer