mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-10-07 23:14:45 +02:00
Use precise native DNS operation timestamps and nonce-only event reads
This commit is contained in:
1 parent
cddafd04e3
commit
2973eafb98
5 files changed
+30
-11
No files matched your search
@@ -7,9 +7,9 @@ $ErrorActionPreference='Stop';$script:ScriptRoot=Split-Path $PSScriptRoot -Paren
|
||||
Initialize-WelaDnsClientProbeNative
|
||||
if((Get-Service Dnscache -ErrorAction Stop).Status -ne 'Running'){throw 'DNS Client must already be running.'}
|
||||
$before=Get-WelaChannelReader
|
||||
$start=[DateTime]::UtcNow.ToString('o')
|
||||
$start=[Wela.DnsClientProbe.Native]::UtcNow().ToString('o')
|
||||
$query=[Wela.DnsClientProbe.Native]::Query($QueryName,$Resolver)
|
||||
$end=[DateTime]::UtcNow.ToString('o')
|
||||
$end=[Wela.DnsClientProbe.Native]::UtcNow().ToString('o')
|
||||
$after=Get-WelaChannelReader
|
||||
if((Get-WelaChannelReadKey $before) -cne (Get-WelaChannelReadKey $after)){throw 'Worker primary token changed during DNS query.'}
|
||||
[pscustomobject]@{Query=$query;StartedUtc=$start;CompletedUtc=$end;ProcessId=$PID;BeforeToken=$before;AfterToken=$after}|ConvertTo-Json -Depth 12 -Compress
|
||||
[pscustomobject]@{Query=$query;StartedUtc=$start;CompletedUtc=$end;Clock='GetSystemTimePreciseAsFileTime';ProcessId=$PID;BeforeToken=$before;AfterToken=$after}|ConvertTo-Json -Depth 12 -Compress
|
||||
Reference in new issue
Block a user