当サイトでは実際に購入した商品のみをレビューし、アフェリエイトリンク付きでご紹介しています
【アナリティクス】海外からの大量アクセスの記録を調べました


海外からの大量アクセス?こわいなあ。



何が起きていたのか、調べてみました。
- 謎の大量アクセスの記録
- 何が起きていたのか?という推測
- Googleアナリティクスでカスタムレポートを使い、調査する方法
発生した事案
2021年9月22日の朝、Googleアナリティクスのグラフを確認したら、突然700を超える記録がついていました。
調べてみると、海外から大量の記録がついているようです。
発生日時 | 2021/09/22 AM 03:10〜03:50(日本時間) |
症状 | Googleアナリティクスに、89か国から769ページビューが記録された |





こんなに世界中の国から!
これは何が起きているのでしょう?
Webサーバーの記録を確認する
不審な記録を見つけたので、まずはWebサーバーのアクセスログを確認してみます。
Webサーバーのアクセスログをダウンロードする方法
XServerにWebサイトを構築している場合は、以下の方法でアクセスログをダウンロードできます。
- XServerのサーバーパネルにログインする
- アクセス解析→アクセスログをクリック
- 対象のドメインを選択
- 対象の日付を選んで、ダウンロード



他のレンタルサーバーをお使いの方は、
「レンタルサーバー名 アクセスログ」などのキーワードで
確認方法を調べてみてください。
アクセスログを読む
テキストファイルを開いて、該当の日時のログを確認してみましょう。



アルファベットと数字がたくさんで意味がわかりません



まずは、問題が発生した日時に、
どんな記録が残っているかを見るだけで大丈夫です。
今回の事例では、Webサーバーにアクセスログがありませんでした。



ログのサイズも、前日とほぼ変わりません。。。



大量アクセスなど、本当にあったのだろうか?


何が起きていたのか、推測する
正常なアクセスがあったときの動作
まず、正常なアクセスでは、以下のような動作でログが記録されます。
- クライアントからWebサーバーへアクセス
- Webサーバーが、自分のアクセスログに記録
- Webサイト上に設定してあるタグが、Googleのサーバーを呼び出す
- Googleアナリティクスに記録が残る


今回起きたことの憶測
今回は、Webサーバーにログがないため、違う挙動をしていたはずです。
このような方法だろうと考えています。
- 第3者がこのサイトのアナリティクスのタグをコピーし、
自分の端末からGoogleサーバーを呼び出す - Classnodeへのアクセスとして、Googleアナリティクスに記録が残る





憶測ですが、つじつまは合います。
Googleアナリティクスのタグは、HTMLソースを確認すれば、簡単にわかります。
そもそもタグは公開情報なので、情報漏洩の心配はありません。


Googleアナリティクスで不正なデータを調べる
カスタムレポート機能を使い、不正なデータを抽出してみました。
作成したカスタムレポート





びっくりするほど世界中です。





色々なOSバージョンという設定のようです。
ブラウザはChromeが多めでした。
カスタムレポートの作り方
- ブラウザからGoogleアナリティクスにログイン
- メニューの「カスタム」→「カスタムレポート」をクリック
- 「新しいカスタムレポート」をクリック
- 以下の図の設定をし、「保存」




フィルタの日時は、絞り込みたい日時に合わせて変更してください。
わかったこと
カスタムレポート機能を使って、調べたところ以下のことがわかりました。
データソースが、すべて(not set)。
※正常なデータには存在しない。
ページタイトルが、すべて(not set)。
※正常なデータには存在しない。


わからないこと



このデータを残した人は、
何のためにこんなことをしたのでしょうか?



リファラスパムのようです。
参照元(リファラ)にアクセスしてもらおうという悪質な宣伝です。
参照元URLには、安易にアクセスしないよう注意しましょう。
2021.09.28追記
再度、同じようなアクセスがあり、今回は参照元URLが設定されていました。


Googleアナリティクスから不正なデータを除外する
ここまでの調査結果を元に、今回は
「Webサーバーへの攻撃はなかった」
「目的は不明だが、影響範囲はGoogleアナリティクスだけである」
と考えています。
リファラスパムの発生を防ぐためにも、Googleアナリティクスのフィルタを追加し、
ページタイトル:(not set)のデータを除外する設定を追加します。
2021.09.28追記
ページタイトルによるフィルタが正常に機能しません。申し訳ありません。
現在、原因を調査中です。
Googleアナリティクスにフィルタを追加する
ブラウザから、Googleアナリティクスにログインメニューの「管理」をクリック「すべてのフィルタ」をクリック「フィルタを追加」をクリックフィルタ名:not setを除外 と入力フィルタの種類:カスタム を選択カスタムを選択フィルタフィールド:ページタイトル を選択フィルタパターン:(not set) と入力選択したビューに「すべてのウェブサイトのデータ」を追加「保存」をクリック


フィルターの反映には24時間ほどかかるそうです。
しばらく待ちましょう。


まとめ
2021年9月23日現在、わかったことをまとめてみました。
油断せずに、今後も各種ログやセキュリティ情報を確認したいと思います。
最後まで読んでいただき、ありがとうございました。
みなさまの暮らしがより良くなりますように。