Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: Leak detection & notifier
description: Send a notification when any configured moisture sensor becomes moist
domain: automation
input:
notify_device:
name: Notify device
description: "The device where the notification should be sent to."
selector:
device:
@justintime
justintime / rule1.haskell
Last active January 3, 2024 18:04
Tasmota Watchdog
Rule1
ON system#boot do Var1 3 ENDON
ON system#boot do Var2 0 ENDON
ON Var1#State>1439 DO Var1 1439 ENDON
ON Time#Minute|%var1% DO backlog WebQuery http:/www.google.com/ GET ENDON
ON WebQuery#Data$!Done DO backlog Add2 1 ENDON
ON Var2#state >= 2 DO backlog Mult1 2; Power1 0; Delay 10; Power1 1; Var2 0 ENDON
ON WebQuery#Data=Done DO Var1 3; Var2 0 ENDON

HIBP Audit - Audit AD user accounts against HIBP

This powershell script uses the sorted hash available from HaveIBeenPwned combined with the PowerShell module DSInterals to provide a very fast and effective way to audit your users' account passwords against those found in prior public breaches.

The use case is to use this script as part of your routine audits. As companies begin to follow NIST's recommendations to relax restrictions and rotation requirements on passwords, it's important to make sure that you test your user's passwords to ensure they haven't been breached. This tool aims to automate a big chunk of that work. Everything else I could find dealt with using copies of NTDIS.DIT, which is unwieldy, hard to automate, and increases your attack surface.

Performance

Because DSInternals is able to use the sorted hash file from HIBP, it can do binary searches and ends up being blazingly fast. I'm able to audit 2,200 AD users against the ~20GB HIBPv4 hash

$functions = {
function Enc_Dec-File($key, $File, $enc_it) {
[byte[]]$key = $key
$Suffix = "`.wannacookie"
[System.Reflection.Assembly]::LoadWithPartialName('System.Security.Cryptography')
[System.Int32]$KeySize = $key.Length*8
$AESP = New-Object 'System.Security.Cryptography.AesManaged'
$AESP.Mode = [System.Security.Cryptography.CipherMode]::CBC
$AESP.BlockSize = 128
$AESP.KeySize = $KeySize
@justintime
justintime / certbot
Last active November 13, 2018 04:32
Certbot renewal for Powershell Empire
#!/bin/bash
service apache2 status
prevstatus=$?
if [ $prevstatus -ne 0 ]; then
echo "Apache stopped, starting now."
service apache2 start
fi
@justintime
justintime / cs.falconhoseclientd.service
Created March 12, 2018 19:56
CrowdStrike Falcon SIEM Collector systemd service
[Unit]
Description=CrowdStrike Falcon Host SIEM Connector
ConditionPathExists=/opt/crowdstrike/etc/cs.falconhoseclient.cfg
[Service]
User=daemon
UMask=022
LimitNOFILE=10000
TimeoutStopSec=90
WorkingDirectory=/opt/crowdstrike/bin
@justintime
justintime / settings.json
Created August 22, 2016 15:49
YNAB Toolkit Settings
[{"key":"accountTransactionSearch","value":true},{"key":"accountsDisplayDensity","value":"0"},{"key":"accountsEmphasizedOutflows","value":false},{"key":"accountsSelectedTotal","value":true},{"key":"accountsStripedRows","value":false},{"key":"activityTransactionLink","value":true},{"key":"budgetBalanceToZero","value":true},{"key":"budgetProgressBars","value":"0"},{"key":"budgetQuickSwitch","value":false},{"key":"budgetRowsHeight","value":"0"},{"key":"categoryActivityPopupWidth","value":"0"},{"key":"changeEnterBehavior","value":false},{"key":"checkCreditBalances","value":true},{"key":"checkNumbers","value":false},{"key":"collapseExpandBudgetGroups","value":false},{"key":"collapseSideMenu","value":false},{"key":"colourBlindMode","value":false},{"key":"currentMonthIndicator","value":true},{"key":"daysOfBuffering","value":true},{"key":"daysOfBufferingHistoryLookup","value":"0"},{"key":"editButtonPosition","value":"0"},{"key":"enableRetroCalculator","value":true},{"key":"enlargeCategoriesDropdown","value":true},{"k
@justintime
justintime / nginx-proxy.patch
Last active August 29, 2015 14:18
Diff of nginx 1.6.2 for CentOS6 from nginx repository
From f7c4e5a1fca1ca5c158dc393a44d753b0dccc8a8 Mon Sep 17 00:00:00 2001
From: root <root@base.vagrant.foo.com>
Date: Mon, 6 Apr 2015 14:00:48 -0500
Subject: [PATCH 1/2] working
---
conf.d/default.conf | 59 +++++++++++++++++++++++++++++++++++++++++++++-----
nginx.conf | 13 ++++++++++-
2 files changed, 65 insertions(+), 7 deletions(-)
@justintime
justintime / hosts
Created August 19, 2014 19:00
blah
host-1
anotherhost-1
yetanotherhost-1
host1
anotherhost1
yetanotherhost1
@justintime
justintime / forceScreenSaverLock.sh
Created April 19, 2013 16:04
Force screensaver lock on a Mac
#!/bin/bash
rm ~/Library/Preferences/com.apple.screensaver.plist
/usr/libexec/PlistBuddy -c "Add :askForPassword integer 1" ~/Library/Preferences/com.apple.screensaver.plist
/usr/libexec/PlistBuddy -c "Add :askForPasswordDelay integer 60" ~/Library/Preferences/com.apple.screensaver.plist