Q&A
前提・実現したいこと
掲題のApache2の脆弱性、CVE-2017-7679について詳しく知りたい。
具体的には以下のことを知りたいです
・事象が再現する条件
・GithubのExploitコード(https://github.com/gottburgm/Exploits/tree/master/CVE-2017-7679)で何を行おうとしているのか
よくわからないこと
問題は、「In Apache httpd 2.2.x before 2.2.33 and 2.4.x before 2.4.26, mod_mime can read one byte past the end of a buffer when sending a malicious Content-Type response header.」
ですが、HTTPサーバプログラムなのに、事象発生の条件が「悪意のあるContent-Typeレスポンスヘッダを送信するとき」なのが理解できません。
脆弱性というと、外から細工されたパケットを送られたときにおかしな動きをしてしまうことだと思っていたのですが、、、、
Apache2はどういうときに悪意のあるContent-Typeレスポンスヘッダを送信し、mod_mimeはバッファオーバーリードするのでしょうか?
発生している問題・エラーメッセージ
仮想環境上でGithubのExploitコードを試したところ、「Server Is NOT Affected .」となってしまいました。2.4.2は脆弱性の対象となるはずなのに、なぜNOT Affectedになるのかがわかりません。
・環境
Ubuntu 12.04lts32bit (Vagrant 2.0.2 hashicorp/precise32)
・以下をソースコードからインストール
APR 1.6.3
APR-util 1.6.1
Apache2.4.2
・perl CVE_2017_7679.pl http://localhost/ /usr/local/apache2 を実行
↓出力結果
=================================[ CVE-2017-7679 ]================================= Reporter : ChenQin and Hanno Böck Date : 2017-06-20 CVE : CVE-2017-7679 Description : In Apache httpd 2.2.x before 2.2.33 and 2.4.x before 2.4.26, mod_mime can read one byte past the end of a buffer when sending a malicious Content-Type response header. =================================================================================== [+] APXS Found : /usr/local/apache2/bin/apxs [*] Building Module mod_CVE_2017_7679 From Template : src/mod_template.tpl [*] Writting Module In : /usr/local/apache2/CVE_2017_7679 [*] Backuping Apache Configuration File : /usr/local/apache2/conf/httpd.conf => /usr/local/apache2/conf/httpd.conf.backup [*] Compiling Module ... /usr/local/apr/build-1/libtool --mode=install install /usr/local/apache2/CVE_2017_7679/mod_CVE_2017_7679.la /usr/local/apache2/modules/ libtool: install: install /usr/local/apache2/CVE_2017_7679/.libs/mod_CVE_2017_7679.so /usr/local/apache2/modules/mod_CVE_2017_7679.so libtool: install: install /usr/local/apache2/CVE_2017_7679/.libs/mod_CVE_2017_7679.lai /usr/local/apache2/modules/mod_CVE_2017_7679.la libtool: install: install /usr/local/apache2/CVE_2017_7679/.libs/mod_CVE_2017_7679.a /usr/local/apache2/modules/mod_CVE_2017_7679.a libtool: install: chmod 644 /usr/local/apache2/modules/mod_CVE_2017_7679.a libtool: install: ranlib /usr/local/apache2/modules/mod_CVE_2017_7679.a libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/apache2/modules ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/apache2/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the '-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the 'LD_RUN_PATH' environment variable during linking - use the '-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- [*] Adding Module Configuration Into Apache Configuration : /usr/local/apache2/conf/httpd.conf [*] Restarting Apache ... [*] Sending GET Request On : http://localhost/CVE_2017_7679/ Response Code : 200 Response Content : Query : <HTML> <HEAD> <TITLE>mod_CVE_2017_7679</TITLE> </HEAD><BODY> <H2>mod_CVE_2017_7679 Request Dump</H2> <UL> <LI>Handler: cve_2017_7679</LI> Method: GET</LI> <LI>Path Info: </LI> <LI>Filename: /usr/local/apache2/htdocs/CVE_2017_7679/</LI> <LI>Protocol: HTTP/1.1</LI> <LI>URI: /CVE_2017_7679/</LI> <LI>Hostname: localhost</LI> <LI>Query: </LI> </UL> </BODY> </HTML> [*] Sending Second Request To Check If The Denial Of Service Worked On : http://localhost/CVE_2017_7679/ Response Code : 200 [-] Server Is NOT Affected . [*] Recovering Apache Configuration File From Backup : /usr/local/apache2/conf/httpd.conf.backup
↓ tcpdumpで取得したパケットをWiresharkで表示(なぜReq/Resが逆になってしまうのかはよくわかりません…)
HTTP/1.1 200 OK Date: Wed, 14 Feb 2018 09:13:07 GMT Server: Apache/2.4.2 (Unix) Content-Length: 378 Connection: close Content-Type: text/htmla Query : <HTML> <HEAD> <TITLE>mod_CVE_2017_7679</TITLE> </HEAD><BODY> <H2>mod_CVE_2017_7679 Request Dump</H2> <UL> <LI>Handler: cve_2017_7679</LI> Method: GET</LI> <LI>Path Info: </LI> <LI>Filename: /usr/local/apache2/htdocs/CVE_2017_7679/</LI> <LI>Protocol: HTTP/1.1</LI> <LI>URI: /CVE_2017_7679/</LI> <LI>Hostname: localhost</LI> <LI>Query: </LI> </UL> </BODY> </HTML> GET /CVE_2017_7679/? HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: localhost Content-Type: application/x-www-form-urlencoded
回答1件
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2018/02/16 00:13