Fixing KeePass' Slow Startup Performance

If you don’t use a Password Manager to store your login information for websites, first go read this: http://www.troyhunt.com/2011/03/only-secure-password-is-one-you-cant.html.

I’ve been using KeePass for my password manager for years, but noticed that their Professional Edition had a pretty brutal startup delay. As in – launch KeePass and wait 80 seconds for the window to open. While password security is important, …

Read more

Texting Yourself Sports Alerts with PowerShell

You’ve probably been in the situation of wanting to alert yourself when any update happens to a sports game, UPS package tracking status, or something else.

By combining Invoke-WebRequest’s beautiful support for HTML parsing with Send-MailMessage’s ability to send email messages - this becomes incredibly easy and useful.

(Note: this script also uses Watch-Command, a script from the PowerShell Cookbook …

Read more

Using PowerShell to Compare / Diff Files

If you’ve tried to diff files in PowerShell before, you might have seen the Compare-Object cmdlet. The Compare-Object cmdlet lets you compare two sets of items, giving you a report on the differences between those two sets:

PS G:\lee\tools> cd c:\temp
PS C:\temp> $set1 = "A","B","C"
PS C:\temp> $set2 = "C","D","E"
PS C:\temp> Compare-Object $set1 $set2 …
Read more

Getting Started with Guitar

If you’re interested in learning guitar, you might be running into an enormous feeling of dread. How do you get started? What kind of guitar should you get?

Here’s a short guide that can hopefully help get you started.

Buying a Guitar

Guitars can get really expensive. But higher-end guitars end up being a matter of taste (both musically and aesthetically). For your first guitar, you don’t have an …

Read more

Who's in Your Email Social Network?

Have you ever wondered who’s in your “Email Social Network”?

I was wondering the other day how to find out who I mail the most. With a bit of PowerShell scripting, the answer is a breeze to find out:

## Connect with Outlook, and open the 'Sent Items'
$olApp = New-Object -com Outlook.Application 
$namespace = $olApp.GetNamespace("MAPI")
$sentItems = $namespace.GetDefaultFolder(5)
## Go through each item, …
Read more

More Packet Hacking with PowerShell - UDP Manipulation

In the last post, I talked about how I used PowerShell to “STUN Roll” the open WiFi at DefCon. How much code was that? Was it hard?

stun_roll

It turns out that it was pretty reasonable - less than 60 lines of PowerShell.

## Convert a string in the form of hexadecimal characters into the
## equivalent bytes.
function ConvertFrom-HexString
{
    param($HexString)
    $HexString -split "(..)" | ? { $_ } | % { [ …
Read more

Packet Hacking with PowerShell - AKA Mass Defcon Pwnage

Every year, two of the biggest hacking / security conferences take place in Las Vegas: Black Hat, and DefCon.

Both are great experiences, and both have a common theme – hackers (“Intelligent folks that like to make machines do things they weren’t originally designed for”) getting together to educate each other and have fun.

Unsurprisingly, one of the places that people get together to have fun is the free open WiFi. …

Read more

Redacting Sensitive Information with PowerShell

You might sometimes run into a situation where you’ve got a serialized object stream, and want to redact sensitive information out of that stream. For example, consider the following object:

$objectToSerialize = [PSCustomObject] @{
    Name = "Lee"
    SocialSecurityNumber = "SomeSecretNumber"
    Address = "1234 Something Road"
    GateCode = [PSCustomObject] @{
        Prefix = 1234 …
Read more

What is OutputType?

If you’ve seen the OutputType attribute when writing a cmdlet or advanced function, you might wonder what we use it for.

The goal of the OutputType attribute is to provide a mechanism for tools to know what your cmdlets may output without running them. If they know that without running it, they can provide useful services – such as tab completion, data flow analysis, etc.

For example:

Get-Process | Where-Object { …

Read more

Removing Insecure Wireless Connections with PowerShell

Troy Hunt recently posted a great discussion about the dangers of letting your devices automatically connect to insecure wireless networks – especially if those have a common name like ‘Starbucks’ or ‘Apple Demo’.

All devices let you “forget” a network when you are in range, and Windows 7 (and before) even had an interface that let you delete networks when they were out of range. …

Read more