情報技術の四方山話

AI、IoT、ヤマハルータ、VPN、無線LAN、Linux、クラウド、仮想サーバと情報セキュリティのよもやま話

Linuxの脆弱性GHOST(CVE-2015-0235)の有無の確認方法

2015-01-29 08:40:22 | Linux
匠技術研究所
Linuxの脆弱性GHOST(CVE-2015-0235)の有無の確認方法


いつもアクセスありがとうございます。匠技術研究所の谷山 亮治です。
今回は「Linuxの脆弱性GHOST(CVE-2015-0235)の有無の確認方法」です。

一部のLinuxの脆弱性GHOST(CVE-2015-0235)が公になりました。外部と接続しているサーバーから対策を行う必要があります。

以下は、実機でGHOSTの有無を確認した手順です。私が、たまたま試したCentOS5には脆弱性があると判断され、UbuntuStuio 14.04.1 LTSでは脆弱性が無いと判断されました。

脆弱性があると判断された場合は、OSのアップデートと再起動が必要です。アップデート後も再度チェックプログラムを走らせて、脆弱性がなくなったことを確認してください。

■GHOSTの影響の確認
1)OSバージョンの表示
[root@takumigiken ~]# uname -a
Linux takumigiken 2.6.18-194.11.3.el5 #1 SMP Mon Aug 30 16:23:24 EDT 2010 i686 i686 i386 GNU/Linux
[root@takumigiken ~]# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final

2)スクリプト中でcurlを使うのでインストールを確認
[root@takumigiken ~]# which curl
/usr/bin/curl

3)テストプログラムを実行するディレクトリを作り、移動する
[root@takumigiken ~]# mkdir ghost
[root@takumigiken ~]# cd ghost/

4)Githubからテストプログラムをダウンロードする
一回目:httpsの検証に失敗する。二回目の手順を実行すること。
[root@takumigiken ghost]# wget https://raw.githubusercontent.com/mholzinger/CVE-2015-0235_GHOST/master/build.sh
--2015-01-29 08:06:11-- https://raw.githubusercontent.com/mholzinger/CVE-2015-0235_GHOST/master/build.sh
raw.githubusercontent.com をDNSに問いあわせています... 103.245.222.133
raw.githubusercontent.com|103.245.222.133|:443 に接続しています... 接続しました。
エラー: raw.githubusercontent.com の証明書(発行者: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3)の検証に失敗しました:
発行者の権限を検証できませんでした。
エラー: 証明書に記載されている名前 `www.github.com' とホスト名 `raw.githubusercontent.com' が一致しません
raw.githubusercontent.com に安全の確認をしないで接続するには、`--no-check-certificate' を使ってください。
SSL による接続が確立できません。

二回目:検査プログラムを取得する。
[root@takumigiken ghost]# wget https://raw.githubusercontent.com/mholzinger/CVE-2015-0235_GHOST/master/build.sh --no-check-certificate
--2015-01-29 08:08:25-- https://raw.githubusercontent.com/mholzinger/CVE-2015-0235_GHOST/master/build.sh
raw.githubusercontent.com をDNSに問いあわせています... 103.245.222.133
raw.githubusercontent.com|103.245.222.133|:443 に接続しています... 接続しました。
警告: raw.githubusercontent.com の証明書(発行者: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3)の検証に失敗しました:
発行者の権限を検証できませんでした。
警告: 証明書に記載されている名前 `www.github.com' とホスト名 `raw.githubusercontent.com' が一致しません
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 149 [text/plain]
`build.sh' に保存中

100%[=====================================================================>] 149 --.-K/s 時間 0s

2015-01-29 08:08:26 (1.45 MB/s) - `build.sh' へ保存完了 [149/149]

5)プログラムの取得を確認し、実行権を与える
[root@takumigiken ghost]# ls
build.sh
[root@takumigiken ghost]# ls -la
合計 24
drwxr-xr-x 2 root root 4096 1月 29 08:08 .
drwxr-x--- 13 root root 4096 1月 29 08:05 ..
-rw-r--r-- 1 root root 149 1月 29 08:08 build.sh
[root@takumigiken ghost]# chmod a+x build.sh
[root@takumigiken ghost]# ls -la
合計 24
drwxr-xr-x 2 root root 4096 1月 29 08:08 .
drwxr-x--- 13 root root 4096 1月 29 08:05 ..
-rwxr-xr-x 1 root root 149 1月 29 08:08 build.sh

6)プログラムを実行し、脆弱性の有無を確認する
6.1)脆弱性がある時の実行例
[root@takumigiken ghost]# ./build.sh
vulnerable
[root@takumigiken ghost]#

6.2)脆弱性がないときの実行例
tanipro@tanipro:~/ghost$ uname -a
Linux tanipro 3.13.0-44-lowlatency #73-Ubuntu SMP PREEMPT Tue Dec 16 00:48:57 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
tanipro@tanipro:~/ghost$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
tanipro@tanipro:~/ghost$

tanipro@tanipro:~/ghost$ ./build.sh
not vulnerable


コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« Linux/Ubuntu日本語デスクト... | トップ | Linuxの脆弱性GHOST(CVE-201... »
最新の画像もっと見る

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。

Linux」カテゴリの最新記事