Skip to content

Instantly share code, notes, and snippets.

View trackd's full-sized avatar

Andree Renneus trackd

  • 23:32 (UTC +02:00)
View GitHub Profile
@trackd
trackd / Get-LACountyParcel.ps1
Created June 10, 2023 00:34
Example for /r/Powershell user, json issues + ps 5.1
function Get-LACountyParcel {
<#
.EXAMPLE
Get-LACountyParcel -Parcel <id>
#>
[CmdletBinding()]
param(
$Parcel
)
try {
@trackd
trackd / group-object-example.ps1
Last active June 16, 2023 11:34
Hashtable measurements
<#
some testing results:
machine1
.\group-object-example.ps1
PS 7.3.4
Foreach: 0.0210048
Group: 0.1844798
.\group-object-example.ps1
PS 5.1.22621.1778
@trackd
trackd / WindowsUpdate.ps1
Created July 5, 2023 08:49
Example of running Windows Update check on remote computers
<#
Example of how to get a list of updates that are available to install on a remote computer.
#>
$Scriptblock = {
# create a com object for the update session
$Session = New-Object -ComObject Microsoft.Update.Session
# create a search object for the update session
$Searcher = $Session.CreateupdateSearcher()
# search for updates that are assigned to the computer and not hidden and not installed.
# This can take some time to run.
Import-Module PSParseHtml
function Search-Google {
<#
.SYNOPSIS
Search Google and return the first result(s)
.PARAMETER Query
The search query
.PARAMETER MaxResults
The maximum number of results to return
@trackd
trackd / datetime_conversions.ps1
Last active October 30, 2023 21:57
datetime_conversion_tests.ps1
using namespace System.Globalization
# suppress all the errors from the conversion attempts.
$ErrorActionPreference = 'SilentlyContinue'
Remove-Variable fails, success, results, test*
# clean up old runs if run interactively.
filter Convert-DateTimeProperties {
$_.PSObject.Properties | ForEach-Object {
if ($_.Name -match 'date$|time$' -and $_.Value -is [string]) {
# these methods give almost the same results.
@trackd
trackd / linux_print_argv.c
Last active October 30, 2023 22:31 — forked from jborean93/linux_print_argv.c
Code that can be used to generate an executable that can print how it receives arguments
#include<stdio.h>
// gcc print_argv.c -o print_argv
int main(int argc, char *argv[])
{
int i;
for(i = 1;i < argc;i++)
{
printf("[%d] %s\n", i, argv[i]);
@trackd
trackd / Scan-LOLDrivers.ps1
Last active November 1, 2023 11:24 — forked from IISResetMe/Scan-LOLDrivers.ps1
minor refactor, outputs objects etc.
function Scan-LOLDrivers {
<#
.EXAMPLE
Scan-LOLDrivers -Path C:\Windows\System32\drivers
$Results = Scan-LOLDrivers -Path C:\Windows\inf
$Results | Select-Object *
$Results[0].all
$Results[0].all.KnownVulnerableSamples
.EXAMPLE
$iwantitall = 'C:\WINDOWS\inf',
@trackd
trackd / LOLDriverConfig.ps1
Created October 31, 2023 13:45 — forked from jsecurity101/LOLDriverConfig.ps1
PowerShell script that creates an audit or block Sysmon config based off of LOLDrivers
#Author: Jonathan Johnson (@jsecurity101)
function New-DriverConfig {
<#
.EXAMPLE
New-DriverConfig -Block
Creates driver block config in the current directory
.EXAMPLE
function Show-Pipelinecaller {
<#
.SYNOPSIS
Returns an object with the command and resolved command in a pipeline or input line.
@trackd
.PARAMETER Line
the line to parse
.PARAMETER PassThru
just passthrough for objects, not sure how useful that is.
.EXAMPLE
function table {
<#
format-table sugar that knows not to format if you're assigning to a variable.
it will automatically switch to Select-Object when assigned.
only implemented Property param atm, just testing it out for fun.
Set-Alias -Name ft -Value table -Force
to override default ft alias you need -Force.
#>
[CmdletBinding()]