LogParser.exe -stats:OFF -i:EVT "SELECT top 1000 TimeGenerated AS Date, EXTRACT_TOKEN(strings,10,'|') as Logtype,EXTRACT_TOKEN(strings,19,'|') as SourceIP,EXTRACT_TOKEN(strings,13,'|') as ComputerName,EXTRACT_TOKEN(strings,5,'|') as User from 'Security.evtx' where EventID=4625" -o:DATAGRID
导出csv
方便后期excel 分析
LogParser.exe -stats:OFF -i:EVT "SELECT TimeGenerated AS Date, EXTRACT_TOKEN(strings,10,'|') as Logtype,EXTRACT_TOKEN(strings,19,'|') as SourceIP,EXTRACT_TOKEN(strings,5,'|') as User into tmp_result.csv from 'Security.evtx' where EventID=4625" -o:csv
成功登陆(4624)
not like '%$' 一般用于查询非机器登陆域控账号
LogParser.exe -stats:OFF -i:EVT "SELECT top 1000 TimeGenerated AS Date,EXTRACT_TOKEN(strings,8,'|') as Logtype,EXTRACT_TOKEN(strings,18,'|') as SourceIP,EXTRACT_TOKEN(strings,5,'|') as User from 'Security.evtx' where EventID=4624 And User not like '%$'" -o:DATAGRID
hash传递(4662) LogParser.exe -i:EVT "select distinct TimeGenerated,EXTRACT_TOKEN(Strings,2,'|') AS Domain,EXTRACT_TOKEN(Strings,1,'|') AS UserName,ComputerName from Security where EventID=4662 order by TimeGenerated desc" -o:DATAGRID
write-host [+] $time Load $evtx"("Size: $logsize MB")" ... -ForegroundColor Green [xml]$xmldoc=WEVTUtil qe $evtx /q:"*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and (EventID=4624 or EventID=4625)] and EventData[Data[@Name='LogonType']='3'] or EventData[Data[@Name='LogonType']='10']]" /e:root /f:Xml /lf