Skip to content

Instantly share code, notes, and snippets.

View mwjcomputing's full-sized avatar

Matthew Johnson mwjcomputing

View GitHub Profile
@mwjcomputing
mwjcomputing / Get-DnsLulz.ps1
Created July 7, 2014 14:14
A Fun DNS Lulz Script
function Get-DnsLulz {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$IPAddress
)
$TheIP = $IPAddress.Split('.')
for ($x=1; $x -le 3; $x++) {
[Cmdlet(VerbsCommon.Get, "MWJName")]
public class GetMwjName : PSCmdlet
{
private string _typedName;
[Parameter(
Mandatory = true,
ValueFromPipeline = true,
ValueFromPipelineByPropertyName = true,
Position = 0,
foreach ($entry in $entries) {
$object = New-Object psobject
$object | Add-Member -Name "mail" -value $entry.value
$object | Add-Member -Name "StevesInfo" -Value "Info"
}
function New-PoshSecTemplate {
[CmdletBinding()]
param(
## Baseline Parmerter Set
[Parameter(ParameterSetName='Baseline')]
[switch]$Baseline,
[Parameter(ParameterSetName='Baseline')]
[string]$BaselinePath
)
$wmiQuery = Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName $pcName -Filter "HotFixID=$kbs"
if ($wmiQuery) {
#do stuff
} else {
# do stuff
}
@mwjcomputing
mwjcomputing / Get-OracleJavaVersion.ps1
Created March 1, 2013 20:10
Gets information on the version of Oracle Java that is installed.
function Get-OracleJavaVersion {
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline=$true)]
[alias("Computer")]
[string]$ComputerName = "$env:COMPUTERNAME"
)
begin{
@mwjcomputing
mwjcomputing / Get-PublicIPAddress.ps1
Last active December 12, 2015 04:58
Simple one-liner to grab your public IP address.
Invoke-WebRequest 'http://myip.dnsomatic.com' | Select Content
@mwjcomputing
mwjcomputing / Get-DaysUntilBSidesDetroit.ps1
Created February 5, 2013 21:06
Gets the number of days until BSidesDetroit.
function Get-DaysUntilBSidesDetroit {
Write-Host "There are $((New-Timespan -end '6/7/2013 9:00:00AM').Days) days until BSidesDetroit."
}
function Set-LocalPasswords
{
param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[string]$computer,
[Parameter(Mandatory=$true)]
[string]$password
)
process {
$userList = Get-WmiObject -Class Win32_UserAccount -ComputerName $computer
@mwjcomputing
mwjcomputing / IgnoreCertErrors.ps1
Created February 1, 2013 13:15
.NET command to ignore certificates in web requests.
[Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }