Archive

Archive for the ‘Windows 2008 (R2)’ Category

Wireshark: Determining a SMB and NTLM version in a Windows environment

February 3, 2011 4 comments

The last few days I am playing around with wireshark and I must say I enjoy working with this program. It has saved the day for me a couple of times by giving me information that is only retrieved by looking at packet level. In this article I was looking at SMB and NTLM traffic in a windows environment. I noticed that our XP based network was running NTLMv1 that is considered unsecure. Let’s change this fast !

Intro

NTLM over a Server Message Block (SMB) transport is one of the most common uses of NTLM authentication and encryption. Kerberos Protocol Extensions (KILE) is the preferred authentication method of an SMB session in Windows Server operating system and Windows Client operating systems. However, when a client attempts to authenticate to an SMB server using the KILE protocol and fails, it can attempt to authenticate with NTLM.

The NT LAN Manager (NTLM) Authentication Protocol is used in Microsoft Windows Networks for authentication between clients and servers.  NTLM is used by application protocols to authenticate remote users and, optionally, to provide session security when requested by the application. There are two major variants of the NTLM authentication protocol: the connection-oriented variant and the connectionless variant. Each of these variants has three versions: LM, NTLMv1, and NTLMv2.  In addition to authentication, the NTLM protocol optionally provides for session security—specifically message integrity and confidentiality through signing and sealing functions in NTLM. For more in depth information I urge you to read this Microsoft NTLM documentation. The following picture will show a protocol flow of NTLM and Simple and Protected Generic Security Service Application Program Interface Negotiation Mechanism (SPNEGO) authentication of an SMB session.

Step 1 and 2 – The SMB protocol negotiates protocol-specific options using the SMB_COM_NEGOTIATE request and response messages. The client will send its supported dialects and the server will respond with the highest possible dialect. The following dialect values are possible (older dialects are excluded here):

Step 3 – The client sends an SMB_COM_SESSION_SETUP_ANDX request message. Assuming that NTLM authentication is negotiated, within this message an NTLM NEGOTIATE_MESSAGE is embedded.

Step 4 – The server responds with an SMB_COM_SESSION_SETUP_ANDX response message within which an NTLM CHALLENGE_MESSAGE is embedded. The message includes an 8-byte random number, called a “challenge”, that the server generates and sends in the ServerChallenge field of the message.

Step 5 – The client extracts the ServerChallenge field from the NTLM CHALLENGE_MESSAGE and sends an NTLM AUTHENTICATE_MESSAGE to the server (embedded in an SMB_COM_SESSION_SETUP_ANDX request message). If the challenge and the response prove that the client knows the user’s password, the authentication succeeds and the client’s security context is now established on the server.

Step 6 – The server sends a success message embedded in an SMB_COM_SESSION_SETUP_ANDX response message.

Wiresharking

This article will only show how to find out which SMB and NTLM versions are used on your windows servers and windows clients while using Wireshark. This is very useful to know because it has a great impact on your security. There are many documents on the internet that show that LM and NTLMv1 are insecure these days therefore we need to ensure that these authentication methods are not allowed inside the windows network. Thus we need to ensure that NTLMv2 only is allowed. This behavior can be changed on windows servers and clients at the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

REG_DWORD Valuename: lmcompatibilitylevel

The following values can be used:

So you’re actually configuring a minimum security level here. Now let’s take a look which values are used by default per OS type:

We can conclude that if we have an XP client and a windows 2008 R2 server with default settings it will always use NTLMv1. If we use an Windows 7 or Vista client and a windows 2008 R2 server it will use NTLMv2. Lets fire up Wireshark and take a look what’s happening “on the wire”.

Windows XP client and Windows 2008 R2 server (default settings)

In this scenario a Windows XP client (10.0.0.2) tries to connect to a Windows 2008 R2 Server (10.0.0.1) share. Let’s take a look at the SMB negotiate protocol request:

The highest possible dialect that the Windows XP client can speak is NT LM 0.12. Thus SMB v1.0. Let’s take a look how the Windows 2008 R2 server will respond:

The Windows 2008 R2 server responds its capable of SMB v1.0 (NT LM 0.12) and this is used to access the share. Let’s take a look which version of NTLM it uses by looking at the Session setup andX request: NTLMSSP_AUTH packet.

There is no NTMLv2 section here so it is using NTLMv1. Thus insecure !!

Windows 7 client and Windows 2008 R2 server (default settings)

In this scenario a Windows 7 Client (10.0.0.3) tries to connect to a Windows 2008 R2 Server (10.0.0.1) share. Let’s take a look at the SMB negotiate protocol request:

The highest possible dialect that the Windows 7 client can speak is SMB 2.???. Thus SMB v2.0 Wildcard. Let’s take a look how the Windows 2008 R2 server will respond:

The Windows 2008 R2 server responds its capable of 0x02ff (hexadecimal value for SMBv2.0 wildcard). You can also see that the protocol column switches from SMB to SMB2. Now the Windows 7 clients needs to know which SMB2 version will be used for communication. . Let’s take a look at the new SMB2 negotiate protocol request:

The highest possible SMB2 dialect that the Windows 7 client can speak is more specific now. It can use 0x0202 or 0x0210. Thus SMB v2.002 or SMB v2.1. Let’s take a look how the Windows 2008 R2 server will respond:

The Windows 2008 R2 server responds its capable of 0x210 (hexadecimal value for SMBv2.1) and this is used to access the share. Let’s take a look which version of NTLM it uses by looking at the Session setupRequest, NTLMSSP_AUTH packet.

The picture clearly shows that there is an NTLMv2 response.

Is there a quicker way to determine NTLMv1 or NTLMv2 authentication? Yes. We can do this by entering ntlmssp.ntlmv2response into the filter field. Wireshark will filter out ntlmv2 traffic only.

Back to our little problem. We have a network running with XP clients and windows 2008 R2 server with default settings on GPO level. We saw that NTLMv1 will be used for authentication and thus insecure. We need to change this so the XP machines will authenticate by using NTLMv2. We can achieve this by change the Lmcompatibilitylevel value to 5. The best way to achieve this is by placing all Windows XP clients into an OU and configure a computer GPO policy.

Before you change the server side to Lmcompatibilitylevel value 5 you must be absolutely sure that every Windows XP Client uses NTLMv2 or your phone will start ringing very often. You can achieve this by changing the default domain controllers policy or by placing a GPO on an OU with servers. When the server and client side are changed to NTLMv2 you have achieved the highest NTLM authentication possible. Thus the most secure NTLM form possible. This ends my article about Determining a SMB and NTLM version in a windows environment. I hope it’s useful somehow and feel free to comment.

Install & Configure Forefront TMG Back to Back solution with Exchange 2010 Part 3

January 15, 2011 2 comments

This is the last article of the three part series on how to to Install & Configure Forefront TMG Back to Back solution with Exchange 2010. In the first one I explained the network setup, network relationships, the TMG backend and TMG Frontend installations and some simple firewall rules. In the second part we went through on how to configure OWA for exchange 2010, web publishing rules, and incoming and outgoing SMTP mail. This last article will explain how to setup Exchange ActiveSync and Exchange Outlook Anywhere and autodiscover.

Configuring Exchange Outlook Anywhere and autodiscover

In Microsoft Exchange Server 2010, the Outlook Anywhere feature, formerly known as RPC over HTTP, lets clients that use Microsoft Office Outlook 2010, Outlook 2007, or Outlook 2003 connect to their Exchange servers from outside the corporate network or over the Internet using the RPC over HTTP Windows networking component. The Windows RPC over HTTP Proxy component, which Outlook Anywhere clients use to connect, wraps remote procedure calls (RPCs) with an HTTP layer. This allows traffic to traverse the TMG firewalls without requiring RPC ports to be opened.

requirements:

  • A SAN certificate with your companies webmail address should reside on the exchange 2010 and TMG-BE boxes. (the SAN certificate should include webmail.test.com AND autodiscover.test.com AND autodiscover.test.local AND exchange2010.test.local (exchange server name)
  • In the forward lookup zone test.com on the DC1 server create a new A record called autodiscover.test.com that points to 10.4.20.20
  • In the forward lookup zone test.local on the DC1 server create a new A record called autodiscover.test.local that points to 10.4.20.20
  • At your provider you should create a DNS record that points autodiscover.test.com to ISP IP4

Create the rules on the TMG-FE

  • Rule Name : Publish Exchange 2010 Autodiscover and Outlook Anywhere – HTTPS (non-web publishing rule)
  • Server IP : 10.6.0.3
  • Protocol : HTTPS Server
  • Listener IP Address : External Interface IP : ISP IP4 only
  • Make sure you enable : requests appear from original client

Create the rules on the TMG-BE

  • Name : Publish Exchange 2010 Autodiscover and Outlook Anywhere (Exchange Client Access rule)
  • Rule number : below OWA 2010 rule
  • Exchange version : exchange 2010
  • Mail services : Outlook Anywhere (RPC/HTTPs) and enable folders
  • Rule action : Allow
  • Publishing Type : single website
  • Server Connection Security : SSL
  • Internal Sitename : webmail.test.com
  • Ip Address : 10.4.20.20
  • Request appear to come from TMG
  • Public name details : autodiscover.test.com
  • Create New Listener
  • Web Listener Name : HTTPS Autodiscover
  • Client Connection Security : SSL (HTTPS)
  • Web Listener IP Address : Perimeter Interface IP : 10.6.0.3 only
  • Certificate : webmail.test.com
  • Authentication Settings : HTTP Form authentication
  • Validation : Windows (active directory)
  • SSO : disabled
  • Authentication Delegation : Basic authentication
  • User Set : All authenticated users group

Configuring Exchange ActiveSync

Exchange ActiveSync is a Microsoft Exchange synchronization protocol that’s optimized to work together with high-latency and low-bandwidth networks. The protocol, based on HTTP and XML, lets mobile phones access an organization’s information on a server that’s running Microsoft Exchange. Exchange ActiveSync enables mobile phone users to access their e-mail, calendar, contacts, and tasks and to continue to be able to access this information while they’re working offline.

Create the rules on the TMG-FE

  • None needed

Create the rules on the TMG-BE

  • Name : Publish Exchange 2010 Activesync (Exchange Client Access rule)
  • Rule Number : Below OWA 2010 and Outlook Anywhere rule
  • Exchange version : Exchange 2010
  • Mail services : Activesync
  • Publishing Type : single website
  • Server Connection Security : SSL
  • Internal Sitename : webmail.test.com
  • Ip Address : 10.4.20.20
  • Request appear to come from TMG
  • Public name details : webmail.test.com
  • Listener : HTTP(S) OWA 2010 (created in part 2)
  • Authentication Delegation : Basic authentication
  • User Set : All authenticated users group

Now we are able to connect to our Exchange 2010 server via OWA, PDA/Smartphones and outlook 2003/2007/2010 clients. You can test your configuration by going to a microsoft test site and run some test here. You might have noticed i didn’t speak much on how to configure the exchange side of things. However there are some good sites that explain it all:

This concludes my three part article on how to install & configure Forefront TMG Back to Back solution with Exchange 2010. I hope its usefull for you and feel free to comment.

Install & Configure Forefront TMG Back to Back solution with Exchange 2010 Part 2

January 14, 2011 5 comments

This article is the second part of my series about Installing and configuring Forefront TMG back to Back with Exchange 2010. In the first one I explained the network setup, network relationships, the TMG backend and TMG Frontend installations and some simple firewall rules. In the second part we will be configuring OWA for exchange 2010, web publishing rules, and incoming and outgoing SMTP mail.

Configuring OWA for exchange 2010 with FBA

Forms-based authentication(FBA) is one of the cool features that is included in the TMG software. The FBA enables the TMG’s capablility to enable the OWA logon form on the TMG firewall instead of enabling it on the exchange 2010 box. It enables you to force authentication on the TMG firewall before packets are forwared to the exchange 2010 box. If you want to create a fancy FBA logon page then check my post here.

requirements:

  • FBA should be disabled on the exchange 2010 box.
  • The TMG firewall that needs FBA needs to be joined to the domain. (thus we use the TMG-BE)
  • A SAN certificate with your companies webmail address should reside on the exchange 2010 and TMG-BE boxes. (the SAN certificate should include something like webmail.test.com)
  • A new forward lookup zone should be configured on the DC1 server named test.com. Create a new A record called webmail.test.com that points to 10.4.20.20
  • At your provider you should create a DNS record that points webmail.test.com to ISP IP2

We want to make OWA dummy proof. Experience shows that users often forget the default URL https://webmail.test.com/owa . Users should be able to type the URL with HTTP or HTTPS and with or without /owa. So lets create the rules on the TMG-FE first :

  • Rule Name : Publish Outlook Webmail Apps 2010 (OWA) – HTTP    (choose non-web publishing rule)
  • Rule Number : 1
  • Rule action : Allow
  • Server IP : 10.6.0.2 (secondary ip on the TMG-BE external interface)
  • Create New Protocol :  HTTP Server on Port 80 inbound
  • Listener IP Address : External Interface IP : ISP IP2 only
  • Make sure you enable : requests appear from original client
  • Rule Name : Publish Outlook Webmail Apps 2010 (OWA) – HTTPS    (choose non-web publishing rule)
  • Rule Number : 2
  • Server IP : 10.6.0.2
  • Protocol : HTTPS Server
  • Listener IP Address : External Interface IP : ISP IP2 only
  • Make sure you enable : requests appear from original client

Create the rules on the TMG-BE

  • Name : Publish Outlook Webmail Apps 2010 Redirect (OWA) (Choose Exchange Client Access rule)
  • Rule Number : 1
  • Exchange version : exchange 2010
  • Mail services : OWA
  • Rule action : Deny
  • Redirect to : https://webmail.test.com/owa
  • Publishing Type : single website
  • Server Connection Security : SSL
  • Internal Sitename : webmail.test.com
  • Ip Address : 10.4.20.20
  • Request appear to come from TMG
  • Public name details : webmail.test.com
  • Create New Listener
  • Web Listener Name : HTTP(S) OWA 2010
  • Client Connection Security : SSL (HTTPS en HTTP)
  • Enable redirection http to https
  • Web Listener IP Address : Perimeter Interface IP : 10.6.0.2 only
  • Certificate : webmail.test.com
  • Authentication Settings : HTML Form authentication
  • Validation : Windows (active directory)
  • SSO : disabled
  • Authentication Delegation : basic authentication
  • User Set : All authenticated users group
  • Edit the newly reated rule ang go to the paths tab
  • Change it to the following:

  • Name : Publish Outlook Webmail Apps 2010 (OWA) (Choose Exchange Client Access rule)
  • Rule Number : 2
  • Exchange version : exchange 2010
  • Mail services : OWA
  • Rule action : ALLOW
  • Publishing Type : single website
  • Server Connection Security : SSL
  • Internal Sitename : webmail.test.com
  • Ip Address : 10.4.20.20
  • Request appear to come from TMG
  • Public name details : webmail.test.com
  • Web Listener Name : HTTP(S) OWA 2010
  • Authentication Delegation : basic authentication
  • User Set : All authenticated users group
  • Edit the newly created rule ang go to the paths tab
  • Change it to the following:

  • on the TO tab make sure you enable : requests  from Forefront TMG

Outlook Web Access 2010 should work just fine by now. Just test it by accessing it remotely.

Configuring webserver access internally and remotely

Users need to access the webserver from outside the network but also from inside the corporate network. To accomplish this you need to config the following:

  • in the new forward lookup zone create a new A record called http://www.test.com that points to 10.6.10.10
  • At your provider you should create a DNS record that points http://www.test.com to ISP IP1
  • The default gateway of the webserver points to the internal interface of the TMG-FE. So the webserver does not know the route to VLAN1, VLAN2, VLAN3, VLAN4 and VLAN5. Therefore you need static routes on the webserver to access those networks.

Create the rule on the TMG-FE first :

  • Rule Name ; Publish HTTP traffic to the webserver (choose web publishing rule)
  • Rule Number : 2
  • Rule action : Allow
  • Publishing Type : single website
  • Server Connection Security : NON-SSL
  • Internal Sitename : http://www.test.com
  • Ip Address : 10.6.10.10
  • Path : /*
  • Public Name : http://www.test.com
  • Path : /*
  • Create New Listener
  • Web Listener Name : HTTP WWW
  • Client Connection Security : NON-SSL
  • Web Listener IP Address : External Interface IP : ISP IP1 only
  • Authentication Settings : None
  • Authentication Delegation : No delegation, client cannot authenticate
  • User Sets : All Users

Create the rule on the TMG-BE :

  • Name : Allow HTTP(s), RDP, FTP traffic to the webserver (choose access rule)
  • Rule Number : place above normal http traffic rule
  • Rule Action : Allow
  • Protocols : HTTP, HTTPS, RDP, FTP
  • From : Internal Networks
  • To : Webserver
  • User Sets : All Users

Now you are done !. We achieved access to the webserver from the outside world and from the internal corporate network.

Configuring inbound and outbound mail (SMTP)

Since we are hosting our mail solution internally we need to achieve inbound and outbound mail traffic.

requirement:

  • At your provider you should create a MX DNS record that points mail.test.com to ISP IP3
  • The default gateway of the barracuda points to the internal interface of the TMG-FE. Therefore it does not know the route to the 10.4.x.x network. We need to add a static route on the Barracuda. If you have a 600 model or higher you can add the static route right away. However if you have a 400 model that option is not available. If you contact barracuda support they will enable that option for you.

Create the rule on the TMG-FE first :

  • Name : Publish mail traffic to antispam firewall (mail publishing rule)
  • Rule Number : place on top
  • Access Type : Server to server communication SMTP,NNTP
  • Services : SMTP (custom SMTP server protocol port 25 inbound with SMTP filter disabled)
  • From : Anywhere
  • Server IP Address : 10.6.20.20 (the barracuda)
  • Network Listener IP Address : External Interface  IP : ISP IP3 only
  • Make sure you enable : requests appear from original client

Create the rule on the TMG-BE :

  • Name : Allow mail traffic to internal LAN (choose access rule)
  • Rule Number : place on top
  • Rule Action : Allow
  • Protocols : SMTP
  • From : Barracuda
  • To : Exchange 2010
  • User Sets : All Users
  • Name : Allow mail traffic to outside (choose access rule)
  • Rule Number : place on top
  • Rule Action : Allow
  • Protocols : SMTP
  • From : Exchange 2010
  • To : external
  • User Sets : All Users

This concludes my second part of these series about Installing and configuring Forefront TMG Back to Back solution with Exchange 2010. The final part of these series will include Activesync and Outlook Anywhere. I hope its usefull for you and feel free to comment.

Install & Configure Forefront TMG Back to Back solution with Exchange 2010 Part 1

January 13, 2011 22 comments

Last year I wrote a 2 part article on how to install and configure an Forefront TMG back to back solution with OWA 2003. A few weeks ago we migrated to Exchange 2010 so I thought to write this up again. In these articles I am explaining on how to implement this in your company. It will be a 3 part article. In the first one I will explain the network setup, network relationships, the TMG backend and TMG Frontend installations and some simple firewall rules. In the second part we will be configuring OWA for exchange 2010, web publishing rules, and incoming and outgoing SMTP mail. The 3rd article will explain how to setup Exchange Activesync and Exchange Outlook Anywhere. For this article we are going to use the following network setup:

This is a simple setup that is used in many companies and universities. The Backend TMG firewall (TMG-BE) will be installed and joined to the domain (test.local) and the Frontend TMG firewall (TMG-FE) will be installed and joined to a workgroup (WORKGROUP). Our company website is hosted on the webserver and will be available for the ouside world. The Barracuda Appliance will listen to incoming SMTP mail and will be used for Spam filtering and virus checking. After this check the mail will be forwarded to the Exchange 2010 Server. Outlook Web Access (OWA), Activesync and Outlook Anywhere will be made available as well.

TMG network relationships

An important issue to understand is how network relationships work in an Back to Back solution. Dr. Thomas W. Shinder made some great articles about this and i highly recommend reading them. They can be found here. For our network setup we use the following network relationships:

As you can see we will use an ROUTE relation ship between the internal network and the DMZ network (configured on the TMG-BE). And we will use an NAT relationship between the DMZ and External segment (configured on the TMG-FE). Its also important to understand that there is a NAT relationship between the internal network and the external network (configured on the TMG-BE). For ROUTE relationships you need to use access rules (from inside to outside and from oputside to inside). For NAT relationships you need to use access rules (from inside to outside) and publishing rules (from outside to inside). As said normally…… Its not widely known that you can use publising rules on a route relationship as well. We are going to use one when we are going to configure OWA.

Its also important to understand whats internal and external regarding to the TMG firewalls. For the TMG-BE it looks like this:

The TMG-BE will see VLAN1, VLAN2, VLAN3, VLAN4, VLAN5 as the INTERNAL network. it will see VLAN6 as the PERIMETER network and VLAN7 as the EXTERNAL network. For the TMG-FE it will look like this:

The TMG-FE will see VLAN1, VLAN2, VLAN3, VLAN4, VLAN5 and VLAN6 as the INTERNAL network and VLAN7 as the EXTERNAL network. For our article we will use the following ip adressing scheme:

Installing the TMG-BE

 Before you install TMG 2010 on your machine make sure that:

  • You renamed you internal NIC to something like Internal and you external NIC to something like DMZ.
  • You entered all appropriate information in all NICs (according to the ip addressing scheme)
  • You joined the TMG-BE to the domain
  • Increase performance by changing the value at HKEY_LOCAL_MACHINE\System\CurrentControlSet\NetBT\Parameters. Change NodeType to value 2 (REG_DWORD)
  • Update system with latest service packs and updates

Ok. lets start the TMG 2010 Back-End installation:

  • Start the TMG 2010 installation and choose to run the Preparation Tool
  • Select Forefront TMG services and Management en wait untill everything is complete
  • The Forefront TMG installation will start
  • Enter your username, company name and serial number
  • Enter the installation path to your liking
  • Now we need to enter the internal network for the TMG-BE. Remember we spoke of this before. We need to enter all subnet ips from VLAN1, VLAN2, VLAN3, VLAN4, VLAN5.

  • Start TMG-KB981324-AMD64-ENU.MSP to install  TMG 2010 Service Pack 1.
  • Start TMG-KB2288910-AMD64-ENU.exe to install Update 1 for Service Pack 1.
  • Start the TMG MMC and select Configure network settings
  • Select BACK FIREWALL and the INTERNAL adapter as Local Area Network
  • In the same window we need to add some static routes. The internal interface of the TMG-BE does not have a default gateway configured. We need to tell the TMG-BE how to reach VLAN1, VLAN2, VLAN3 and VLAN4. The gateway configured on the core switch will be 10.5.0.1. Lets add 4 static routes:

  • Select the DMZ interface as the PERIMETER network adapter and choose a private (ROUTE) relationship
  • Select configure system settings and leave everything as default
  • Select define deployment options and enter licenses if applicable
  • Close the getting started wizard

Installing TMG-FE

Before you install TMG 2010 on your machine make sure that:

  • You renamed you internal NIC to something like DMZ and you external NIC to something like INTERNET.
  • You entered all appropriate information in all NICs (according to the ip addressing scheme)
  • You joined the TMG-FE to a workgroup
  • Increase performance by changing the value at HKEY_LOCAL_MACHINE\System\CurrentControlSet\NetBT\Parameters. Change NodeType to value 2 (REG_DWORD)
  • Update system with latest service packs and updates

Ok. lets start the TMG 2010 Front-End installation:

  • Start the TMG 2010 installation and choose to run the Preparation Tool
  • Select Forefront TMG services and Management en wait untill everything is complete
  • The Forefront TMG installation will start
  • Enter your username, company name and serial number
  • Enter the installation path to your liking
  • Now we need to enter the internal network for the TMG-FE. We need to enter all subnet ips from VLAN1, VLAN2, VLAN3, VLAN4, VLAN5 and VLAN6.

  • Start TMG-KB981324-AMD64-ENU.MSP to install  TMG 2010 Service Pack 1.
  • Start TMG-KB2288910-AMD64-ENU.exe to install Update 1 for Service Pack 1.
  • Start the TMG MMC and select Configure network settings
  • Select EDGE FIREWALL and the DMZ adapter as Local Area Network
  • In the same window we need to add some static routes. The internal interface of the TMG-FE does not have a default gateway configured. We need to tell the TMG-FE how to reach VLAN1, VLAN2, VLAN3, VLAN4 and VLAN5. The gateway configured for the routes will be the external interface of the TMG-BE (10.6.0.1) Lets add 5 static routes:

  • Choose the INTERNET networkadapter for the ISP connection
  • Select configure system settings and leave everything as default
  • Select define deployment options and enter licenses if applicable
  • Close the getting started wizard

Configuring the TMG-BE

  • Start the TMG MMC and goto Forefront TMG (TMG-BE) – Networking – Networks tab
  • Richtmouseclick on the internal networks and choose properties – choose the domains tab
  • In the domain names box add: *.test.local
  • Choose the webbrowser tab and change the following:
  • Enable Bypass proxy for webservers in this network
  • Enable directly access computers specified in the domains tab
  • Enable directly access computers specified in the addresses tab
  • Choose the Autodiscovery tab and enable publish automatic discovery
  • Configure your DNS and DHCP server for WPAD – read here
  • Lets create some firewall rules to allow DNS, HTTP, HTTPS and FTP traffic.
  • Goto Forefront TMG (TMG-BE) – Firewall Policy – Create access rule

Create the following rules:

  • Rule Name : Allow DNS traffic from DC1
  • Rule Number : 1
  • Protocols : DNS
  • From : DC1
  • To : External
  • User Sets : All users
  • Rule Name : Allow HTTP, HTTPS, FTP traffic
  • Rule number : 2
  • Protocols : HTTP, HTTPS, FTP
  • From : Internal Network
  • To : External Network
  • User Sets : All authenticated users

Configuring the TMG-FE

  • Start the TMG MMC and goto Forefront TMG (TMG-FE) – Intrusion Prevention System – Behavorial Intrusion Detection tab – choose configure Flood Mitigation settings – IP exceptions tab
  • Since there is a NAT relationship between the internal network and external network on the TMG-BE the source ip will be changed to the TMG-BE external interface. So when the packet arrives at the TMG-FE internal interface it will see alot of traffic coming from one ip address. Therefore we must add the external interface from the TMG-BE to the ip exceptions tab or else the TMG-FE will drop traffic.
  • Goto Forefront TMG (TMG-FE) – Firewall Policy – Create access rule

Create the following rule:

  • Rule Name : Allow all traffic from TMG-BE
  • Rule number : 1
  • Protocols : All protocols
  • From : TMG-BE (external interface ip) 
  • To : External Network
  • User Sets : All users

Now you can test your created rules by starting a webbrowser session from the DC1. In part 2 of this article we are going to configure OWA for exchange 2010, web publishing rules, and incoming and outgoing SMTP mail. Feel free to comment on this article.

Install & Configure Forefront TMG Back to Back solution Part 2

November 5, 2010 2 comments

This article is the second and last part of my series about Installing and configuring Forefront TMG back to Back. In the first one I explained the network setup, network relationships, the TMG backend and TMG Frontend installations and some simple firewall rules. In the second part we will be configuring OWA for exchange 2003, web publishing rules, and incoming and outgoing SMTP mail.

Configuring OWA for exchange 2003 with FBA

Forms-based authentication(FBA) is one of the cool features that is included in the TMG software. The FBA enables the TMG’s capablility to enable the OWA logon form on the TMG firewall instead of enabling it on the exchange 2003 box. It enables you to force authentication on the TMG firewall before packets are forwared to the exchange 2003 box. If you want to create a fancy FBA logon page then check my post here.

requirements:

  • FBA should be disabled on the exchange 2003 box.
  • The TMG firewall that needs FBA needs to be joined to the domain. (thus we use the TMG-BE)
  • A certificate with your companies webmail address should reside on the exchange 2003 and TMG-BE boxes. (the certificate should include something like webmail.test.com)
  • A new forward lookup zone should be configured on the DC1 server named test.com. Create a new A record called webmail.test.com that points to 10.4.20.20
  • At your provider you should create a DNS record that points webmail.test.com to ISP IP2

We want to make OWA dummy proof. Experience shows that users often forget the default URL https://webmail.test.com/Exchange . Users should be able to type the URL with HTTP or HTTPS and with or without /Exchange. So lets create the rules on the TMG-FE first :

  • Rule Name : Publish Outlook Webmail Apps (OWA) – HTTP    (choose non-web publishing rule)
  • Rule Number : 1
  • Rule action : Allow
  • Server IP : 10.6.0.2 (secondary ip on the TMG-BE external interface)
  • Create New Protocol :  HTTP Server on Port 80 inbound
  • Listener IP Address : External Interface IP : ISP IP2 only
  • Make sure you enable : requests appear from original client
  • Rule Name : Publish Outlook Webmail Apps (OWA) – HTTPS    (choose non-web publishing rule)
  • Rule Number : 2
  • Server IP : 10.6.0.2
  • Protocol : HTTPS Server
  • Listener IP Address : External Interface IP : ISP IP2 only
  • Make sure you enable : requests appear from original client

Create the rules on the TMG-BE

  • Name : Publish Outlook Webmail Apps (OWA) (Choose Exchange Client Access rule)
  • Rule Number : 1
  • Exchange version : exchange 2003
  • Mail services : OWA
  • Rule action : Allow
  • Publishing Type : single website
  • Server Connection Security : SSL
  • Internal Sitename : webmail.test.com
  • Ip Address : 10.4.20.20
  • Request appear to come from TMG
  • Public name details : webmail.test.com
  • Create New Listener
  • Web Listener Name : HTTP(S) OWA
  • Client Connection Security : SSL (HTTPS en HTTP)
  • Enable redirection http to https
  • Web Listener IP Address : Perimeter Interface IP : 10.6.0.2 only
  • Certificate : webmail.test.com
  • Authentication Settings : HTML Form authentication
  • Validation : Windows (active directory)
  • SSO : disabled
  • Authentication Delegation : basic authentication
  • User Set : All authenticated users group
  • Edit the newly reated rule ang go to the paths tab
  • Add the following path : (beware the Capital E of Exchange and the \ at the end)

  • on the TO tab make sure you enable : requests  from Forefront TMG

Outlook Web Access should work just fine by now. Just test it by accessing it remotely.

Configuring webserver access internally and remotely

Users need to access the webserver from outside the network but also from inside the corporate network. To accomplish this you need to config the following:

  • in the new forward lookup zone create a new A record called http://www.test.com that points to 10.6.10.10
  • At your provider you should create a DNS record that points http://www.test.com to ISP IP1
  • The default gateway of the webserver points to the internal interface of the TMG-FE. So the webserver does not know the route to VLAN1, VLAN2, VLAN3, VLAN4 and VLAN5. Therefore you need static routes on the webserver to access those networks.

Create the rule on the TMG-FE first :

  • Rule Name ; Publish HTTP traffic to the webserver (choose web publishing rule)
  • Rule Number : 2
  • Rule action : Allow
  • Publishing Type : single website
  • Server Connection Security : NON-SSL
  • Internal Sitename : http://www.test.com
  • Ip Address : 10.6.10.10
  • Path : /*
  • Public Name : http://www.test.com
  • Path : /*
  • Create New Listener
  • Web Listener Name : HTTP WWW
  • Client Connection Security : NON-SSL
  • Web Listener IP Address : External Interface IP : ISP IP1 only
  • Authentication Settings : None
  • Authentication Delegation : No delegation, client cannot authenticate
  • User Sets : All Users

Create the rule on the TMG-BE :

  • Name : Allow HTTP(s), RDP, FTP traffic to the webserver (choose access rule)
  • Rule Number : place above normal http traffic rule
  • Rule Action : Allow
  • Protocols : HTTP, HTTPS, RDP, FTP
  • From : Internal Networks
  • To : Webserver
  • User Sets : All Users

Now you are done !. We achieved access to the webserver from the outside world and from the internal corporate network.

Configuring inbound and outbound mail (SMTP)

Since we are hosting our mail solution internally we need to achieve inbound and outbound mail traffic.

requirement:

  • At your provider you should create a MX DNS record that points mail.test.com to ISP IP3
  • The default gateway of the barracuda points to the internal interface of the TMG-FE. Therefore it does not know the route to the 10.4.x.x network. We need to add a static route on the Barracuda. If you have a 600 model or higher you can add the static route right away. However if you have a 400 model that option is not available. If you contact barracuda support they will enable that option for you.

Create the rule on the TMG-FE first :

  • Name : Publish mail traffic to antispam firewall (mail publishing rule)
  • Rule Number : place on top
  • Access Type : Server to server communication SMTP,NNTP
  • Services : SMTP (custom SMTP server protocol port 25 inbound with SMTP filter disabled)
  • From : Anywhere
  • Server IP Address : 10.6.20.20 (the barracuda)
  • Network Listener IP Address : External Interface  IP : ISP IP3 only
  • Make sure you enable : requests appear from original client

Create the rule on the TMG-BE :

  • Name : Allow mail traffic to internal LAN (choose access rule)
  • Rule Number : place on top
  • Rule Action : Allow
  • Protocols : SMTP
  • From : Barracuda
  • To : Exchange 2003 Back-End
  • User Sets : All Users
  • Name : Allow mail traffic to outside (choose access rule)
  • Rule Number : place on top
  • Rule Action : Allow
  • Protocols : SMTP
  • From : Exchange 2003 Back-End
  • To : external
  • User Sets : All Users

This concludes my 2 part series about Installing and configuring Forefront TMG Back to Back solution. I hope its usefull for you and feel free to comment.

%d bloggers like this: