Microsofts etwas betagter Webserver, oder genauer: dessen FTP-Dienst – ist angreifbar. Mittels inzwischen relativ übersichtlich zusammengestellter Skripte und Videoanleitungen lassen sich verwundbare Server aufspüren und attackieren.
Das nachfolgende Skript für den Portscanner Nmap stammt von den Entwicklern hinter dem als “Hacker-Linux” bekannt gewordenen Backtrack und spürt verwundbare Webserver mit IIS 5 oder 6 auf.
--- 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)
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.
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))
try(socket:send("USER anonymous\r\n"))
try(socket:send("PASS IEUser@\r\n"))
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
In die so ermittelten Server kann man mittels Exploit eindringen.
Dabei werden zwei Verzeichnisse angelegt und anschließend der Befehl NLST ausgeführt – Voraussetzung ist natürlich, dass eine Schwachstelle besteht: nämlich Schreibzugriff für einen anonymen Nutzer.
Dieses Video bei Offensive Security ansehen
Microsoft stellt für die Lücke noch keinen Patch bereit. Das Problem sei bekannt, sagte ein Sprecher, wie es genau funktioniere, müsse man aber noch herausfinden.
Solange das Problem besteht, sollen Administratoren den Schreibzugriff für anonyme Nutzer einfach deaktivieren.