Skip to content

Instantly share code, notes, and snippets.

@edvrfn
edvrfn / Get_All_Shell_Folder_Shortcuts.ps1
Created July 20, 2024 04:08 — forked from ThioJoe/Get_All_Shell_Folder_Shortcuts.ps1
Fetches all shell folders from Windows Registry and creates a shortcut to each, while attempting to determine the proper name and icon. Also outputs CSV file with results.
# Get All Shell Folder Shortcuts Script
# https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225
# How to Use:
# 1. Open powershell, and navigate to the path with the script using 'cd' command
# 2. Run the following command to allow running scripts for the current session:
# Set-ExecutionPolicy -ExecutionPolicy unrestricted -Scope Process
# 3. Without closing the powershell window, run the script by typing the name of the script file starting with .\ for example:
# .\Get_All_Shell_Folder_Shortcuts.ps1
# 4. Wait for it to finish, then look in the "Shell Folder Shortcuts" folder for the results
@edvrfn
edvrfn / Get_All_Shell_Folder_Shortcuts.ps1
Created July 20, 2024 04:08 — forked from ThioJoe/Get_All_Shell_Folder_Shortcuts.ps1
Fetches all shell folders from Windows Registry and creates a shortcut to each, while attempting to determine the proper name and icon. Also outputs CSV file with results.
# Get All Shell Folder Shortcuts Script
# https://gist.github.com/ThioJoe/16eac0ea7d586c4edba41b454b58b225
# How to Use:
# 1. Open powershell, and navigate to the path with the script using 'cd' command
# 2. Run the following command to allow running scripts for the current session:
# Set-ExecutionPolicy -ExecutionPolicy unrestricted -Scope Process
# 3. Without closing the powershell window, run the script by typing the name of the script file starting with .\ for example:
# .\Get_All_Shell_Folder_Shortcuts.ps1
# 4. Wait for it to finish, then look in the "Shell Folder Shortcuts" folder for the results
# Cloudflare Access Service tokens example.
#
# This is a code sample for using Cloudflare Access using service
# tokens. To execute this sample, you'll need to setup a new service
# token (client ID and client secret) as well as an Access Policy that
# allows the non-identity to access the resource. For assistance setting
# up the Cloudflare Access Service Token and the Access Policy, please
# refer to the documentation linked below.
#
# Prerequisites:
@edvrfn
edvrfn / network-stats-from-sysmon.md
Created May 22, 2023 07:15 — forked from lowleveldesign/network-stats-from-sysmon.md
Network connection statistics from Sysmon logs

Make sure you have network connections monitoring enabled:

PS temp> sysmon -c

Sysinternals Sysmon v3.11 - System activity monitor
Copyright (C) 2014-2015 Mark Russinovich and Thomas Garnier
Sysinternals - www.sysinternals.com
@edvrfn
edvrfn / powershell-web-server.ps1
Created February 20, 2023 19:44 — forked from 19WAS85/powershell-web-server.ps1
A simple web server built with powershell.
# This is a super **SIMPLE** example of how to create a very basic powershell webserver
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity.
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
# Start the Http Server
@edvrfn
edvrfn / 1. Start-PortScan.ps1
Created October 3, 2022 07:02 — forked from raandree/1. Start-PortScan.ps1
PowerShell Portscan
<#
.SYNOPSIS
Powerful asynchronus IPv4 Port Scanner
.DESCRIPTION
This powerful asynchronus IPv4 Port Scanner allows you to scan every Port-Range you want (500 to 2600 would work).
The result will contain the Port number, Protocol, Service name, Description and the Status.
.EXAMPLE
@edvrfn
edvrfn / Get-KerberosTickets.ps1
Created October 3, 2022 07:00 — forked from raandree/Get-KerberosTickets.ps1
Get all Kerberos tickets from all logon sessions
$sessions = klist sessions
$pattern = '\[(\d+)\] Session \d \d:(?<LowPart>0)x(?<HighPart>[a-f0-9]+)'
$sessions = foreach ($line in $sessions)
{
if ($line -match $pattern)
{
New-Object PSObject -Property @{
LowPart = $Matches.LowPart
HighPart = $Matches.HighPart