Skip to content

Instantly share code, notes, and snippets.

View jgstew's full-sized avatar

JGStew jgstew

View GitHub Profile
@mattifestation
mattifestation / ProcessMitigationOption.ps1
Created October 21, 2016 21:22
Helper function for working with registry process mitigation options.
function ConvertTo-ProcessMitigationOption {
[OutputType([String])]
param (
[Switch]
$DEPEnable,
[Switch]
$DEPATLThunkEnable,
[Switch]
'''
Created on Mar 27, 2011
@author: hassane
@original: http://code.activestate.com/recipes/577649-dhcp-query/
@modified: Rusty Myers - June 2016 with much help from @frogor and @bruienne. Thanks!
@requirments: python3
@function: returns DHCP offer and BSDP list
@notes: BSDP format - https://static.afp548.com/mactips/bootpd.html
'''
@htp
htp / curl-websocket.sh
Last active April 25, 2024 14:57
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@mattifestation
mattifestation / WMI_event_discovery.ps1
Last active October 10, 2021 02:21
Helper functions used to discover WMI intrinsic and extrinsic event classes
function Get-WmiNamespace {
<#
.SYNOPSIS
Returns a list of WMI namespaces present within the specified namespace.
.PARAMETER Namespace
Specifies the WMI repository namespace in which to list sub-namespaces. Get-WmiNamespace defaults to the ROOT namespace.
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@mwulftange
mwulftange / exec-with-timeout.vbs
Created February 9, 2016 09:46
Exec with timeout in VBScript
' Calls WshShell.Exec with c and kills the process tree after the specified timeout t
' Returns the created WshScriptExec object
Function Exec(c, t)
Dim s, e : Set s = CreateObject("WScript.Shell") : Set e = s.Exec(c)
Do While e.Status = 0
Call s.Run("waitfor /t 1 OneSecond", 0, True)
t = t - 1
If 0 >= t Then
Call s.Run("taskkill /t /f /pid " & e.ProcessId, 0, True)
Exit Do
@mattifestation
mattifestation / DFSPoC.ps1
Created December 2, 2015 23:59
Perform unauthenticated WMI queries on a Dell Foundation Services server
function Get-DellFoundationServicesWmiObject {
<#
.SYNOPSIS
Performs a WMI query on a Dell Foundation Services server.
Author: Matthew Graeber (@mattifestation)
License: BSD 3-Clause
.DESCRIPTION
@mattifestation
mattifestation / drop_binary.bat
Created July 12, 2015 05:49
Drop binary data from the command line w/o needing PowerShell
echo -----BEGIN CERTIFICATE----- > encoded.txt
echo Just Base64 encode your binary data
echo TVoAAA== >> encoded.txt
echo -----END CERTIFICATE----- >> encoded.txt
certutil -decode encoded.txt decoded.bin
@lamw
lamw / gist:487c9ecb2dc7d043eec8
Last active October 30, 2022 06:21
Automate silent installation of VMware Tools for Mac OS X
#!/bin/bash
# 1 = VMware Tools ISO is mounted from vSphere
# 2 = Download VMware Tools (assumes you can connect to internet)
INSTALL_METHOD=2
# Thanks to Rich Trouton for tip on Tools being available online
VMWARE_TOOLS_DOWNLOAD_URL=http://softwareupdate.vmware.com/cds/vmw-desktop/fusion/7.1.2/2779224/packages/com.vmware.fusion.tools.darwin.zip.tar
# DO NOT MODIFY BEYOND HERE #
@grantcarthew
grantcarthew / Test-SSD.ps1
Last active November 5, 2019 05:13
PowerShell script to test if a hard disk is an Solid State Disk (SSD) or not.
<#
.SYNOPSIS
Detects if the passed Physical Disk Id is a Solid State Disk (SSD) or a
spindle disk. Returns true for an SSD and false for anything else.
.DESCRIPTION
Use Get-PhysicalDisk to get the Physical Disk Ids for the system you wish
to test. This script supports values being passed throught the pipeline.
The methods used for detecting are by reading the Nominal Media Rotation