Adding Repositories for Inspection

Sometime I want to inspect software repositories. However, I don't want my machine to actually install anything from it.
To do so, I made a small bash function that both adds the repository and pins it to priority -1, telling apt to never install anything from it (unless manually ...

more ...

Timing Execution By Output Lines

The Story

Today I got annoyed that some puppet agent runs took me over 90 seconds to complete, even though they actually did nothing (no change was needed).
I wanted to see which part of the run took the longest, so I tried this:

sudo puppet agent --test --debug

Unfortunately ...

more ...

Mass-Checking SSH Connections using Parallel

Today I wanted to make sure I have SSH access to about 100 servers.
Obviously, I wasn't going to verify the list by hand, so I put all of the servers' names in a file, and wrote this little script:

for NAME in $(cat ~/Desktop/server-names)
do
        echo -n ...
more ...

Finding Accounts Trusted for Delegation

As part of a security audit, I was asked to help in finding all accounts marked with "Trusted for Delegation"

What is "Trust for Delegation"

You can try reading the TechNet Article, but in short - delegation (also known as kerberos double-hop) is allowing a service to impersonate clients in order ...

more ...

Some PowerShell Snippets for Network Scanning

I recently had to improvise some network scanning using PowerShell. The security guys got somewhat excited, so I decided to upload these snippets.
I think all of them require PowerShell v2+

Checking ping for one IP address

Test-Connection $target -count 1 -quiet

Checking if a TCP port is listening

function ...
more ...

List all Group Policy Extensions Registered

I use this script to see all GP extensions that my computer can process:

ls 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions' | select `
    @{name='Guid';expression={[guid]$_.pschildname}}
    @{name='Name';expression={$_.GetValue('')}}
    @{name='DllName';expression={$_.GetValue('DllName')}}
    @{name='ProcessWhenNoChanges';expression={!$_.GetValue('NoGPOListChanges')}}
    @{name='IsUserPolicy';expression ...
more ...

setspn Duplicates and Case Sensitivity

Today I found out that the command I use to find duplicate SPNs, setspn -x

is case sensitive, meaning that the following SPNs don't count as duplicates:

HOST/bla
HOST/BLA

This makes sense when using UNIX systems for TGS creation.
However, Active Directory Domain Controllers, being Windows systems ...

more ...


Finding Superseding WSUS updates in PowerShell

Whenever I see a superseded update, I usually want to know which update supersedes it.
Finding it from the console is easy enough:

But of course, working through the UI is no fun.
After you got an update object through PowerShell, like this:

$wsus = Get-WsusServer WSUS2 -PortNumber 8530
$update = $wsus ...
more ...