C# Class inVtero.net.Vtero

Moving things around to support save state If it turns out that we are to parse the input aggressivly, it may make sence to not have to waste time doing the same analysis over again Rooting everything off of a main class helps the structure a bit
Afficher le fichier Open project: ShaneK2/inVtero.net Class Usage Examples

Méthodes publiques

Свойство Type Description
ASGroups ConcurrentBag>.ConcurrentDictionary
AddressSpace ConcurrentBag>.ConcurrentDictionary
FileSize long
GroupThreshold double
KVS VirtualScanner
KernelProc DetectedProc
MemFile string
OverRidePhase bool
Phase int
Processes ConcurrentBag
ProgressCallback System.Action
VMCSs VMCS>.ConcurrentDictionary
hCurrentProcess System.IntPtr

Méthodes publiques

Méthode Description
AddProcessPageTable ( DetectedProc tdp, Mem memAxs ) : void
CheckpointRestoreState ( string SaveFile ) : Vtero
CheckpointSaveState ( string OverrideName = null, string DirSpec = null ) : string
DecodePointer ( ulong BlockAddress, ulong Always, ulong Never, ulong Value ) : ulong

You only need this if you can't get symbols. see http://uninformed.org/index.cgi?v=3&a=3&t=sumry by skape & Skywing

DumpASToFile ( IDictionary AS_ToDump = null ) : void

Memory Dump routines

DumpFailList ( ) : void
DumpProc ( string Folder, DetectedProc Proc, bool IncludeData = false, bool KernelSpace = true ) : long
ExtractCVDebug ( DetectedProc dp, MemSection sec ) : CODEVIEW_HEADER
ExtrtactAddressSpaces ( IOrderedEnumerable MemSpace = null, ConcurrentBag Procs = null, PTType pTypes = PTType.UNCONFIGURED ) : List>.Dictionary

This routine is fairly expensive, maybe unnecessary as well but it demo's walking the page table + EPT. You can connect an address space dumper really easily TODO: Remake this. Instead of just pre-buffering everything. Ensure the GroupAS detections are appropriate and if not, reassign the VMCS/EPTP page to bare metal or a different HVLayer item.

GetKernelDebuggerData ( DetectedProc dp, Extract ext, CODEVIEW_HEADER cv_data, string SymbolCache ) : bool

Prefer symbol loading.

GetKernelRangeFromGroup ( int GroupID ) : DetectedProc
GetSymAddress ( DetectedProc dp, string SymName ) : long
GetSymValueLong ( DetectedProc dp, string SymName ) : long

TODO: Make better for all types

GroupAS ( PTType pTypes = PTType.UNCONFIGURED ) : void

Group address spaces into related buckets We will assign an address space ID to each detected proc so we know what process belongs with who After AS grouping we will know what EPTP belongs to which AS since one of the DP's will have it's CR3 in the VMCS Yes it's a bit complicated. The overall procedure however is straight forward in that; * For every detected process Bucket into groups which are the "Address spaces" that initially are (a) based on kernel address space similarities and then (b) based on what VMCS value was found pointing to that group This ensures that if we have several hypervisors with a possibly identical kernel grouping (i.e. the PFN's were used by each kernel were identical), they are disambiguated by the VMCS. (Which can be validated later) The benefit here is that brute forcing at this stage is fairly expensive and can lead to significant overhead, there does tend to be some outliers for large systems that need to be looked at more to determine who they belong too. Nevertheless, it's inconsequential if they are grouped with the appropriate AS since even if they are isolated into their own 'AS' this is an artificial construct for our book keeping. The net result is that even if some process is grouped by itself due to some aggressive variation in kernel PFN' use (lots of dual mapped memory/MDL's or something), it's still able to be dumped and analyzed.

HashRange ( VIRTUAL_ADDRESS KEY, PFN VALUE ) : byte[]
ModuleScan ( DetectedProc dp, long StartingVA, long EndingVA = 0xFFFFFFFFF000 ) : Extract>.ConcurrentDictionary

Only scanning for core kernel modules

PrintLastDumped ( List LastList ) : void
ProcDetectScan ( PTType Modes, int DetectOnly ) : int
ReScanNextLevel ( DetectedProc tdp, bool DisplayOutput = false ) : void
TryLoadSymbols ( CODEVIEW_HEADER cv_data, long BaseVA, string SymPath ) : bool
VMCSScan ( ) : int
Vtero ( ) : inVtero.net.Support
Vtero ( string MemoryDump ) : inVtero.net.Support
Vtero ( string MemoryDump, AMemoryRunDetector MD ) : inVtero.net.Support
WalkProcList ( DetectedProc dp ) : dynamic[]
WriteColor ( ConsoleColor ForeGround, ConsoleColor BackGround, string var ) : void
WriteColor ( ConsoleColor ForeGround, string var ) : void
WriteRange ( VIRTUAL_ADDRESS KEY, PFN VALUE, string BaseFileName, Mem PhysMemReader = null, bool SinglePFNStore = false, bool DumpNULL = false ) : string

Private Methods

Méthode Description
DeriveMemoryDescriptors ( ) : void
REPLhelp ( ) : void

Method Details

AddProcessPageTable() public méthode

public AddProcessPageTable ( DetectedProc tdp, Mem memAxs ) : void
tdp DetectedProc
memAxs Mem
Résultat void

CheckpointRestoreState() public méthode

public CheckpointRestoreState ( string SaveFile ) : Vtero
SaveFile string
Résultat Vtero

CheckpointSaveState() public méthode

public CheckpointSaveState ( string OverrideName = null, string DirSpec = null ) : string
OverrideName string
DirSpec string
Résultat string

DecodePointer() public méthode

You only need this if you can't get symbols. see http://uninformed.org/index.cgi?v=3&a=3&t=sumry by skape & Skywing
public DecodePointer ( ulong BlockAddress, ulong Always, ulong Never, ulong Value ) : ulong
BlockAddress ulong
Always ulong
Never ulong
Value ulong
Résultat ulong

DumpASToFile() public méthode

Memory Dump routines
public DumpASToFile ( IDictionary AS_ToDump = null ) : void
AS_ToDump IDictionary
Résultat void

DumpFailList() public méthode

public DumpFailList ( ) : void
Résultat void

DumpProc() public méthode

public DumpProc ( string Folder, DetectedProc Proc, bool IncludeData = false, bool KernelSpace = true ) : long
Folder string
Proc DetectedProc
IncludeData bool
KernelSpace bool
Résultat long

ExtractCVDebug() public méthode

public ExtractCVDebug ( DetectedProc dp, MemSection sec ) : CODEVIEW_HEADER
dp DetectedProc
sec MemSection
Résultat CODEVIEW_HEADER

ExtrtactAddressSpaces() public méthode

This routine is fairly expensive, maybe unnecessary as well but it demo's walking the page table + EPT. You can connect an address space dumper really easily TODO: Remake this. Instead of just pre-buffering everything. Ensure the GroupAS detections are appropriate and if not, reassign the VMCS/EPTP page to bare metal or a different HVLayer item.
public ExtrtactAddressSpaces ( IOrderedEnumerable MemSpace = null, ConcurrentBag Procs = null, PTType pTypes = PTType.UNCONFIGURED ) : List>.Dictionary
MemSpace IOrderedEnumerable The list of VMCS/EPTP configurations which will alter the page table use
Procs ConcurrentBag Detected procs to query
pTypes PTType Type bitmask to interpret
Résultat List>.Dictionary

GetKernelDebuggerData() public méthode

Prefer symbol loading.
public GetKernelDebuggerData ( DetectedProc dp, Extract ext, CODEVIEW_HEADER cv_data, string SymbolCache ) : bool
dp DetectedProc
ext Extract
cv_data CODEVIEW_HEADER
SymbolCache string
Résultat bool

GetKernelRangeFromGroup() public méthode

public GetKernelRangeFromGroup ( int GroupID ) : DetectedProc
GroupID int
Résultat DetectedProc

GetSymAddress() public méthode

public GetSymAddress ( DetectedProc dp, string SymName ) : long
dp DetectedProc
SymName string
Résultat long

GetSymValueLong() public méthode

TODO: Make better for all types
public GetSymValueLong ( DetectedProc dp, string SymName ) : long
dp DetectedProc
SymName string
Résultat long

GroupAS() public méthode

Group address spaces into related buckets We will assign an address space ID to each detected proc so we know what process belongs with who After AS grouping we will know what EPTP belongs to which AS since one of the DP's will have it's CR3 in the VMCS Yes it's a bit complicated. The overall procedure however is straight forward in that; * For every detected process Bucket into groups which are the "Address spaces" that initially are (a) based on kernel address space similarities and then (b) based on what VMCS value was found pointing to that group This ensures that if we have several hypervisors with a possibly identical kernel grouping (i.e. the PFN's were used by each kernel were identical), they are disambiguated by the VMCS. (Which can be validated later) The benefit here is that brute forcing at this stage is fairly expensive and can lead to significant overhead, there does tend to be some outliers for large systems that need to be looked at more to determine who they belong too. Nevertheless, it's inconsequential if they are grouped with the appropriate AS since even if they are isolated into their own 'AS' this is an artificial construct for our book keeping. The net result is that even if some process is grouped by itself due to some aggressive variation in kernel PFN' use (lots of dual mapped memory/MDL's or something), it's still able to be dumped and analyzed.
public GroupAS ( PTType pTypes = PTType.UNCONFIGURED ) : void
pTypes PTType Types to scan for, this is of the already detected processes list so it's already filtered really
Résultat void

HashRange() public méthode

public HashRange ( VIRTUAL_ADDRESS KEY, PFN VALUE ) : byte[]
KEY VIRTUAL_ADDRESS
VALUE PFN
Résultat byte[]

ModuleScan() public méthode

Only scanning for core kernel modules
public ModuleScan ( DetectedProc dp, long StartingVA, long EndingVA = 0xFFFFFFFFF000 ) : Extract>.ConcurrentDictionary
dp DetectedProc
StartingVA long
EndingVA long
Résultat Extract>.ConcurrentDictionary

PrintLastDumped() public méthode

public PrintLastDumped ( List LastList ) : void
LastList List
Résultat void

ProcDetectScan() public méthode

public ProcDetectScan ( PTType Modes, int DetectOnly ) : int
Modes PTType
DetectOnly int
Résultat int

ReScanNextLevel() public méthode

public ReScanNextLevel ( DetectedProc tdp, bool DisplayOutput = false ) : void
tdp DetectedProc
DisplayOutput bool
Résultat void

TryLoadSymbols() public méthode

public TryLoadSymbols ( CODEVIEW_HEADER cv_data, long BaseVA, string SymPath ) : bool
cv_data CODEVIEW_HEADER
BaseVA long
SymPath string
Résultat bool

VMCSScan() public méthode

public VMCSScan ( ) : int
Résultat int

Vtero() public méthode

public Vtero ( ) : inVtero.net.Support
Résultat inVtero.net.Support

Vtero() public méthode

public Vtero ( string MemoryDump ) : inVtero.net.Support
MemoryDump string
Résultat inVtero.net.Support

Vtero() public méthode

public Vtero ( string MemoryDump, AMemoryRunDetector MD ) : inVtero.net.Support
MemoryDump string
MD AMemoryRunDetector
Résultat inVtero.net.Support

WalkProcList() public méthode

public WalkProcList ( DetectedProc dp ) : dynamic[]
dp DetectedProc
Résultat dynamic[]

WriteColor() public méthode

public WriteColor ( ConsoleColor ForeGround, ConsoleColor BackGround, string var ) : void
ForeGround ConsoleColor
BackGround ConsoleColor
var string
Résultat void

WriteColor() public méthode

public WriteColor ( ConsoleColor ForeGround, string var ) : void
ForeGround ConsoleColor
var string
Résultat void

WriteRange() public méthode

public WriteRange ( VIRTUAL_ADDRESS KEY, PFN VALUE, string BaseFileName, Mem PhysMemReader = null, bool SinglePFNStore = false, bool DumpNULL = false ) : string
KEY VIRTUAL_ADDRESS
VALUE PFN
BaseFileName string
PhysMemReader Mem
SinglePFNStore bool
DumpNULL bool
Résultat string

Property Details

ASGroups public_oe property

public ConcurrentDictionary> ASGroups
Résultat ConcurrentBag>.ConcurrentDictionary

AddressSpace public_oe property

public ConcurrentDictionary> AddressSpace
Résultat ConcurrentBag>.ConcurrentDictionary

FileSize public_oe property

public long FileSize
Résultat long

GroupThreshold public_oe property

public double GroupThreshold
Résultat double

KVS public_oe property

public VirtualScanner,inVtero.net KVS
Résultat VirtualScanner

KernelProc public_oe property

public DetectedProc,inVtero.net KernelProc
Résultat DetectedProc

MemFile public_oe property

public string MemFile
Résultat string

OverRidePhase public_oe property

Set OverRidePhase to force a re-run of a stage
public bool OverRidePhase
Résultat bool

Phase public_oe property

public int Phase
Résultat int

Processes public_oe property

public ConcurrentBag Processes
Résultat ConcurrentBag

ProgressCallback public_oe static_oe property

public static Action,System ProgressCallback
Résultat System.Action

VMCSs public_oe property

public ConcurrentDictionary VMCSs
Résultat VMCS>.ConcurrentDictionary

hCurrentProcess public_oe static_oe property

public static IntPtr,System hCurrentProcess
Résultat System.IntPtr