Skip to content

Instantly share code, notes, and snippets.

View kuan51's full-sized avatar
:atom:
Back on the grind

Rex Linder kuan51

:atom:
Back on the grind
View GitHub Profile
@kuan51
kuan51 / create-secret-grp.ps1
Last active March 21, 2022 19:26
Create Secret O365 Groups using CSV
# Create a Distribution List with Hidden Membership using a CSV of contacts
import-module AzureAd
Import-Module ExchangeOnlineManagement
Connect-AzureAD
Connect-ExchangeOnline
$csv = Import-Csv C:\Users\username\Documents\Investors.csv
foreach($investor in $csv)
@kuan51
kuan51 / pwsh_port_scanner.txt
Created January 17, 2022 19:49
Powershell Port Scanner
$port = 22
$net = “192.168.1”
$range = 1..254
foreach ($r in $range)
{
$ip = “{0}.{1}” -F $net,$r
if(Test-Connection -BufferSize 32 -Count 1 -Quiet -ComputerName $ip)
{
@kuan51
kuan51 / download_all_digicerts.ps1
Last active April 6, 2021 23:49
Download all certificates from a Digicert account and save to current users downloads folder
# Set to TLS1.2
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;
# Create Headers variable for API call
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("X-DC-DEVKEY", 'api_key_here')
# Create array containing all order #'s
$ordersList = Invoke-RestMethod 'https://www.digicert.com/services/v2/order/certificate' -Headers $headers
$orderNumbers = @()
foreach ($order in $ordersList.orders) {
$orderNumbers+=$order.id
@kuan51
kuan51 / Cli-Example.psm1
Created October 9, 2020 20:35
An example template of how to build a powershell command line application
<#
Description and useful info here
#>
function Cli-Example
{
Param
(
[Parameter(Mandatory=$false, ParameterSetName='param1')]
[bool] $param1,
[Parameter(Mandatory=$false, ParameterSetName='param2')]
@kuan51
kuan51 / Get-Certs.psm1
Last active October 23, 2020 05:32
This script was built to allow one to quickly extrapolate data and information about the SSL certificate used on a large list of websites.
<#
This script was built to allow one to quickly extrapolate data and information about the SSL certificate used on a large list of websites.
Here is a breakdown of the logic:
1. Open SSL tunnel to a FQDN
2. Import the cert as a x509Certificate2 powershell object
3. Extract the subject and issuer info from the certificate
4. Compiles a CSV report with the certificate details
#>
function Get-Certs
{
@kuan51
kuan51 / keybase.md
Created March 22, 2020 03:57
keybase proof

Keybase proof

I hereby claim:

  • I am kuan51 on github.
  • I am kuan51 (https://keybase.io/kuan51) on keybase.
  • I have a public key ASBmFuo2NH5A6SDRQPvAM4tjB75SD48ybtu5betfKDnLAAo

To claim this, I am signing this object: