Skip to content

Instantly share code, notes, and snippets.

@jborean93
jborean93 / setup.sh
Created Sep 15, 2020
ansible-galaxy collection update scenarios
View setup.sh
#!/usr/bin/env bash
set -o pipefail -eu
function create_package {
name="${1}"
version="${2}"
requirements="${3:-}"
if [ ! -z "${requirements}" ]; then
@jborean93
jborean93 / New-EXOPSSession.ps1
Last active Aug 21, 2020
Cross platform function that can connect to Exchange Online using modern auth
View New-EXOPSSession.ps1
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
#Requires -Module MSAL.PS
Function New-EXOPSSession {
<#
.SYNOPSIS
Will open a PSSession to Exchange Online.
@jborean93
jborean93 / ConvertFrom-IndirectString.ps1
Created Aug 13, 2020
Converts an indirect string to the actual string value
View ConvertFrom-IndirectString.ps1
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function ConvertFrom-IndirectString {
<#
.SYNOPSIS
Converts a indirect string identifier to the actual string value it represents.
.PARAMETER IndirectString
The indirect string that begins with '@' to convert to the proper string value.
@jborean93
jborean93 / Get-FtpFile.ps1
Created Aug 12, 2020
Gets a file from an FTP server
View Get-FtpFile.ps1
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Get-FtpFile {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[System.Uri]
[Alias('Uri')]
$FtpUrl,
@jborean93
jborean93 / Get-WindowsUpdate.ps1
Created Aug 4, 2020
Output a list of updates based on the criteria that you define
View Get-WindowsUpdate.ps1
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
Function Write-WUAError {
<#
.SYNOPSIS
Convert raw HRESULT codes to a human readable error.
.PARAMETER Exception
The COMException that the error code is from.
@jborean93
jborean93 / runtime_checker.py
Last active Jul 29, 2020
Checks Ansible's ansible_builtin_runtime.yml for any missing or extra plugin entries
View runtime_checker.py
#!/usr/bin/env python3
import asyncio
import json
import os
import subprocess
import sys
import tempfile
import yaml
@jborean93
jborean93 / GSS_C_DELEG_POLICY_FLAG.md
Last active Jul 12, 2020
Documenting the behaviour of GSS_C_DELEG_POLICY_FLAG on both MIT and Heimdal
View GSS_C_DELEG_POLICY_FLAG.md

Scenario

  • Kerberos authentication to a WinRM endpoint
  • 2 Windows endpoints, 1 is trusted for unconstrained delegation (Y), the other is not trusted for any delegation (N)
  • Trying to reconcile the behaviour of GSS_C_DELEG_POLICY_FLAG for both MIT and Heimdal
  • This does not take consider any krb5.conf values that could affect this behaviour
  • The docs behaviour is based on what is in this blog post
  • Tested on Centos 8 against a Microsoft KDC
  • MIT krb5 version 1.17
  • Heimdal krb5 version 7.7.0
@jborean93
jborean93 / Get-SMBIOSData.ps1
Last active Jun 25, 2020
Extract SMBIOS info with PowerShell
View Get-SMBIOSData.ps1
Add-Type -TypeDefinition @'
using Microsoft.Win32.SafeHandles;
using System;
using System.Collections.Generic;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
namespace Ansible.Windows.Setup
{
public class NativeHelpers
@jborean93
jborean93 / example output.txt
Last active Jun 17, 2020
A script that can be used to decrypt WinRM exchanges using NTLM over http
View example output.txt
# Produced by './winrm_decrypt.py winrm.pcapng --password VagrantPass1'
# The Wireshark exchange was just running the below in powershell.exe
#
# $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'vagrant-domain@DOMAIN.LOCAL', (ConvertTo-SecureString -AsPlainText -Force -String 'VagrantPass1')
# Invoke-Command -ComputerName 192.168.56.10 -ScriptBlock { hostname.exe } -Credential $cred -Authentication Negotiate
No: 433 | Time: 2020-06-17T09:55:58.987664 | Source: 192.168.56.15 | Destination: 192.168.56.10
<?xml version="1.0" ?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd">
<s:Header>
@jborean93
jborean93 / omi.md
Last active Jun 5, 2020
Info around macOS OMI building and GSSAPI issues
View omi.md

Requires the following pre-reqs

brew install pkg-config openssl

Build OMI

rm -rf output
./configure --enable-debug --prefix=/opt/omi-dev
make
You can’t perform that action at this time.