Tuesday, December 21, 2010

How Firewalls Work

If you have been using Internet on a regular basis or working in a large company and surf the Internet while you are at work, you must have surely come across the term firewall. You might have also heard of people saying “firewalls protect their computer from web attacks and hackers” or “a certain website has been blocked by firewall in their work place”. If you have ever wondered to know what exactly is this firewall and how it works, here we go. In this post I will try to explain “How firewalls work” in a layman’s terms.

How Firewalls Work

 

Firewalls are basically a barrier between your computer (or a network) and the Internet (outside world). A firewall can be simply compared to a security guard who stands at the entrance of your house and filters the visitors coming to your place. He may allow some visitors to enter while denying others whom he suspects of being intruders. Similarly a firewall is a software program or a hardware device that filters the information (packets) coming through the Internet to your personal computer or a computer network.

Firewalls may decide to allow or block network traffic between devices based on the rules that are pre-configured or set by the firewall administrator. Most personal firewalls such as Windows firewall operate on a set of pre-configured rules that are most suitable under normal circumstances so that the user need not worry much about configuring the firewall.
Personal firewalls are easy to install and use and hence preferred by end-users for use on their personal computers.  However large networks and companies prefer those firewalls that have plenty of options to configure so as to meet their customized needs. For example, a company may set up different firewall rules for FTP servers, Telnet servers and Web servers. In addition the company can even control how the employees connect to the Internet by blocking access to certain websites or restricting the transfer of files to other networks. Thus in addition to security, a firewall can give the company a tremendous control over how people use the network.
Firewalls use one or more of the following methods to control the incoming and outgoing traffic in a network:
1. Packet Filtering: In this method packets (small chunks of data) are analyzed against a set of filters. Packet filters has a set of rules that come with accept and deny actions which are pre-configured or can be configured manually by the firewall administrator. If the packet manages to make it through these filters then it is allowed to reach the destination; otherwise it is discarded.
2. Stateful Inspection: This is a newer method that doesn’t analyze the contents of the packets. Instead it compares certain key aspects of each packet to a database of trusted source. Both incoming and outgoing packets are compared against this database and if the comparison yields a reasonable match, then the packets are allowed to travel further. Otherwise they are discarded.

Firewall Configuration

Firewalls can be configured by adding one or more filters based on several conditions as mentioned below:
1. IP addresses: In any case if an IP address outside the network is said to be unfavorable, then it is possible to set  filter to block all the traffic to and from that IP address. For example, if a cetain IP address is found to be making too many connections to a server, the administrator may decide to block traffic from this IP using the firewall.
2. Domain names: Since it is difficult to remember the IP addresses, it is an easier and smarter way to configure the firewalls by adding filters based on domain names. By setting up a domain filter, a company may decide to block all access to certain domain names, or may provide access only to a list of selected domain names.
3. Ports/Protocols: Every service running on a server is made available to the Internet using numbered ports, one for each service. In simple words, ports can be compared to virtual doors of the server through which services are made available. For example, if a server is running a Web (HTTP) service then it will be typically available on port 80. In order to avail this service, the client needs to connect to the server via port 80. Similarly different services such as Telnet (Port 23), FTP (port 21) and SMTP (port 25) services may be running on the server. If the services are intended for the public, they are usually kept open. Otherwise they are blocked using the firewall so as to prevent intruders from using the open ports for making unauthorized connections.
4. Specific words or phrases: A firewall can be configured to filter one or more specific words or phrases so that, both the incoming and outgoing packets are scanned for the words in the filter. For example, you may set up a firewall rule to filter any packet that contains an offensive term or a phrase that you may decide to block from entering or leaving your network.

Hardware vs Software Firewall

Hardware firewalls provide higher level of security and hence preferred for servers where security has the top most priority whereas, the software firewalls are less expensive and are most preferred in home computers and laptops. Hardware firewalls usually come as an in-built unit of a router and provide maximum security as it filters each packet in the hardware level itself even before it manages to enter your computer. A good example is the Linksys Cable/DSL router.

Why Firewall?

Firewalls provide security over a number of online threats such as Remote login, Trojan backdoors, Session hijacking, DOS & DDOS attacks, viruses, cookie stealing and many more. The effectiveness of the security depends on the way you configure the firewall and how you set up the filter rules. However major threats such as DOS and DDOS attacks may sometimes manage to bypass the firewalls and do the damage to the server. Even though firewall is not a complete answer to online threats, it can most effectively handle the attacks and provide security to the computer up to the maximum possible extent.

Tuesday, December 14, 2010

Exchange 2003 Setup Guide

First install two servers running Windows 2003 (R2 if you have it)
Next patch fully using Windows update
Create a domain controller (any  therefore a domain)
Join the second machine to the domain
On the second machine which will become your Exchange server install the prereqs for Exchange
Open Add/Remove Programs control panel
image002

Click Add/Remove Windows Components
Add-Remove-Components

Select Application Server and click Details
image006

Click ASP.NET
image008

Double Click Internet Information Services (IIS)
Scroll down and check the box next to NNTP and SMTP
image010

Click OK twice and then click Next
When prompted insert the CDs as requested
Once the install is complete click Finish and close the Add/Remove programs control panel

image012

Exchange install - Forest and Domain Prep
 

Next insert the Exchange 2003 CD
Click Exit on the first page
image014
Now download the latest Exchange deployment tools which can be found at the link below (as of 30/12/2006)
http://www.microsoft.com/downloads/details.aspx?familyid=271e51fd-fe7d-42ad-b621-45f974ed34c0&displaylang=en
Once you have the latest Exdelpoy.exe double click it.
Enter the location to save the files and click "OK"
image016
Click OK
image018

Next locate and double click the exdeploy.hta file
image020
You are now at the first page of the Exchange deployment tools
Click "Deploy the first Exchange server"
image022

Click "New Exchange 2003 Installation"
image024
The first three steps are all about ensuring the prerequisites are met. Select the checkboxes by steps 1 and 2 as these have already been covered.
image026

Select the checkboxes by steps 1 and 2 as these have already been covered.
image028

For step three ensure the support tools are installed. If they are not, download them from the link below and install them:
http://www.microsoft.com/downloads/details.aspx?familyid=6EC50B78-8BE1-4E81-B3BE-4E7AC4F0912D&displaylang=en
Click the box by step three
image030
To perform step four open a CMD prompt (Start, Run, type "CMD", Press "Enter")
In the CMD prompt window type the command below and press enter:
dcdiag /f:c:\dcdiaglog.txt /s:domaincontrollername.domain.com
 image032
This will output the results to a text file in the C: called dcdiaglog.txt. Open the file and ensure there are no errors. You should see output like the following:
Domain Controller Diagnosis
Performing initial setup:
   Done gathering initial info.

Doing initial required tests
  
   Testing server: Default-First-Site-Name\E2K7DC1
      Starting test: Connectivity
         ......................... E2K7DC1 passed test Connectivity

Doing primary tests
  
   Testing server: Default-First-Site-Name\E2K7DC1
      Starting test: Replications
         ......................... E2K7DC1 passed test Replications
      Starting test: NCSecDesc
         ......................... E2K7DC1 passed test NCSecDesc
      Starting test: NetLogons
         ......................... E2K7DC1 passed test NetLogons
      Starting test: Advertising
         ......................... E2K7DC1 passed test Advertising
      Starting test: KnowsOfRoleHolders
         ......................... E2K7DC1 passed test KnowsOfRoleHolders
      Starting test: RidManager
         ......................... E2K7DC1 passed test RidManager
      Starting test: MachineAccount
         ......................... E2K7DC1 passed test MachineAccount
      Starting test: Services
         ......................... E2K7DC1 passed test Services
      Starting test: ObjectsReplicated
         ......................... E2K7DC1 passed test ObjectsReplicated
      Starting test: frssysvol
         ......................... E2K7DC1 passed test frssysvol
      Starting test: frsevent
         ......................... E2K7DC1 passed test frsevent
      Starting test: kccevent
         ......................... E2K7DC1 passed test kccevent
      Starting test: systemlog
         ......................... E2K7DC1 passed test systemlog
      Starting test: VerifyReferences
         ......................... E2K7DC1 passed test VerifyReferences
  
   Running partition tests on : ForestDnsZones
      Starting test: CrossRefValidation
         ......................... ForestDnsZones passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... ForestDnsZones passed test CheckSDRefDom
  
   Running partition tests on : DomainDnsZones
      Starting test: CrossRefValidation
         ......................... DomainDnsZones passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... DomainDnsZones passed test CheckSDRefDom
  
   Running partition tests on : Schema
      Starting test: CrossRefValidation
         ......................... Schema passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... Schema passed test CheckSDRefDom
  
   Running partition tests on : Configuration
      Starting test: CrossRefValidation
         ......................... Configuration passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... Configuration passed test CheckSDRefDom
  
   Running partition tests on : exchange
      Starting test: CrossRefValidation
         ......................... exchange passed test CrossRefValidation
      Starting test: CheckSDRefDom
         ......................... exchange passed test CheckSDRefDom
  
   Running enterprise tests on : exchange.local
      Starting test: Intersite
         ......................... exchange.local passed test Intersite
      Starting test: FsmoCheck
         ......................... exchange.local passed test FsmoCheck

If you get any errors then investigate them. You could post a question to the forums at http://www.mmmug.co.uk/forum
So long as you have no errors move back to the deployment tools and check the 4th box.

image034
Next move back to the command prompt and enter the command below and press enter:
Netdiag >c:\netdiaglog.txt
image036

The command will take a short while to execute. Once complete view the log file in the C:
 ...................................
     Computer Name: E2K7MB1
    DNS Host Name: E2K7MB1.exchange.local
    System info : Microsoft Windows Server 2003 R2 (Build 3790)
    Processor : x86 Family 6 Model 13 Stepping 8, GenuineIntel
    List of installed hotfixes :
        KB890046
        KB893756
        KB896358
        KB896422
        KB896424
        KB896428
        KB898715
        KB899587
        KB899588
        KB899589
        KB899591
        KB900725
        KB901017
        KB901214
        KB902400
        KB904706
        KB904942
        KB905414
        KB908519
        KB908531
        KB909520
        KB910437
        KB911164
        KB911280
        KB911562
        KB911567
        KB911927
        KB912919
        KB914389
        KB916281
        KB917344
        KB917734
        KB917953
        KB918439
        Q147222
Netcard queries test . . . . . . . : Passed
Per interface results:
     Adapter : Local Area Connection
         Netcard queries test . . . : Passed
         Host Name. . . . . . . . . : E2K7MB1
        IP Address . . . . . . . . : 192.168.23.20
        Subnet Mask. . . . . . . . : 255.255.255.0
        Default Gateway. . . . . . : 192.168.23.1
        Dns Servers. . . . . . . . : 192.168.23.10
         AutoConfiguration results. . . . . . : Passed
        Default gateway test . . . : Failed
            No gateway reachable for this adapter.
        NetBT name test. . . . . . : Passed
        [WARNING] At least one of the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names is missing.
        WINS service test. . . . . : Skipped
            There are no WINS servers configured for this interface.
Global results:
Domain membership test . . . . . . : Passed
NetBT transports test. . . . . . . : Passed
    List of NetBt transports currently configured:
        NetBT_Tcpip_{BA408A51-ABAA-4413-8D49-BA81B877126B}
    1 NetBt transport currently configured.
Autonet address test . . . . . . . : Passed 
IP loopback ping test. . . . . . . : Passed 
Default gateway test . . . . . . . : Failed
    [FATAL] NO GATEWAYS ARE REACHABLE.
    You have no connectivity to other network segments.
    If you configured the IP protocol manually then
    you need to add at least one valid gateway.
NetBT name test. . . . . . . . . . : Passed
    [WARNING] You don't have a single interface with the <00> 'WorkStation Service', <03> 'Messenger Service', <20> 'WINS' names defined.
Winsock test . . . . . . . . . . . : Passed
DNS test . . . . . . . . . . . . . : Passed
Redir and Browser test . . . . . . : Passed
    List of NetBt transports currently bound to the Redir
        NetBT_Tcpip_{BA408A51-ABAA-4413-8D49-BA81B877126B}
    The redir is bound to 1 NetBt transport.
    List of NetBt transports currently bound to the browser
        NetBT_Tcpip_{BA408A51-ABAA-4413-8D49-BA81B877126B}
    The browser is bound to 1 NetBt transport.
DC discovery test. . . . . . . . . : Passed
DC list test . . . . . . . . . . . : Passed
Trust relationship test. . . . . . : Passed
    Secure channel for domain 'EXCHANGE' is to '\\E2K7DC1.exchange.local'.
Kerberos test. . . . . . . . . . . : Passed
LDAP test. . . . . . . . . . . . . : Passed
Bindings test. . . . . . . . . . . : Passed
WAN configuration test . . . . . . : Skipped
    No active remote access connections.
Modem diagnostics test . . . . . . : Passed
IP Security test . . . . . . . . . : Skipped
    Note: run "netsh ipsec dynamic show /?" for more detailed information
The command completed successfully

The text file should like the above output. You should get no errors. (I have errors for Default gateway because this is an isolated test system)
If you get any errors then investigate them. You could post a question to the forums at http://www.mmmug.co.uk/forum
So long as you have no errors move back to the deployment tools and check the 5th box.

image038

The next step is to run Forest prep. This must be run by a user with Schema administrator permissions. Forest Prep will extend the AD Schema with the new classes and attributes that Exchange 2003 requires to operate.
To proceed enter the path to the install CD in the box provided and click "Run ForestPrep now"


WARNING: This operation is not undoable. Only do this if you are certain you want to proceed. I suggest testing in a lab environment before going into production. If you are unsure post a question in the Forums. http://www.mmmug.co.uk/forum

image040

If prompted about an incompatibility then select the checkbox to ignore the warning in the future and click “Continue”

image042

The Warning occurs because Exchange 2003 RTM needs upgrading to SP2 which we will install later.
Once the install opens click “Next”

image044

Agree to the license and click “Next”

image046

Note that only ForestPrep will be performed and that files will go in the default location C:\Program Files\Exchsrvr (this can be changed if required to place files on an Application drive)
Click “Next”

image048

Select the account to be the first Exchange Full Administrator. The default is the account you are logged in as. If you are only logging in as a special schema admin account then you should select an account that will be used to admin Exchange. I will leave the default in place of Administrator.
Click “Next”
SCREENSHOT of ACCOUNT DETAILS MISSING
ForestPrep is a fairly slow process that could take around 30mins on a slow network. You will see several screens like the one below

image050

Once the process is complete click Finish

image052

Next move back to the deployment tools and check the box on the 6th step

image054

Now move onto the Domain Prep. This will need to be performed in the root domain and any others which will hold Exchange mailboxes. Personally it is simplest to run it in all domains in the forest.
In a simple single domain forest proceed as follows:
Enter the path to the Install files where requested and click “Run DomainPrep now”.

image056

On the welcome page click “Next”

image057

Accept the licence and click “Next”

image059

Again note that only DomainPrep will be carried out and that you can change the file location if you want (Only change it if you changed the location for ForestPrep too)
Click “Next”

image061

Early in the process you will likely be warned that your domain is insecure for mail-enabled groups with hidden DL membership. Anyone in the Pre-Windows 2000 Compatible Access group can view this membership. So long as you are not using the group for a valid reason remove the default membership of Authenticated users to remove the problem.
Click "OK"

image063

The DomainPrep is quick and shows the screen below whilst running

image065

Once complete click Finish

image066

Move back to the deployment tools and check the box of the 7th step.

image068

You are now ready to install Exchange.
Move onto step 8. Again enter the path to the install files and click “Run Setup Now”
On the welcome page click “Next”

image069

Accept the licence and click “Next”

image070

This time check the install options carefully. You can choose which components to install. Generally the defaults are fine and that is what we shall stick with. Note also, that you can change the file location. Again you should do this if you changed the location for forest and domain prep.
Once you are happy with your selections, click “Next”

image072

As there is no Exchange org setup currently select to create one and click “Next”

image074
Name the org and click “Next”
image076


Agree to the licence and click “Next”

image078

Verify your choices and click “Next”

image080
The installation will progress
image082
When complete click Finish

image083

Now return to the deployment tools and check the box next to step 8.
Click “Next” on the deployment tools bottom right hand corner
The next page runs through the steps again for other Exchange servers.
For now we will not install another server so again click “Next” on the deployment tools bottom right hand corner.
Read through the post installation steps. We will cover the important items from here, like SMTP Filtering, Memory optimisation and Connecting to the Internet later on.
Congratulations you have just installed Exchange!
Now let's move on to setting it up the way we want it!