ハードディスクメンテナンス

当サイトには広告が含まれています。

タグ:163data.com.cn



アクセス過多によりさくらインターネットに規制されているので、意味がないというか悪意のある163data.com.cnを弾く。

とにかく、アクセス頻度が高杉

ある日を例示(30,835件)するが、見ていただいても分かるように、かなり悪質。

SNなので仕方がないかなwwwww

このような状況を受け、拒否IPを作成し、denyすることに。

5月31日の途中から、拒否システムを投入!

その結果、

163data.com.cn 拒否作戦の結果
SNからの攻撃回数www

5月31日は減少し、6月1日と6月2日はゼロ!!!!!

一応成功はしているようだが、163data.com.cnを変えてくる可能性や、類似の方法で他のSNが仕掛けてくるかもしれない。

引き続き警戒態勢が必要だろう。





できるPRO Apache Webサーバー 改訂版 Version 2.4/2.2/2.0対応 (できるPROシリーズ)
辻 秀典 渡辺 高志 鈴木 幸敏 できるシリーズ編集部
インプレスジャパン
売り上げランキング: 130,640

[PR] au PAY / au WALLET カード 情報

このエントリーをはてなブックマークに追加 mixiチェック



.htaccess でアクセス元を制限することが可能。

アクセス元が許可しない範囲ならば、

Forbidden

You don't have permission to access / on this server.

と表示され、アクセスを拒否する。

HTTPステータスコードは403、四百番台はクライアントエラーであり、404(Not Found)が有名。

[PR] au PAY / au WALLET カード 情報

このエントリーをはてなブックマークに追加 mixiチェック



163data.com.cnからの悪質なアクセスの一覧です。

2014年5月のある1日のアクセスです。

たった1日30,835件です。

しかし、このブログに投稿しようにも長杉で受け付けてもらえなかった(笑)ので、ここにファイルを置きます。

できるPRO Apache Webサーバー 改訂版 Version 2.4/2.2/2.0対応 (できるPROシリーズ)
辻 秀典 渡辺 高志 鈴木 幸敏 できるシリーズ編集部
インプレスジャパン
売り上げランキング: 28,648


サーバ構築の実際がわかる Apache[実践]運用/管理 (Software Design plus)
鶴長 鎮一
技術評論社
売り上げランキング: 74,922


[PR] au PAY / au WALLET カード 情報

このエントリーをはてなブックマークに追加 mixiチェック



悪質な 163data.com.cn を拒否する(.htaccess)であるが、終わりにも書いたように、IPアドレスの一覧では、それ以外が来た場合にはじけない。

ということで、先頭2セグメントのみとし、前回のリストの範囲を広げる。

deny from 110.84.
deny from 110.85.
deny from 110.86.
deny from 110.87.
deny from 110.89.
deny from 117.25.
deny from 117.26.
deny from 117.27.
deny from 117.29.
deny from 120.32.
deny from 120.33.
deny from 120.37.
deny from 120.43.
deny from 121.204.
deny from 121.205.
deny from 218.86.
deny from 222.77.
deny from 222.79.
deny from 27.150.
deny from 27.151.
deny from 27.153.
deny from 27.156.
deny from 27.159.
deny from 59.58.

範囲が広すぎるかもしれないが、仕方がない。

*.163data.com.cn をdenyすれば済むのでは?

と思われるが、正引き逆引きの関係で *.163data.com.cn の拒否だけでは対応できない模様。

さすがはSN。

正引き
 ホスト名→IPアドレス

逆引き
 IPアドレス→ホスト名

リスト作成が面倒だが、IPアドレスとホストを取得しDBに格納していれば、以下でdenyリストを作成。

SELECT DISTINCT substring_index(`ip`,'.',2) FROM `log` WHERE `host` LIKE '%163data.com.cn' ;

substring_index('str','delimiter',count)

文字列strの先頭から、区切り文字delimiterがcount回出現した位置までの文字列を返す

重複を除去するDISTINCTとsubstring_indexを使うことにより、膨大なログから、以下の118件を得た。

deny from 110.80.
deny from 110.82.
deny from 110.83.
deny from 110.84.
deny from 110.85.
deny from 110.86.
deny from 110.87.
deny from 110.88.
deny from 110.89.
deny from 110.90.
deny from 112.112.
deny from 112.117.
deny from 116.249.
deny from 116.52.
deny from 116.54.
deny from 117.24.
deny from 117.25.
deny from 117.26.
deny from 117.27.
deny from 117.28.
deny from 117.29.
deny from 117.30.
deny from 117.63.
deny from 117.80.
deny from 117.82.
deny from 117.84.
deny from 117.88.
deny from 117.89.
deny from 120.32.
deny from 120.33.
deny from 120.35.
deny from 120.37.
deny from 120.39.
deny from 120.40.
deny from 120.42.
deny from 120.43.
deny from 121.204.
deny from 121.205.
deny from 121.224.
deny from 121.225.
deny from 121.227.
deny from 121.236.
deny from 121.239.
deny from 121.32.
deny from 121.35.
deny from 123.185.
deny from 123.186.
deny from 123.187.
deny from 124.236.
deny from 124.72.
deny from 124.79.
deny from 125.64.
deny from 125.70.
deny from 125.75.
deny from 125.77.
deny from 125.78.
deny from 202.111.
deny from 218.5.
deny from 218.66.
deny from 218.85.
deny from 218.86.
deny from 218.88.
deny from 219.131.
deny from 219.136.
deny from 219.137.
deny from 219.140.
deny from 220.160.
deny from 220.161.
deny from 220.163.
deny from 220.165.
deny from 220.166.
deny from 220.191.
deny from 221.232.
deny from 221.238.
deny from 222.170.
deny from 222.172.
deny from 222.221.
deny from 222.64.
deny from 222.67.
deny from 222.71.
deny from 222.76.
deny from 222.77.
deny from 222.78.
deny from 222.79.
deny from 222.91.
deny from 27.150.
deny from 27.151.
deny from 27.153.
deny from 27.154.
deny from 27.155.
deny from 27.156.
deny from 27.159.
deny from 58.34.
deny from 58.35.
deny from 58.37.
deny from 58.63.
deny from 59.173.
deny from 59.174.
deny from 59.175.
deny from 59.36.
deny from 59.47.
deny from 59.55.
deny from 59.56.
deny from 59.57.
deny from 59.58.
deny from 59.59.
deny from 59.60.
deny from 59.61.
deny from 61.131.
deny from 61.134.
deny from 61.140.
deny from 61.154.
deny from 61.159.
deny from 61.165.
deny from 61.166.
deny from 61.170.
deny from 61.173.
deny from 61.183.

これを自動化するプログラムを書けば、ホストに163data.com.cnを含むアクセスの拒否IPリストが自動完成。

そして、自動で.htaccessに叩き込む!

.htaccessが変化してもApacheの再起動は不要だから、自動反映!

できるPRO Apache Webサーバー 改訂版 Version 2.4/2.2/2.0対応 (できるPROシリーズ)
辻 秀典 渡辺 高志 鈴木 幸敏 できるシリーズ編集部
インプレスジャパン
売り上げランキング: 28,648


サーバ構築の実際がわかる Apache[実践]運用/管理 (Software Design plus)
鶴長 鎮一
技術評論社
売り上げランキング: 74,922


[PR] au PAY / au WALLET カード 情報

このエントリーをはてなブックマークに追加 mixiチェック



あるサイトに対する、無駄なアクセスが多いのは分かっている。

放置していたのだが、この機会に、少し追ってみる。

アクセスログを取っており、DB(MySQL)に格納しているので、

SELECT * FROM `log` WHERE `date` = '2014-05-XX' ;

として、特定の1日分を抽出。

約7.2MB(非圧縮)のログをダウンロードし、解析開始。

■ PVが多杉

レコード数は、37,705件。

1PVが1レコードなので、PV=37,705となる。

コンテンツ的に、日に三万PVを出すようなサイトではないwww

■ トップページが大半

トップページへのPVは、37,705件中の35,426件。

つまり、PVの94%がトップページ。

だいたい、アクセスの大半がトップページというのは異常。

認証不要なサイトであり、どのページからも入れるので、普通は末端のページから検索エンジン経由で入ってくるはずだ。

■ 163data.com.cn

hostを見ていると、163data.com.cnが目立つので調べてみると、28,098件あった。

全体の75%wwwwwwwwww

さすがはSN。

IPアドレスを抽出し、重複を除去した上で、.htaccessのdenyにヴチ込む。

[PR] au PAY / au WALLET カード 情報

このエントリーをはてなブックマークに追加 mixiチェック

このページのトップヘ