Skip to content

Instantly share code, notes, and snippets.

View MSAdministrator's full-sized avatar
💭
Building Thangs

Josh Rickard MSAdministrator

💭
Building Thangs
View GitHub Profile
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0">
<TN RefId="0">
<T>Selected.System.Management.Automation.PSCustomObject</T>
<T>System.Management.Automation.PSCustomObject</T>
<T>System.Object</T>
</TN>
<MS>
<S N="@odata.id">https://outlook.office365.com/api/v1.0/Users('mailbox@contoso.com')/Events('AAMkADc4NzFlMDc2LTdkNWMtNDg4MC04NmRmLTY5OTJmMmFhZjM2ZABGAAAAAAAyuDCxGFp8Q67E2z04c8bHBwAiBP0V5eP-QJuC8Y_Cu-MHAAAAAAENAAAiBP0V5eP-QJuC8Y_Cu-MHAABWVS42AAA=')</S>
<S N="@odata.etag">W/"IgT9FeXj/0CbgvGPgrvzBwAAWpeqCw=="</S>
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
@MSAdministrator
MSAdministrator / PSnmap
Created June 17, 2016 04:34
This Gist is borrowed from someone else (see code), but i've slightly modified it to work with exe cmd switches.
#requires -version 2
<#
.SYNOPSIS
Linux nmap for PowerShell (almost).
Ping sweeps and scans a network for specified open ports. Can also perform DNS lookups.
Port connect timeout is custom (milliseconds).
Multithreaded with a default of 32 concurrent threads.
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
@MSAdministrator
MSAdministrator / Update-MSITableSettings
Created May 21, 2016 04:15
Update-MSITableSettings
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
<!--
Copy from: Abhishek's PowerShell Blog - http://abhishek225.spaces.live.com/blog/
Original post: http://abhishek225.spaces.live.com/blog/cns!13469C7B7CE6E911!165.entry
-->
<Types>
<Type>
<Name>System.__ComObject</Name>
<Members>
<ScriptMethod>
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
@MSAdministrator
MSAdministrator / Search-VTForHash
Created March 11, 2016 03:59
This is a sample of checking VT for hashes using PowerShell. Check out PPRT (PowerShell Phishing Response Toolkit) for a more accurate use. https://github.com/MSAdministrator/PPRT---PowerShell-Phishing-Response-Toolkit
#Get-FileHash is a built in PowerShell cmdlet with Version 5
Write-Verbose "Downloading Posh-VirusTotal PowerShell Module...."
iex (New-Object Net.WebClient).DownloadString("https://gist.githubusercontent.com/darkoperator/9138373/raw/22fb97c07a21139a398c2a3d6ca7e3e710e476bc/PoshVTInstall.ps1")
$VTAPIkey = 'somevtapikey'
#single file Hash
$AttachmentHash = Get-FileHash C:\$env:Desktop\somefile.txt
function Test-QualysAuthentication ()
{
[cmdletbinding()]
param (
[parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Please provide a credential obejct")]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.CredentialAttribute()]$credential
@MSAdministrator
MSAdministrator / gist:051cd3f5cd2162fc6b68
Created November 12, 2015 14:46
Get-VulnerableHost
#requires -Version 3
function Get-VulnerableHost ()
{
[cmdletbinding()]
param (
[parameter(ParameterSetName = 'set1',
ValueFromPipelineByPropertyName = $true,
HelpMessage = 'Please enter a single IP or a range of IPs')]
[ValidateNotNullOrEmpty()]
[string[]]$ip,