I was a guest on a special episode of the “Scott and Mark Learn To” podcast, hosted by Scott Hanselman and Mark Russinovich, celebrating 30 years of Sysinternals. This is not my show, so all credit goes to the hosts. The other guests were Sami Laiho, Andrew Richards (Microsoft) and Mario Hewardt (Microsoft), who manages the Sysinternals team. Here is what we talked about, what my part was, and what I think you should take from it if you are learning Windows internals or security.
The episode is about an hour and a quarter. The video is right here, and it’s worth watching, at least for the jokes.
How I Got Involved with Sysinternals
I’ve been using the Sysinternals tools in my trainings and books for many years. I joined Microsoft at the end of 2015, and there was a feature I always wanted in Process Explorer: a decoded access mask, instead of just hex numbers. It took some courage to email Mark about it. He said, great, go ahead and add it.
So I did. Then I asked about a color for protected processes, which had none, and added that too. Later I added dark mode, which was kind of a pain with all the Win32 subclassing involved, and I implemented the “Drop Filtered Events” feature in Process Monitor.
The Windows Internals book happened in a similar way. The seventh edition had disappeared from Amazon, I asked Mark what was going on, it turned out nobody was working on it, and I said I’d be happy to write it. Completely by accident.
My Part: What Process Explorer’s Handle View Really Shows
Process Explorer is the Sysinternals tool I use the most. In the episode I focused on handles, using Explorer as the example process because it has plenty of them.
The default list is not the full list. Handle values are multiples of four, and when you look at the handle view you’ll see gaps. Some of these could be closed handles, but many are simply hidden: handles to objects with no name. Turn on “Show Unnamed Handles and Mappings” in the View menu and the list becomes much longer. It’s off by default for performance reasons.
Why multiples of four? The lower two bits are available for developers to store flags, and Windows masks them out. Process and thread IDs are also multiples of four, and that’s not a coincidence. They are generated from a private handle table, so they are handles behind the scenes. If you pass 100, 101, 102 or 103 to OpenProcess, they are interpreted the same way.
Double-clicking a handle shows the object, not the handle. The properties dialog is about the object: its address, name (if any) and handle count. The handle’s own properties, such as the access mask, are in the list itself. Not all handles are born equal. Two handles to the same object can have very different power over it, which is exactly what matters when you’re looking at what a suspicious process can actually do. And the “references” number in that dialog? Ignore it. Since Windows 8.1 it doesn’t tell you anything useful.
Some “names” are not names. A semaphore really has a name, and you can open it with OpenSemaphore. Processes don’t have names; the text you see for a process, thread or token handle is extra information Process Explorer adds. Key and file objects are the confusing ones, because they don’t have names either. What you see is a path. Call RegOpenKeyEx twice for the same registry path and you get two different key objects pointing to the same place. The same goes for files.
Don’t take my word for it. Run WinObj, which shows the named objects in the object manager namespace, and try to find a file object or a process there. You won’t. The one Key object you’ll find is the registry root. If object names and the namespace are new to you, the post on OBJECT_ATTRIBUTES shows how the native API uses them.
Sami Laiho: Catching Problems with Process Monitor
Sami talked about the real problem with Process Monitor: you’re usually not there when the error happens. So you need to leave it running, and that has to be done properly, or the log grows until the disk is full. Three options came up:
- Drop Filtered Events: filtered events never get into the log, as opposed to being just hidden from view. This lets you run for days.
- Flight recorder mode: a circular log, like the black box in an airplane, so you can stop it after the problem shows up and look back.
- Boot logging: capture activity from early in the boot process.
One more point to remember: the default filter hides quite a bit, including activity of the System process. If you’re looking for driver loads, check your filter first.
Andrew Richards: ProcDump and AI-Assisted Dump Analysis
Andrew rewrote ProcDump and also wrote !analyze in the debugger. The command line is notoriously complex, but a few things cover most cases:
procdump -iregisters ProcDump to capture a dump of anything that crashes on the machine, and-uremoves it.-magives you a full memory dump. Treat these files with care, since they contain the application’s memory, including your data.- A series of dumps a few seconds apart shows what’s changing: a stuck thread, a memory or handle leak.
- Exception monitoring with a filter takes a dump at the exact moment a specific exception occurs.
He then opened such a dump in WinDbg with its new MCP server and asked an AI assistant why the dump was taken. It walked the call stack and explained it. Useful, but you still need to know whether the answer makes sense.
The rule of thumb from the discussion: Process Monitor shows you events. ProcDump gives you the data behind them. When ProcMon is not enough, get a dump.
Mario Hewardt: Sysinternals Beyond Windows
Mario covered the cross-platform work. He took the source of Filemon for Linux from 2002, gave it to an AI, and had it running on a modern Ubuntu in about 10 minutes, switching from a kernel module to eBPF. The UI, as Mark was quick to point out, had lost something along the way. The general view was that AI can get you 80 to 90 percent of the way, and the rest is iterating, testing and knowing what you actually want.
What This Means for TrainSec Students
If you’re studying with me, a few things are worth doing this week:
- Open Process Explorer, show the unnamed handles, and compare the list before and after.
- Look at the access masks of handles to processes, especially from processes you don’t expect to have them. That’s a useful habit for anyone doing detection or malware analysis.
- Set up ProcDump to catch crashes in your lab VM, then open one of the dumps in WinDbg.
- Read a book. We talked about this on the show too: an hour of video is not as dense as 300 pages, and you need to apply what you read for it to stick.
These tools are not magic. They show you what Windows is doing, and the more internals you know, the more you get out of them. A column in Process Explorer means very little if you don’t know what a handle is.
Keep Learning
- Sysinternals Tools Deep Dive 1: my course on Process Explorer, WinObj, DebugView, VMMap, CPU Stress, NotMyFault and LiveKD. Process Monitor and ProcDump are not part of it.
- Windows Internals: Day 1: the concepts behind processes, threads and handles.
- Mastering WinDbg: for when you have a dump file and need to understand it.
- VMMap Basics: reading a process’s memory layout.
- Hiding a DLL from the PEB Loader List: and why Process Explorer still sees it.
Pavel