Microsoft Windows Security Resource Kit

Performing Security Assessments

In addition to comparing the security configuration of your Windows computers with the baseline security settings defined in security templates, you should assess your computers for common security misconfigurations. You can use different tools for security assessments, including the following:

Microsoft Baseline Security Analyzer

The MBSA tool allows you to assess the security configuration of one or more Windows-based computers. MBSA performs two major tasks:

Tests Performed

The MBSA tool can be executed from both a GUI and from the command line. Both versions of MBSA perform the tests outlined in this section.

Security Update Checks

MBSA performs checks for security updates and service packs released for the following Windows operating systems, Windows components, and applications:

Windows OS Tests

MBSA will perform various OS security checks for Windows NT 4.0, Windows 2000, and Windows XP target computers. The specific tests include the following:

IIS Tests

If any IIS components are installed on the target computer, MBSA performs a series of tests to detect common IIS security misconfigurations. These tests include the following:

Microsoft SQL Server Checks

MBSA scans for SQL Server security configuration issues if SQL Server is detected on a target computer. SQL Server tests are run against each SQL Server instance found on the computer. The specific tests include the following:

Desktop Application Checks

MBSA also checks for security issues with commonly used desktop applications. Specifically, MBSA scans for the following:

Requirements for Running MBSA

The requirements for running MBSA vary, depending on the type of scan you are performing and whether you are scanning the local computer or performing a scan against remote computers. To perform a security assessment of the local computer, the following requirements must be met:

Additional requirements exist when you perform a scan of a remote computer:

Requirements also exist for the target computers of the MBSA scan. The remote computer must meet the following requirements:

Performing Graphical MBSA Assessments

The primary reason for utilizing MBSA is to run security assessments from the GUI. To perform a scan against a single computer, the following procedure can be used:

  1. On the desktop, double-click the Microsoft Baseline Security Analyzer shortcut. By default, the MBSA icon is automatically placed on the desktop upon installation.

  2. On the Welcome To The Microsoft Baseline Security Analyzer screen, click Scan A Computer.

  3. On the Pick A Computer To Scan page, you must indicate the computer name or the IP address of the computer, a name for the resulting XML report, and the specific security tests to perform, as shown in Figure 24-2.

  4. Once the options are defined, click the Start Scan link. When the scan is complete, the results of the current scan are shown in the details pane and will include an overall security assessment.

    Figure 24-2. Defining scanning options for a single computer

You can choose to scan all computers in a specific domain or all computers within a specific IP subnet. The following procedure is used to scan multiple computers:

  1. On the desktop, double-click the Microsoft Baseline Security Analyzer shortcut.

  2. On the Welcome To The Microsoft Baseline Security Analyzer screen, click Scan More Than One Computer.

  3. On the Pick Multiple Computers To Scan page, you must indicate either the domain or the IP address range to scan, a name format for the resulting XML reports, and the specific tests to perform, as shown in Figure 24-3.

  4. When all options are defined, click the Start Scan link.

    Figure 24-3. Defining scanning options for a multiple computer scan

Once you complete either a single-computer or multiple-computer scan, the resulting reports are stored in XML format in the %UserProfile%\SecurityScans folder, where UserProfile is the full path of the user s profile folder. These reports are best viewed in the MBSA console by clicking the View Existing Security Reports link on the Welcome page.

If a scan is performed against an entire domain or IP subnet, an individual report is produced for each detected computer.

Performing Text-Based MBSA Assessments

To perform a text-based MBSA assessment, you must use the text-based version of MBSA, Mbsacli.exe. This version of MBSA performs security assessments of either a single computer or multiple computers from a command prompt. The results are stored in XML format output files that can be viewed in the graphical version of the MBSA.

The command-line options for Mbsacli.exe include the following:

For a complete listing of all Mbsacli.exe command-line switches, see the MBSA Help file, available from the Welcome screen of the MBSA graphical tool.

For details on using the Mbsacli.exe text-based tool to scan for security updates by using a HfNetChk-style scan, see the Scanning for Updates with the Command-Line Version of MBSA section in Chapter 23.

Third-Party Tools

Third-party tools also perform network security assessments. These tools offer downloadable updates for new security issues and provide more tests than those currently offered by MBSA.

You might consider using the following tools to perform security assessments:

Port Scanning

Another common security assessment task is to determine which ports are open to the Internet. Attackers can use port information to determine which services are accessible from the Internet. A port scanner inspects a target computer on the network and probes each port to determine whether the target computer is listening for connections on the scanner ports. A port scanner also identifies which ports are available to the scanner.

As part of your network security assessment, you should periodically perform external scans of your network to ensure that only authorized ports are exposed to the Internet. For example, if you perform a scan against the IP address of your company s Web server, the only ports open should be the ports for HTTP on TCP port 80 and for Secure Sockets Layer protected HTTP on TCP port 443. Assuming you are not running any other services on the Web server, no other ports should be visible.

Common Windows Ports

When you perform a port scan, the main goal is to identify all open ports on the target computer. Ideally, if the computer is exposed to the Internet, the only exposed ports will be those the firewall publishes to the Internet.

When performing port scans, it is useful to identify common ports used by Windows and Windows services. Some of the more common ports on Windows 2000 Servers are listed in Table 24-2.

The ports listed in Table 24-2 are the listening ports at a server. Typically, a client computer will use a random Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) port above port 1023 when connecting to the server s listening port.

Table 24-2. Common Windows Ports

Port

Application

TCP port 20

FTP data

TCP port 21

FTP control

TCP port 23

Telnet

TCP port 25

Simple Mail Transfer Protocol (SMTP)

TCP port 53

Domain Name System (DNS) zone transfer

UDP port 53

DNS name resolution

UDP port 67

Dynamic Host Configuration Protocol (DHCP) server

UDP port 68

DHCP client

TCP port 80

HTTP

TCP port 88/UDP port 88

Kerberos authentication

TCP port 110

Post Office Protocol version 3 (POP3)

TCP port 119

Network News Transfer Protocol (NNTP)

UDP port 123

Network Time Protocol (NTP)

TCP port 135/UDP port 135

Microsoft remote procedure calls (RPCs)

UDP port 137

NetBIOS Name Service

UDP port 138

NetBIOS Datagram Service

TCP port 139

NetBIOS Session Service

TCP port 143

Internet Message Access Protocol (IMAP) version 4

UDP port 161

Simple Network Management Protocol (SNMP)

UDP port 162

SNMP traps

TCP port 389/UDP port 389

Lightweight Directory Access Protocol (LDAP)

TCP port 443

Hyper Text Transfer Protocol with Secure Sockets Layer (HTTPS)

TCP port 445/UDP port 445

Microsoft Common Internet File System (CIFS)

TCP port 464/UDP port 464

Kerberos password

UDP port 500

Internet Key Exchange (IKE) for IP Security (IPSec)

TCP port 563

NNTP with Secure Sockets Layer (SSL)

TCP port 636

LDAP with SSL (LDAPS)

TCP port 993

IMAP4 SSL

TCP port 995

POP3 SSL

TCP port 1433

SQL Server

UDP port 1701

Layer Two Tunneling Protocol (L2TP)

TCP port 1723

Point-to-Point Tunneling Protocol (PPTP)

UDP port 1812

Remote Authentication Dial-In User Service (RADIUS) authentication

UDP port 1813

RADIUS accounting

UDP port 2504

Microsoft Network Load Balancing (NLB) service remote control

TCP port 3268

LDAP Global Catalog

TCP port 3269

LDAP Global Catalog with SSL

TCP port 8080

Microsoft Internet Security and Acceleration (ISA) Server proxy port

For a complete listing of assigned port numbers, see the Internet Assigned Numbers Authority (IANA) Web site at http://www.iana.org/assignments/port-numbers.

Determining Open Ports on the Local Computer

On the local computer, you can use the Netstat.exe command-line tool to show all open TCP and UDP ports. To show all open ports on the current computer, you can use the following Netstat command syntax:

Netstat a n

The -a indicates that all TCP and UDP listening ports are enumerated. The -n forces the output to show the actual open port numbers, rather than translating the port numbers to protocol names from the %swindir%\system32\ drivers\etc\services file.

If you are running Netstat on a Windows XP based computer, you can also use the -o switch, which shows the process that is listening on each open port. This can help identify rogue applications on the local computer.

Determining Open Ports on a Remote Computer

When performing security assessments, you can use a port scanner from the Internet to ensure that only required ports are open on an externally accessible server, such as a Web server.

To perform the port scan, you must acquire a port scanner from a third-party source, such as the Prosolve WinScan 2.0. In its most basic form, a port scanner will scan a designated computer to determine which ports are open on the target computer.

Depending on the manufacturer, a port scanner might also attempt attacks that target known vulnerabilities with open ports. For example, if TCP port 139 (the NetBIOS Session Service) is detected by the port scan, a port scanner might attempt to enumerate shares on the target server.

To scan a computer with Prosolve Winscan 2.0, use the following procedure:

  1. From the Start menu, point to Programs, point to Prosolve, point to WinScan 2.0, and then click Winscan 2.0. (See Figure 24-4.)

  2. In the Target section of the Winscan window, enter the Host/IP and Netmask for the port scan.

  3. In the Operation section of the Winscan window, click Scan.

  4. In the Port Range section, enter the Start and End port numbers for the scan.

  5. In the Options section, enable both the TCP and UDP options. You can increase the speed of the scan by disabling the Prescan option.

  6. Click Start Scan to start the port scan of the target computer.

    Figure 24-4. The Prosolve Winscan 2.0 port scanner

    Other freeware port scanners are available on the Internet. These include the Foundstone SuperScan v3.0 utility (http://www.foundstone.com/knowledge/scanning.html) and Portqry.exe (http://www.microsoft.com/downloads/release.asp? ReleaseID=37344), a command-line port scanner from Microsoft.

Категории