Vulnerability in HTTP sys could allow remote code execution (MS15 034) PTIT

16 1.3K 10
Vulnerability in HTTP sys could allow remote code execution (MS15 034)   PTIT

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

PHẦN I:GIỚI THIỆU1.1Giới thiệu về cấu trúc của IIS và bộ đệm HTTP.sysA)Giới thiệu về IIS:IIS là viết tắt của từ (Internet Information Services), được đính kèm với các phiên bản của Windows. IIS là các dịch vụ dành cho máy chủ chạy trên nền hệ điều hành Window nhằm cung cấp và phân tán các thông tin lên mạng, nó bao gồm nhiều dịch vụ khác nhau như Web Server, FTP Server…Nó có thể được sử dụng để xuất bản nội dung của các trang Web lên InternetIntranet bằng việc sử dụng “Phương thức chuyển giao siêu văn bản“ – Hypertext Transport Protocol (HTTP).Như vậy, sau khi bạn thiết kế xong các trang Web của mình, nếu bạn muốn đưa chúng lên mạng để mọi người có thể truy cập và xem chúng thì bạn phải nhờ đến một Web Server, ở đây là IIS. Nếu không thì trang Web của bạn chỉ có thể được xem trên chính máy của bạn hoặc thông qua việc chia sẻ tệp (file sharing) như các tệp bất kỳ trong mạng nội bộ mà thôi.Hiện tại IIS đã có các phiên bản 3.0, 4.0, 5.1, 6.0, 7.0, 7.5. Nói chung cách cài đặt không có gì khó và khác nhau lắm giữa các version. Các điểm cải tiến ở IIS 7 tập trung quanh vấn đề sử dụng mô hình thiết kế modul, chức năng quản lý dễ dàng, và nâng cao tính bảo mật.Phiên bản IIS 7 bao gồm:•Windows Process Activation Service (WAS): thiết lập trang sử dụng giao thức HTTP và HTTPS•Web server engine: thêm hoặc xóa các module•Integrated requestprocessing: xử lý request từ IIS đến ASP.NETB)Hoạt động của IISMột trong những dịch vụ phổ biến nhất của IIS là dịch vụ WWW (World Wide Web), nói tắt là dịch vụ Web.Dịch vụ Web sử dụng giao thức HTTP để tiếp nhận yêu cầu (Requests) của trình duyệt Web (Web browser) dưới dạng một địa chỉ URL (Uniform Resource Locator) của một trang Web và IIS phản hồi lại các yêu cầu bằng cách gửi về cho Web browser nội dung của trang Web tương ứng. oHTTP.sys nhận request mà client gửi lênoHTTP.sys liên lạc với WAS để nhận được những thông tin cấu hìnhoWAS yêu cầu thông tin cấu hình từ applicationHost.configoWWW service nhận thông tin cấu hìnhoWWW service sử dụng thông tin cấu hình để config HTTP.sysoWAS khởi động một worker processor trong application pool để xử lý requestoWorker processor xử lý request và gửi response cho HTTP.sysoHTTP.sys gửi response cho client.1.2Giới thiệu bộ đệm HTTP.sys (Hypertext transfer protocal stack)HTTP.sys là một subsystem trong hệ thống của Windows, chạy dưới chế độ nhân. HTTP.sys lắng nghe request trong network, chuyển request cho IIS xử lý, sau đó gửi response cho trình duyệt của client. Lới ích từ việc sử dụng HTTP.sys:oKernel mode caching: request và response được xử lý mà không cần chuyển qua chế độ người dùngoKernel mode request queuing: Thiết lập hàng đợi cho những requests, giúp IIS không bị quá tải khi xử lýoCác request sẽ được tiền xử lý và kiểm tra những vấn đề an ninh cơ bản.1.3Lỗ hổng CVE20151635a, Thông tin tin cơ bản:Lỗ hổng trong HTTP.sys có thể cho phép Mã Thực hiện từ xa được công bố vào tháng 4 năm 2015 và được Microsoft đánh giá là lỗ hổng cực kỳ nghiêm trọng.HTTP.sys tồn tại một lỗ hổng bảo mật khi nó xử lý không đúng cách một request mà attacker gửi lên. Một khi đã thành công trong việc khai thác lỗi, attacker có thể thực thi code trên máy tính của nạn nhânb, Những hệ thống bị ảnh hưởng bởi lỗ hổng HTTP.sysLỗ hổng bảo mật này được xếp hạng nghiêm trọng cho tất cả các phiên bản của Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, và Windows Server 2012 R2. Bảng đánh giá và xác định

HỌC VIỆN CÔNG NGHỆ BƯU CHÍNH VIỄN THÔNG KHOA AN TOÀN THÔNG TIN  BÁO CÁO MÔN HỌC AN TOÀN HỆ ĐIỀU HÀNH ĐỀ TÀI: Vulnerability in HTTP.sys Could Allow Remote Code Execution (CVE-2015-1635) Hà Nội, 2016 MỤC LỤC PHẦN I: GIỚI THIỆU 1.1 Giới thiệu cấu trúc IIS đệm HTTP.sys 1.2 Giới thiệu đệm HTTP.sys (Hypertext transfer protocal stack) 1.3 Lỗ hổng CVE-2015-1635 PHẦN II KHAI THÁC & TẤN CÔNG 2.1 Sử dụng phần mềm Metasploit để tìm kiếm thông tin 2.2 Kiểm tra cổng dịch vụ mở máy mục tiêu Sử dụng httpSYS.py để quét phát máy bị lỗi 12 2.3 Tấn công 13 PHẦN III Phòng chống 15 PHẦN IV Demo 16 PHẦN I: GIỚI THIỆU 1.1 Giới thiệu cấu trúc IIS đệm HTTP.sys A) Giới thiệu IIS: IIS viết tắt từ (Internet Information Services), đính kèm với phiên Windows IIS dịch vụ dành cho máy chủ chạy hệ điều hành Window nhằm cung cấp phân tán thông tin lên mạng, bao gồm nhiều dịch vụ khác Web Server, FTP Server… Nó sử dụng để xuất nội dung trang Web lên Internet/Intranet việc sử dụng “Phương thức chuyển giao siêu văn bản“ – Hypertext Transport Protocol (HTTP) Như vậy, sau bạn thiết kế xong trang Web mình, bạn muốn đưa chúng lên mạng để người truy cập xem chúng bạn phải nhờ đến Web Server, IIS Nếu không trang Web bạn xem máy bạn thông qua việc chia sẻ tệp (file sharing) tệp mạng nội mà Hiện IIS có phiên 3.0, 4.0, 5.1, 6.0, 7.0, 7.5 Nói chung cách cài đặt khó khác version Các điểm cải tiến IIS tập trung quanh vấn đề sử dụng mô hình thiết kế modul, chức quản lý dễ dàng, nâng cao tính bảo mật Phiên IIS bao gồm:  Windows Process Activation Service (WAS): thiết lập trang sử dụng giao thức HTTP HTTPS  Web server engine: thêm xóa module  Integrated request-processing: xử lý request từ IIS đến ASP.NET B) Hoạt động IIS Một dịch vụ phổ biến IIS dịch vụ WWW (World Wide Web), nói tắt dịch vụ Web Dịch vụ Web sử dụng giao thức HTTP để tiếp nhận yêu cầu (Requests) trình duyệt Web (Web browser) dạng địa URL (Uniform Resource Locator) trang Web IIS phản hồi lại yêu cầu cách gửi cho Web browser nội dung trang Web tương ứng o HTTP.sys nhận request mà client gửi lên o HTTP.sys liên lạc với WAS để nhận thông tin cấu hình o WAS yêu cầu thông tin cấu hình từ applicationHost.config o WWW service nhận thông tin cấu hình o WWW service sử dụng thông tin cấu hình để config HTTP.sys o WAS khởi động worker processor application pool để xử lý request o Worker processor xử lý request gửi response cho HTTP.sys o HTTP.sys gửi response cho client 1.2 stack) Giới thiệu đệm HTTP.sys (Hypertext transfer protocal HTTP.sys subsystem hệ thống Windows, chạy chế độ nhân HTTP.sys lắng nghe request network, chuyển request cho IIS xử lý, sau gửi response cho trình duyệt client Lới ích từ việc sử dụng HTTP.sys: o Kernel mode caching: request response xử lý mà không cần chuyển qua chế độ người dùng o Kernel mode request queuing: Thiết lập hàng đợi cho requests, giúp IIS không bị tải xử lý o Các request tiền xử lý kiểm tra vấn đề an ninh 1.3 Lỗ hổng CVE-2015-1635 a, Thông tin tin bản: Lỗ hổng HTTP.sys cho phép Mã Thực từ xa công bố vào tháng năm 2015 Microsoft đánh giá lỗ hổng nghiêm trọng HTTP.sys tồn lỗ hổng bảo mật xử lý không cách request mà attacker gửi lên Một thành công việc khai thác lỗi, attacker thực thi code máy tính nạn nhân b, Những hệ thống bị ảnh hưởng lỗ hổng HTTP.sys Lỗ hổng bảo mật xếp hạng nghiêm trọng cho tất phiên Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2 Bảng đánh giá xác định mức độ ảnh hưởng nghiêm trọng: Vulnerability Severity Rating and Maximum Security Impact by Affected Software Affected Software HTTP.sys Remote Code Execution Vulnerability - CVE-20151635 Aggregate Severity Rating Windows Windows for 32-bit Systems Service Pack (3042553) Critical Remote Code Execution Critical Windows for x64-based Systems Service Pack 3042553 Critical Remote Code Execution Critical Windows Server 2008 R2 for Itanium-Based Systems Service Pack (3042553) Critical Remote Code Execution Critical Windows Server 2008 R2 for x64-based Systems Service Pack (3042553) Critical Remote Code Execution Critical Windows for 32-bit Systems (3042553) Critical Remote Code Execution Critical Windows for x64-based Systems (3042553) Critical Remote Code Execution Critical Windows Server 2008 R2 Windows and Windows 8.1 Windows Server 2012 and Windows Server 2012 R2 Windows Server 2012 (3042553) Critical Remote Code Execution Critical Windows Server 2012 R2 (3042553) Critical Remote Code Execution Critical Server Core installation option Windows Server 2012 (Server Critical Critical Core installation) (3042553) Windows Server 2012 R2 (Server Core installation) (3042553) Remote Code Execution Critical Remote Code Execution Critical PHẦN II 2.1 KHAI THÁC & TẤN CÔNG Sử dụng phần mềm Metasploit để tìm kiếm thông tin Metasploit dự án bảo mật máy tính cung cấp thông tin vấn đề linỗ hổng bảo mật giúp đỡ kiểm tra thăm nhập phát triển hệ thống phát công mạng Metasploit Framework môi trường dùng để kiểm tra, công khai thác lỗi service Metasploit xây dựng từ ngôn ngữ hướng đối tượng Perl, với components viết C, assembler, Python Metasploit chạy hầu hết hệ điều hành: Linux, Windows, MacOS Chúng ta download chương trình www.metasploit.com Metasploit hỗ trợ nhiều giao diện với người dùng: – Console interface: dùng lệnh msfconsole Msfconsole interface sử dụng dòng lệnh để cấu hình, kiểm tra nên nhanh mềm dẻo – Web interface: dùng msfweb, giao tiếp với người dùng thông qua giao diện Web – Command line interface: dùng msfcli Metasploit Enviroment: – Global Enviroment: Được thực thi thông qua câu lệnh setg unsetg, options gán mang tính toàn cục, đưa vào tất module exploits – Temporary Enviroment: Được thực thi thông qua câu lệnh set unset, enviroment đưa vào module exploit load tại, không ảnh hưởng đến module exploit khác Chúng lưu lại enviroment cấu hình thông qua lệnh save Môi trường lưu /msf/config load trở lại user interface thực Sử dụng Metasploit Framework: - Chọn module exploit: Lựa chọn chương trình, dịch vụ lỗi mà Metasploit có hỗ trợ để khai thác Show exploits: xem module exploit mà framework có hỗ trợ Use exploit_name: chọn module exploit Info exploit_name: xem thông tin module exploit Chúng ta nên cập nhật thường xuyên lỗi dịch vụ module www.metasploit.com qua lệnh msfupdate svnupdat/opt/metasploit/msf3/ a, Cấu hình Module exploit chọn: show options: Xác định options cần cấu hình set: cấu hình cho option module Một vài module có advanced options, xem cách gõ dòng lệnh show advanceds b, Verify options vừa cấu hình: check: kiểm tra xem option set xác chưa c, Lựa chọn target: show targets: target cung cấp module set: xác định target d, Lựa chọn payload: show payloads: liệt kê payload module exploit info payload_name: xem thông tin chi tiết payload set payload payload_name: xác định payload module name Sau lựa chọn payload nào, dùng lệnh show options để xem options payload show advanced: xem advanced options payload e, Thực thi exploit: exploit: lệnh dùng để thực thi payload code Payload sau cung cấp cho thông tin hệ thống khai thác 2.2 Kiểm tra cổng dịch vụ mở máy mục tiêu Nmap (Network Mapper) công cụ mã nguồn mở miễn phí nhằm phát mạng kiểm toán an ninh Nmap Zenmap (Công cụ hỗ trợ đồ họa nmap) cài đặt sẵn BackTrack, sử dụng gói tin IP giúp xác định host có sẵn mạng, dịch vụ (tên ứng dụng phiên bản) mà host cung cấp, hệ điều hành (và phiên hệ điều hành) mà họ chạy, loại lọc gói tin tường lửa sử dụng, nhiều đặc điểm khác Nmap chạy tất hệ điều hành, gói nhị phân thức có sẵn cho Linux, Windows, Mac OSX Sau xác định host có mạng, ta sử dụng công cụ quét lỗi hệ thống để xác định lỗ hổng hệ thống muốn xâm nhập, từ khai thác truy cập vào hệ thống Một số công cụ quét lỗi Nessus Một xâm nhập thành công chiếm toàn quyền điều khiển hệ thống, Hacker thực việc máy nạn nhân down/upload files, thay đổi cấu trúc hệ thống, thực thi chương trình, đánh cắp mật khẩu, cài trojan/ backdoor … Sử dụng nmap: Sử dụng lệnh sau để kiểm tra: Nmap –p80 http-vuln-cve2015-1635.nse [IP] Sử dụng nmap chạy file http-vuln-cve2015-1635.nse để kiểm tra xem hệ thống có tồn lỗ hổng CVE-2015-1635 hay không: Source file http-vuln-cve2015-1635.nse: local shortport = require "shortport" local http = require "http" local stdnse = require "stdnse" local string = require "string" local vulns = require "vulns" description = [[Checks for a remote code execution vulnerability (MS15-034) in Microsoft Windows systems (CVE2015-2015-1635) The script sends a specially crafted HTTP request with no impact on the system to detect this vulnerability The affected versions are Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, and Windows Server 2012 R2 References: * https://technet.microsoft.com/library/security/MS15-034 ]] @usage nmap -sV script vuln @usage nmap -p80 script http-vuln-cve2015-1635.nse @usage nmap -sV script http-vuln-cve2015-1635 script-args uri='/anotheruri/' @output PORT STATE SERVICE REASON 10 80/tcp open http syn-ack | http-vuln-cve2015-1635: | VULNERABLE: | Remote Code Execution in HTTP.sys (MS15-034) | State: VULNERABLE (Exploitable) | IDs: CVE:CVE-2015-1635 | A remote code execution vulnerability exists in the HTTP protocol stack (HTTP.sys) that is | caused when HTTP.sys improperly parses specially crafted HTTP requests An attacker who | successfully exploited this vulnerability could execute arbitrary code in the context of the System account | | Disclosure date: 2015-04-14 | References: | https://technet.microsoft.com/en-us/library/security/ms15-034.aspx |_ http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1635 @args http-vuln-cve2015-1635.uri URI to use in request Default: / author = {"Kl0nEz", "Paulino "} license = "Same as Nmap See https://nmap.org/book/man-legal.html" categories = {"vuln", "safe"} portrule = shortport.http local VULNERABLE = "Requested Range Not Satisfiable" local PATCHED = "The request has an invalid header name" action = function(host, port) local uri = stdnse.get_script_args(SCRIPT_NAME ".uri") or "/" local vuln_report = vulns.Report:new(SCRIPT_NAME, host, port) local vuln = { title = 'Remote Code Execution in HTTP.sys (MS15-034)', state = vulns.STATE.NOT_VULN, description = [[ A remote code execution vulnerability exists in the HTTP protocol stack (HTTP.sys) that is caused when HTTP.sys improperly parses specially crafted HTTP requests An attacker who successfully exploited this vulnerability could execute arbitrary code in the context of the System account ]], IDS = {CVE = 'CVE-2015-1635'}, references = { 'https://technet.microsoft.com/en-us/library/security/ms15-034.aspx' }, 11 dates = { disclosure = {year = '2015', month = '04', day = '14'}, } } local options = {header={}} options['header']['Host'] = stdnse.generate_random_string(8) options['header']['Range'] = "bytes=0-18446744073709551615" local response = http.get(host, port, uri, options) if response.status and response.body then if response.status == 416 and string.find(response.body, VULNERABLE) ~= nil and string.find(response.header["server"], "Microsoft") ~= nil then vuln.state = vulns.STATE.VULN end if response.body and string.find(response.body, PATCHED) ~= nil then stdnse.debug2("System is patched!") vuln.state = vulns.STATE.NOT_VULN end end return vuln_report:make_output(vuln) end Sử dụng Python Sử dụng httpSYS.py để quét phát máy bị lỗi Source code: import socket import random import sys if len(sys.argv) [...]... 80/tcp open http syn-ack | http- vuln-cve2015-1635: | VULNERABLE: | Remote Code Execution in HTTP. sys (MS15- 034) | State: VULNERABLE (Exploitable) | IDs: CVE:CVE-2015-1635 | A remote code execution vulnerability exists in the HTTP protocol stack (HTTP. sys) that is | caused when HTTP. sys improperly parses specially crafted HTTP requests An attacker who | successfully exploited this vulnerability. .. title = 'Remote Code Execution in HTTP. sys (MS15- 034)' , state = vulns.STATE.NOT_VULN, description = [[ A remote code execution vulnerability exists in the HTTP protocol stack (HTTP. sys) that is caused when HTTP. sys improperly parses specially crafted HTTP requests An attacker who successfully exploited this vulnerability could execute arbitrary code in the context of the System account ]], IDS = {CVE... exploited this vulnerability could execute arbitrary code in the context of the System account | | Disclosure date: 2015-04-14 | References: | https://technet.microsoft.com/en-us/library/security/ms15-034.aspx |_ http: //cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-1635 @args http- vuln-cve2015-1635.uri URI to use in request Default: / author = {"Kl0nEz", "Paulino "}... response.status == 416 and string.find(response.body, VULNERABLE) ~= nil and string.find(response.header["server"], "Microsoft") ~= nil then vuln.state = vulns.STATE.VULN end if response.body and string.find(response.body, PATCHED) ~= nil then stdnse.debug2("System is patched!") vuln.state = vulns.STATE.NOT_VULN end end return vuln_report:make_output(vuln) end Sử dụng Python Sử dụng httpSYS.py để quét và phát... quét và phát hiện máy bị lỗi Source code: import socket import random import sys if len (sys. argv)

Ngày đăng: 24/11/2016, 10:46

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan