generate_pool_scan
does not support scanning for objects outside of ntoskrnl
#1504
Labels
generate_pool_scan
does not support scanning for objects outside of ntoskrnl
#1504
Until now, the
generate_pool_scan
function:volatility3/volatility3/framework/plugins/windows/poolscanner.py
Line 333 in e0869da
Was sufficient for all pool scanners as we were only scanning for objects inside the main kernel (ntoskrnl), which is what backs the required and default symbol table.
But now I ran into two blocking issues with this function as the last remaining major feature to get added to Vol3 for parity is the suite of Windows GUI plugins. The GUI plugins (windowstations, desktops, windows, etc.) are driven by the GUI subsystem, which is implemented in w32k.sys and not ntoskrnl. We find these data structures largely through pool scanning before then walking embedded lists. Also, (issue 2) is that each session has its own virtual address space (memory layer) within the kernel, which is not something the current function supports (scanning in the kernel layer, but creating the resulting objects in a different layer).
So in summary, I am stuck on this now on these two issues:
Issue 1:
The function accepts only one symbol table, which is expected to be for ntoskrnl as the function then looks up types and so on from the kernel itself:
volatility3/volatility3/framework/plugins/windows/poolscanner.py
Line 361 in e0869da
The problem is that we need to also be able to send in the symbol table for symbols outside the kernel (win32k in this current case, but basically every driver uses pool allocations in some way). So this function needs to be made more general, but I am not sure the best way to do it.
We could rename the existing
symbol_table
parameter to bekernel_symbol_table
and use it in the places we know we want the kernel to be referenced, such as the handle type map lookups. We could then accept another argument ofobject_symbol_table
for where the objects being scanned for live. This could be a required argument, but then all existing scanners would need to send in the same value twice... OR it could be an optional argument and then the function checks if its set or not and defaults to the kernel if not. So either way the function will need to be updated to access and use two symbol tables or we can't support pool scanning outside of ntoskrnl, but we just need to decide the best way to do this.Issue 2:
This is Win32k specific, but each GUI session has its own virtual address space (memory layer) and this is the layer where objects that are found through scanning need to be constructed.
Right now, the function always sets the memory layer as the kernel one since its the only one it has access to:
volatility3/volatility3/framework/plugins/windows/poolscanner.py
Line 390 in e0869da
So, we could update the function to also take an optional memory layer on which to instantiate objects... otherwise we would force callers to recreate the objects on their own in the proper layer. If we going with forcing the recreation its fine, we would just need to document it and I would write the plugins to do that in the scanning loop.
The text was updated successfully, but these errors were encountered: