Create alpcPortsForProcesses.txt

Add 2 options to print all ALPC ports that all processes have open handles to
This commit is contained in:
yardenshafir
2022-05-25 10:07:01 -04:00
committed by GitHub
parent c4b7a83938
commit b4bdbf9c1a
+9
View File
@@ -0,0 +1,9 @@
# Get all open ALPC ports for all processes. Pretty much like !alpc /lpp but for all processes, with much uglier output
dx -r4 @$ports = @$cursession.Processes.Select(p => new {Name = p.Name, AlpcPorts = p.Io.Handles.Where(h => h.Type == "ALPC Port").Select(a => new {PortName = a.ObjectName, Port = (nt!_ALPC_PORT*)&a.Object.Body})}).Select(p => new {Name = p.Name, AlpcPortsCount = p.AlpcPorts.Count(), AlpcPorts = p.AlpcPorts})
# Alternatively, run !alpc /lpp on all processes (slower but nicer output):
dx @$getPortsForProcess = (p => Debugger.Utility.Control.ExecuteCommand("!alpc /lpp " + ((__int64)p).ToDisplayString("x")))
dx -r3 @$cursession.Processes.Select(p => new {Name = p.Name, Ports = @$getPortsForProcess(&p.KernelObject)})