Skip to content

Instantly share code, notes, and snippets.

@troennes
troennes / ps.ahk
Created September 12, 2025 12:45
Simple PowerShell terminal using AutoHotkey (vibe coded)
#NoEnv
#SingleInstance Force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
; ---------- GUI ----------
Gui, Font, s10, Consolas
Gui, Add, Text,, PowerShell command:
Gui, Add, Edit, vCmdInput w700 xM yp+30, ; command entry
@troennes
troennes / Find-AnomalousFilePermissions.ps1
Created April 17, 2024 12:29
A PowerShell script for identifying anomalous file permissions. Unlike most other tools, it checks (1) all files (not only folders), (2) exotic permissions (e.g. AppendData and takeOwnership, (3) owner of object
# Example: Find any anomalous permissions:
# .\Find-AnomalousFilePermissions.ps1 -Path "C:\Program Files"
# Example: Check where regular users have access:
# .\Find-AnomalousFilePermissions.ps1 -Path "C:\Program Files" -IncludePrincipals Users,Everyone,Interactive
param(
[ValidateNotNullOrEmpty()][string[]]$Path,
[string[]]$IncludePrincipal,
[string[]]$ExcludePrincipal,
[string[]]$Access,
[string]$OutputFile = ".\output.txt",
@troennes
troennes / nessus-extract-ip-from-page.js
Created April 9, 2024 07:34
Extract IP/hostnames from Nessus GUI pages
var elements = document.querySelectorAll('[data-host-id]'); var uniqueValues = new Set(); for (var i = 0; i < elements.length; i++) {uniqueValues.add(elements[i].getAttribute('data-host-id'));} console.log(Array.from(uniqueValues).join(', '));