Skip to content

Commit

Permalink
Updated options and readme fixed bug #59
Browse files Browse the repository at this point in the history
  • Loading branch information
YamatoSecurity committed Oct 15, 2021
1 parent 2e1b450 commit 66cbf16
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 76 deletions.
13 changes: 9 additions & 4 deletions Analyzers/NTLM-Operational.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ function Analyze-NTLMOperationalBasic {

function Analyze-NTLMOperationalDetailed {

$output = @()
$WineventFilter = @{}
$EventIDsToAnalyze = 8001, 8002, 8004
$WineventFilter.Add("ID", $EventIDsToAnalyze)
Expand Down Expand Up @@ -418,10 +419,13 @@ function Analyze-NTLMOperationalDetailed {
}
}

if ( $8004_SChannelNameList -notcontains $8004_msgSChannelName ) { $8004_SChannelNameList.Add($8004_msgSChannelName) }
if ( $8004_UserNameList -notcontains $8004_msgUserName ) { $8004_UserNameList.Add($8004_msgUserName) }
if ( $8004_WorkstationNameList -notcontains $8004_msgWorkstationName ) { $8004_WorkstationNameList.Add($8004_msgWorkstationName) }
if ( $8004_SChannelTypeList -notcontains $8004_msgSChannelType ) { $8004_SChannelTypeList.Add($8004_msgSChannelType) }
$tempoutput = [Ordered]@{
$SecureChannelName = $8004_msgSChannelName ;
$UserName = $8004_msgUserName ;

}
$output += [PSCustomObject]$tempoutput
$output

}
}
Expand Down Expand Up @@ -514,4 +518,5 @@ function Analyze-NTLMOperationalDetailed {
Write-Host "8002 Events: " $8002_NumberOfLogs
Write-Host "8004 Events: " $8004_NumberOfLogs
Write-Host
$output
}
63 changes: 38 additions & 25 deletions Config/Language/en.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,13 @@ $Create_LogonTimeline_TypeOther = "Other Type Logons:"
$Create_LogonTimeline_localComputer = "LOCAL"

$Warn_DC_LiveAnalysis = "Warning: You probably should not be doing live analysis on a Domain Controller. Please copy log files offline for analysis."
$Error_InCompatible_LiveAnalysisAndLogFile = "Error: you cannot specify -LiveAnalysis and -LogFile at the same time."
$Error_InCompatible_LogDirAndFile = "Error:you cannot specify -LogDirectory and -LogFile at the same time."
$Error_InCompatible_LiveAnalysisAndLogFile = "Error: You cannot specify -LiveAnalysis and -LogFile at the same time."
$Error_InCompatible_LogDirAndFile = "Error:You cannot specify -LogDirectory and -LogFile at the same time."
$Error_NotSupport_LiveAnalysys = "Error: Live Analysis is only supported on Windows"
$Error_NeedAdministratorPriv = "Error: You need to be running Powershell as Administrator."
$Error_NoSaveOutputWithCSV = "Error: you need to specify -SaveOutput"
$Error_NoNeedSaveOutputWithGUI = "Error: you cannot output to GUI with the -SaveOutput parameter"
$Error_NoSaveOutputWithCSV = "Error: You need to specify -SaveOutput"
$Error_NoNeedSaveOutputWithGUI = "Error: You cannot output to GUI with the -SaveOutput parameter"
$Error_InCompatible_NoLiveAnalysisOrLogFileSpecified = "Error: You need to specify -LiveAnalysis or -LogFile"


#function Show-Contributors
Expand Down Expand Up @@ -366,23 +367,17 @@ function Show-Help {
Write-Host
Write-Host "Analysis Type (Specify one):"

Write-Host " -EventIDStatistics" -NoNewline -ForegroundColor Green
Write-Host " -AnalyzeNTLM_UsageBasic" -NoNewline -ForegroundColor Green
Write-Host " : Returns basic NTLM usage based on the NTLM Operational log"

Write-Host " -AnalyzeNTLM_UsageDetailed" -NoNewline -ForegroundColor Green
Write-Host " : Returns detailed NTLM usage based on the NTLM Operational log"

Write-Host " -EventID_Statistics" -NoNewline -ForegroundColor Green
Write-Host " : Output event ID statistics"

Write-Host " -LogonTimeline" -NoNewline -ForegroundColor Green
Write-Host " : Output a simple timeline of user logons"

Write-Host
Write-Host "Output Types (Default: Standard Output):"

Write-Host " -SaveOutput <outputfile-path>" -NoNewline -ForegroundColor Green
Write-Host " : Output results to a text file"

Write-Host " -OutputCSV" -NoNewline -ForegroundColor Green
Write-Host " : Outputs to CSV"

Write-Host " -OutputGUI" -NoNewline -ForegroundColor Green
Write-Host " : Outputs to the Out-GridView GUI"
Write-Host " : Output a condensed timeline of user logons based on the Security log"

Write-Host
Write-Host "Analysis Options:"
Expand All @@ -393,11 +388,26 @@ function Show-Help {
Write-Host " -EndTimeline ""<YYYY-MM-DD HH:MM:SS>""" -NoNewline -ForegroundColor Green
Write-Host " : Specify the end of the timeline"

Write-Host
Write-Host "-LogonTimeline Analysis Options:"

Write-Host " -IsDC" -NoNewline -ForegroundColor Green
Write-Host " : Specify if the logs are from a DC"

Write-Host
Write-Host "Output Options:"
Write-Host "Output Types (Default: Standard Output):"

Write-Host " -SaveOutput <outputfile-path>" -NoNewline -ForegroundColor Green
Write-Host " : Output results to a text file"

Write-Host " -OutputCSV" -NoNewline -ForegroundColor Green
Write-Host " : Outputs to CSV"

Write-Host " -OutputGUI" -NoNewline -ForegroundColor Green
Write-Host " : Outputs to the Out-GridView GUI"

Write-Host
Write-Host "General Output Options:"

Write-Host " -USDateFormat" -NoNewline -ForegroundColor Green
Write-Host " : Output the dates in MM-DD-YYYY format (Default: YYYY-MM-DD)"
Expand All @@ -407,15 +417,18 @@ function Show-Help {

Write-Host " -UTC" -NoNewline -ForegroundColor Green
Write-Host " : Output in UTC time (default is the local timezone)"


Write-Host " -Japanese" -NoNewline -ForegroundColor Green
Write-Host " : Output in Japanese"

Write-Host
Write-Host "-LogonTimeline Output Options:"

Write-Host " -HideTimezone" -NoNewline -ForegroundColor Green
Write-Host " : Hides the timezone"

Write-Host " -ShowLogonID" -NoNewline -ForegroundColor Green
Write-Host " : Specify if you want to see Logon IDs"

Write-Host " -Japanese" -NoNewline -ForegroundColor Green
Write-Host " : Output in Japanese"
Write-Host " : Show logon IDs"

Write-Host
Write-Host "Other:"
Expand All @@ -424,7 +437,7 @@ function Show-Help {
Write-Host " : Show the contributors"

Write-Host " -QuietLogo" -NoNewline -ForegroundColor Green
Write-Host " : Hide Execute WELA Logo"
Write-Host " : Do not display the WELA logo"

Write-Host

Expand Down
47 changes: 30 additions & 17 deletions Config/Language/ja.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ $Error_NotSupport_LiveAnalysys = "エラー: ライブ調査はWindowsにし
$Error_NeedAdministratorPriv = "エラー: Powershellを管理者として実行する必要があります。"
$Error_NoSaveOutputWithCSV = "エラー: 「-SaveOutput」を指定してください"
$Error_NoNeedSaveOutputWithGUI = "エラー: 「-OutputGUI」と「-SaveOutput」を同時に指定できません。"
$Error_InCompatible_NoLiveAnalysisOrLogFileSpecified = "エラー: -LiveAnalysisまたは-LogFileを指定する必用があります。"

#function Show-Contributors
$Show_Contributors =
Expand All @@ -349,7 +350,7 @@ DustInDark - ローカライゼーション、和訳
function Show-Help {

Write-Host
Write-Host "Windows Event Log Analyzer(WELA)" -ForegroundColor Green
Write-Host "Windows Event Log Analyzer(WELA) ゑ羅(ウェラ)" -ForegroundColor Green
Write-Host "バージョン: $YEAVersion" -ForegroundColor Green
Write-Host "作者: 田中ザック (@yamatosecurity)と大和セキュリティメンバー" -ForegroundColor Green
Write-Host
Expand All @@ -358,30 +359,24 @@ function Show-Help {
Write-Host " -LiveAnalysis" -NoNewline -ForegroundColor Green
Write-Host " : ホストOSのログでタイムラインを作成する"

Write-Host " -LogFile <path-to-logfile>" -NoNewline -ForegroundColor Green
Write-Host " -LogFile <ログファイルのパス>" -NoNewline -ForegroundColor Green
Write-Host " : オフラインの.evtxファイルでタイムラインを作成する"

Write-Host
Write-Host "解析タイプを一つ指定して下さい:"

Write-Host " -AnalyzeNTLM_UsageBasic" -NoNewline -ForegroundColor Green
Write-Host " : NTLM Operationalログを解析し、NTLM認証の使用を簡潔に出力する"

Write-Host " -AnalyzeNTLM_UsageDetailed" -NoNewline -ForegroundColor Green
Write-Host " : NTLM Operationalログを解析し、NTLM認証の使用を詳細に出力する"

Write-Host " -EventIDStatistics" -NoNewline -ForegroundColor Green
Write-Host " : イベントIDの集計情報を出力する"

Write-Host " -LogonTimeline" -NoNewline -ForegroundColor Green
Write-Host " : ユーザログオンの簡単なタイムラインを出力する"

Write-Host
Write-Host "出力方法(デフォルト:標準出力):"

Write-Host " -SaveOutput <出力パス>" -NoNewline -ForegroundColor Green
Write-Host " : テキストファイルに出力する"

Write-Host " -OutputCSV" -NoNewline -ForegroundColor Green
Write-Host " : CSVファイルに出力する"

Write-Host " -OutputGUI" -NoNewline -ForegroundColor Green
Write-Host " : Out-GridView GUIに出力する"

Write-Host
Write-Host "解析オプション:"

Expand All @@ -391,9 +386,24 @@ function Show-Help {
Write-Host " -EndTimeline ""<YYYY-MM-DD HH:MM:SS>""" -NoNewline -ForegroundColor Green
Write-Host " : タイムラインの終わりを指定する"

Write-Host
Write-Host "-LogonTimelineの解析オプション:"

Write-Host " -IsDC" -NoNewline -ForegroundColor Green
Write-Host " : ドメインコントローラーのログの場合は指定して下さい"

Write-Host
Write-Host "出力方法(デフォルト:標準出力):"

Write-Host " -SaveOutput <出力パス>" -NoNewline -ForegroundColor Green
Write-Host " : テキストファイルに出力する"

Write-Host " -OutputCSV" -NoNewline -ForegroundColor Green
Write-Host " : CSVファイルに出力する"

Write-Host " -OutputGUI" -NoNewline -ForegroundColor Green
Write-Host " : Out-GridView GUIに出力する"

Write-Host
Write-Host "出力オプション:"

Expand All @@ -406,15 +416,18 @@ function Show-Help {
Write-Host " -UTC" -NoNewline -ForegroundColor Green
Write-Host " : 時間をUTC形式で出力する。(デフォルトはローカルタイムゾーン)"

Write-Host " -Japanese" -NoNewline -ForegroundColor Green
Write-Host " : 日本語で出力する"

Write-Host
Write-Host "-LogonTimelineの出力オプション:"

Write-Host " -HideTimezone" -NoNewline -ForegroundColor Green
Write-Host " : タイムゾーンの表示をしない"

Write-Host " -ShowLogonID" -NoNewline -ForegroundColor Green
Write-Host " : ログオンIDを出力する"

Write-Host " -Japanese" -NoNewline -ForegroundColor Green
Write-Host " : 日本語で出力する"

Write-Host
Write-Host "その他:"

Expand Down
35 changes: 22 additions & 13 deletions README-English.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,46 +40,55 @@ Tested on Windows Powershell 5.1 but may work with previous versions. It will un
At the moment, please use a Windows Powershell 5.1.
You will need local Administrator access for live analysis.


Analysis Source (Specify one):
-LiveAnalysis : Creates a timeline based on the live host's log
-LogFile <path-to-logfile> : Creates a timelime from an offline .evtx file

Analysis Type (Specify one):
-EventIDStatistics : Output event ID statistics
-LogonTimeline : Output a simple timeline of user logons
-AnalyzeNTLM_UsageBasic : Returns basic NTLM usage based on the NTLM Operational log
-AnalyzeNTLM_UsageDetailed : Returns detailed NTLM usage based on the NTLM Operational log
-EventID_Statistics : Output event ID statistics
-LogonTimeline : Output a condensed timeline of user logons based on the Security log

Analysis Options:
-StartTimeline "<YYYY-MM-DD HH:MM:SS>" : Specify the start of the timeline
-EndTimeline "<YYYY-MM-DD HH:MM:SS>" : Specify the end of the timeline

-LogonTimeline Analysis Options:
-IsDC : Specify if the logs are from a DC

Output Types (Default: Standard Output):
-SaveOutput <outputfile-path> : Output results to a text file
-OutputCSV : Outputs to CSV
-OutputGUI : Outputs to the Out-GridView GUI

Analysis Options:
-StartTimeline "<YYYY-MM-DD HH:MM:SS>" : Specify the start of the timeline
-EndTimeline "<YYYY-MM-DD HH:MM:SS>" : Specify the end of the timeline
-IsDC $true : Specify if the logs are from a DC

Output Options:
General Output Options:
-USDateFormat : Output the dates in MM-DD-YYYY format (Default: YYYY-MM-DD)
-EuropeDateFormat : Output the dates in DD-MM-YYYY format (Default: YYYY-MM-DD)
-UTC : Output in UTC time
-HideTimezone : Hides the timezone being used
-ShowLogonID : Specify if you want to see Logon IDs
-UTC : Output in UTC time (default is the local timezone)
-Japanese : Output in Japanese

-LogonTimeline Output Options:
-HideTimezone : Hides the timezone
-ShowLogonID : Show logon IDs

Other:
-ShowContributors : Show the contributors
-QuietLogo : Do not display the WELA logo

## Useful Options

Show event ID statistics to get a grasp of what kind of events there are:

.\WELA.ps1 -EventIDStatistics
.\WELA.ps1 -EventID_Statistics

Create a timeline via offline analysis outputted to a GUI in UTC time:

.\WELA.ps1 -LogFile .\Security.evtx -LogonTimeline -OutputGUI -UTC

Analyze NTLM Operational logs for NTLM usage before disabling it:
.\WELA.ps1 -AnalyzeNTLM_UsageBasic -LogFile .\DC1-NTLM-Operational.evtx

## Screenshots

Logon Timeline GUI:
Expand Down
27 changes: 17 additions & 10 deletions README-Japanese.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,39 @@ Windows Powershell 5.1で動作確認済みですが、以前のバージョン

解析ソースを一つ指定して下さい:
-LiveAnalysis : ホストOSのログでタイムラインを作成する
-LogFile <path-to-logfile> : オフラインの.evtxファイルでタイムラインを作成する
-LogFile <ログファイルのパス> : オフラインの.evtxファイルでタイムラインを作成する

解析タイプを一つ指定して下さい:
-AnalyzeNTLM_UsageBasic : NTLM Operationalログを解析し、NTLM認証の使用を簡潔に出力する
-AnalyzeNTLM_UsageDetailed : NTLM Operationalログを解析し、NTLM認証の使用を詳細に出力する
-EventIDStatistics : イベントIDの集計情報を出力する
-LogonTimeline : ユーザログオンの簡単なタイムラインを出力する

出力方法(デフォルト:標準出力):
-SaveOutput <出力パス> : テキストファイルに出力する
-OutputCSV : CSVファイルに出力する
-OutputGUI : Out-GridView GUIに出力する

解析オプション:
-StartTimeline "<YYYY-MM-DD HH:MM:SS>" : タイムラインの始まりを指定する
-EndTimeline "<YYYY-MM-DD HH:MM:SS>" : タイムラインの終わりを指定する

-LogonTimelineの解析オプション:
-IsDC : ドメインコントローラーのログの場合は指定して下さい

出力方法(デフォルト:標準出力):
-SaveOutput <出力パス> : テキストファイルに出力する
-OutputCSV : CSVファイルに出力する
-OutputGUI : Out-GridView GUIに出力する

出力オプション:
-USDateFormat : 日付をMM-DD-YYYY形式で出力する (デフォルト:YYYY-MM-DD)
-EuropeDateFormat : 日付をDD-MM-YYYY形式で出力する (デフォルト:YYYY-MM-DD)
-UTC : 時間をUTC形式で出力する
-USDateFormat : 日付をMM-DD-YYYY形式で出力する (デフォルト: YYYY-MM-DD)
-EuropeDateFormat : 日付をDD-MM-YYYY形式で出力する (デフォルト: YYYY-MM-DD)
-UTC : 時間をUTC形式で出力する。(デフォルトはローカルタイムゾーン)
-Japanese : 日本語で出力する

-LogonTimelineの出力オプション:
-HideTimezone : タイムゾーンの表示をしない
-ShowLogonID : ログオンIDを出力する
-Japanese : 日本語で出力する

その他:
-ShowContributors : コントリビューターの一覧表示
-QuietLogo : ロゴを表示させずに実行する

## 便利な機能

Expand Down
Loading

0 comments on commit 66cbf16

Please sign in to comment.