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
| # 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 |
| # 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: |
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
| # 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 |
| <# | |
| .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 |
| $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 |