From: <Microsoft Internet Explorer 5¡Æ¢® AuAa>
Subject: Beginner's guide to armoring NT 4.0
Date: Sun, 17 Jun 2001 12:34:43 +0900
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.enteract.com/~lspitz/nt.html
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Beginner's guide to armoring NT 4.0</TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR>
<META content=3D"How to armor NT 4.0" name=3Ddescription>
<META=20
content=3Dhacking,NT,armoring,hardening,services,WINS,NetBios,policies,lo=
gon,firewall=20
name=3Dkeywords>
<STYLE type=3Dtext/css>A:active {
	TEXT-DECORATION: none
}
A:hover {
	TEXT-DECORATION: none
}
A:link {
	TEXT-DECORATION: none
}
A:visited {
	TEXT-DECORATION: none
}
</STYLE>
</HEAD>
<BODY link=3D#0000ff vLink=3D#800080>
<CENTER><I><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT =
size=3D+1>Preparing NT=20
for a firewall</FONT></FONT></I> <BR><B><FONT=20
face=3D"Helvetica-Narrow,Arial Narrow"><FONT size=3D+4>Armoring =
NT</FONT></FONT></B>=20

<P><B><FONT size=3D-1><A=20
href=3D"mailto:lance@honeynet.org?Subject=3DArmoring NT 4.0">Lance=20
Spitzner</A></FONT></B> <BR><A=20
href=3D"http://www.enteract.com/~lspitz">http://www.enteract.com/~lspitz<=
/A>=20
<BR>Last Modified: 16 April, 2000 </CENTER><BR><B>Firewalls are one of =
the=20
fastest growing tools in the field of information security. However, a =
firewall=20
is only as secure as the operating system it resides upon. This article =
will=20
take a step by step look at how you can best armor your NT box in =
preparation=20
for a firewall. These steps can apply to any situation, however I will =
be using=20
Checkpoint Firewall 1 on NT 4.0 as an example.</B>=20
<P><B><FONT size=3D+2>Installation</FONT></B> <BR>The best place to =
start in=20
armoring your NT system is at the beginning, OS installation. Since this =
is your=20
firewall, you cannot trust any previous installations. You want to start =
clean,=20
where you can guarantee the system integrity.&nbsp; Also, NT is unique =
in that a=20
great deal of the system armoring happens during the installation =
process.&nbsp;=20
Even if you have just received the system from the manufacture, I =
recommend=20
rebuilding the system so you know exactly what is running .=20
<P>Place your system in an isolated network. At no time do you want to =
connect=20
this box to an active network nor the Internet, exposing the system to a =

possible compromise. To get service packs and hotfixes later, you will =
need a=20
second box that acts as a go between. This second box will download =
files from=20
the Internet, then either burn them to a cdrom, or connect to your =
isolated,=20
configuration "network" to transfer critical files.&nbsp; I have =
personally=20
witnessed systems hacked within 15 minutes of connecting to the =
Internet.&nbsp;=20
Morale of the story is keep your system isolated until it is fully =
armored.=20
<P>Once you have placed your future firewall in an isolated network, you =
are=20
ready to begin.&nbsp; For NT, a great deal of armoring happens during =
the=20
installation process, so we will be covering it in detail. To begin =
with, we=20
have two different options of which software to install, Workstation or=20
Server.&nbsp; I recommend Server for several reasons.&nbsp; First, NT =
Server=20
comes with the ability to mirror drives, whereas NT Workstation doesn't =
come=20
standard with that ability.&nbsp; Second, NT server can handle far more=20
connections then NT workstation (default is 5).&nbsp; This is critical =
if you=20
intend on running any proxy applications on your firewall, such as the =
http or=20
telnet security servers.&nbsp;&nbsp; Also, the registry permissions on =
NT Server=20
are more restrictive.=20
<P>NT installation begins with the command line interface.&nbsp; Here =
you select=20
which partitions you install on and what file system you want, FAT or=20
NTFS.&nbsp; I highly recommend NTFS, as it allows far great control and =
security=20
of your file system.&nbsp; After this, you will begin the GUI part of =
the=20
installation. From here you will select what kind of server to install, =
which=20
services will run, and general system configuration.&nbsp; Remember, the =
whole=20
idea during this process is to install and configure as few services as=20
possible.&nbsp; The fewer services that are running, the fewer exploits =
or=20
security issues you will have.=20
<P>Following some initial licensing questions,&nbsp; you will&nbsp; be =
asked=20
which OS package to load,&nbsp; There are three options, Primary Domain=20
Controller, Backup Domain Controller, and Stand-Alone.&nbsp; I recommend =

Stand-Alone as this is our firewall and it should be doing only one =
thing,=20
firewalling.&nbsp;&nbsp; After several more system options, you will be =
asked to=20
select software components.&nbsp; By default, the system will install=20
Accessories, Communications, Multimedia, and Accessibility.&nbsp; I =
highly=20
recommend you eliminate at least Communications, Multimedia and=20
Accessibility.&nbsp; Once again, the less software you install, the=20
better.&nbsp; The system will then ask you if you want to install IIS =
web server=20
(by default, it does).&nbsp; Do NOT install this, a web server is the =
last thing=20
you want running on your firewall.&nbsp; After this, you will install =
and=20
configure your NICs (Network Interface Cards).&nbsp; By default, the =
system=20
installs both IPX and TCP/IP for the cards.&nbsp; Be sure you select =
only=20
TCP/IP.&nbsp; Firewall 1 does not filter IPX.&nbsp; If your system is =
routing=20
IPX, all IPX traffic will go right through the firewall (normally =
considered a=20
bad thing).=20
<P>Next, you will select what services you want to install.&nbsp; By =
default,=20
the system will install RPC, Net BIOS, Workstation, and Server.&nbsp; We =
cannot=20
de-select these services now, however we will be removing&nbsp; them=20
later.&nbsp; The only service you may want to add here is snmp.&nbsp; =
The=20
firewall Management Module uses snmp to monitor firewall modules (System =
Status=20
Viewer).&nbsp; If you will not be using this feature, or do not have any =

distributed firewalls, you do not need snmp.=20
<P>After that, you configure your TCP/IP stack.&nbsp; Here you select =
the IP=20
address, default router, and DNS server.&nbsp; Do NOT configure a WINS =
server or=20
DHCP relay.&nbsp; We want to minimize what the firewall communicates =
with.&nbsp;=20
Remember to enable IP Forwarding.&nbsp; If you do not enable this, your =
firewall=20
will not route traffic (this however definitely makes for a more secure =
network=20
:).&nbsp; The last thing the install process configures is what Domain =
or=20
Workgroup you want to belong to.&nbsp; Well, you don't, you want to =
isolate the=20
system as much as possible.&nbsp; I recommend creating a nonexistent =
Workgroup.=20
<P>Following&nbsp; your installation (and reboot) we will want to =
install the=20
latest Service Pack (current <A=20
href=3D"http://www.microsoft.com/ntserver/nts/downloads/recommended/PREM_=
SP6/allSP6.asp">Service=20
Pack 6a</A> ) and the latest <A=20
href=3D"http://ntbugtraq.ntadvice.com/default.asp?pid=3D35&amp;sid=3D1">h=
otfixes</A>.&nbsp;=20
Staying current with the latest exploits is critical for a secure =
system.=20
<BR>&nbsp;=20
<P><B><FONT size=3D+2>Eliminating Services &amp; Tweaking</FONT></B> =
<BR>Once you=20
have installed the latest Service Pack and hotfixes, there is allot of =
cleaning=20
up to do.&nbsp; The first priority is turning off the services we had to =
install=20
earlier.&nbsp;&nbsp; Go into Network Neighborhood properties and select=20
Services.&nbsp; From here, remove RPC Configuration, Net BIOS Interface, =

Workstation,&nbsp; Server, and Computer Browser.&nbsp; None of these =
services=20
are required to run a firewall, they only add possible security=20
vulnerabilities.&nbsp; The only thing we should have left is <A=20
href=3D"http://www.enteract.com/~lspitz/snmp.gif">SNMP Service</A> (if =
you opted=20
to install it). Several people have mentioned that they do not like to =
remove=20
Workstation or Server because they lose some specific&nbsp;=20
functionality.&nbsp;&nbsp; I leave the decision up to you, the reader :) =

<BLOCKQUOTE>" I like to keep workstation because it allows useful things =
like=20
  AT to run. I like to keep server because if&nbsp; you tweak the =
service for=20
  network applications, the firewall does run faster than not having the =
server=20
  service installed. Besides, if you unbind WINS and setup rules to =
block NBT to=20
  the firewall, you are killing access to these services at two levels =
already.=20
  If you really want to be secure, open user manager and remove =
everyone's right=20
  to logon from the network. (Chris Brenton)"</BLOCKQUOTE>There are two =
other=20
places we can eliminate&nbsp; services.&nbsp; The first is to disable =
WINS from=20
our NICs (Network Interface Cards).&nbsp; This is done by going into =
Network=20
Properties -&gt; Bindings -&gt; All Protocols -&gt; WINS =
Client(TCP/IP).&nbsp;=20
It should look something <A =
href=3D"http://www.enteract.com/~lspitz/wins.gif">like=20
this.</A>&nbsp;&nbsp; The second place is the services menu itself, =
found in=20
Settings -&gt; Control Panel -&gt; Services.&nbsp; Here you can disable =
several=20
services that are manually or automatically started at bootup.&nbsp; I =
recommend=20
disabling&nbsp; <A =
href=3D"http://www.enteract.com/~lspitz/netbios.gif">TCP/IP=20
NetBIOS Helper</A>.&nbsp; Anything else is done at your own risk :)=20
<P>No additional services should be installed on the firewall, such as =
telnet,=20
ftp, or PCanywhere.&nbsp; Limit access to console only.&nbsp; Most =
firewalls,=20
including, Check Point Firewall-1, provide a client GUI that allows =
remote=20
management of the firewall.&nbsp; All other system administration should =
be done=20
physically on the system.&nbsp; The only software you may want to =
install is=20
some form of anti-virus protection.&nbsp; Once again, the less that is =
running=20
on our firewall, the better. <BR>&nbsp; <BR>Next, we want to prevent the =
logon=20
name of the last user from being displayed on the screen.&nbsp; To do =
this, set=20
the Registry value of <FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>DontDisplayLastUsername</FONT></FONT> to 1.&nbsp; You can find =
this at:=20
<BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current=20
Version\Winlogon</FONT></FONT>=20
<P>We also want to create a logon banner for all users.&nbsp; This =
banner will=20
be a legal warning, forbidding any unauthorized access.&nbsp; To do =
this, set=20
the Registry value <FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>LegalNoticeCaption</FONT></FONT> with a short caption, and =
<FONT=20
face=3D"Courier New,Courier"><FONT =
size=3D-1>LegalNoticeText</FONT></FONT> with the=20
banner itself.&nbsp; You can find this at <BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current=20
Version\Winlogon</FONT></FONT>=20
<P>To restrict anonymous connections to list account names, set <FONT=20
face=3D"Courier New,Courier"><FONT =
size=3D-1>RestrictAnonymous</FONT></FONT> to 1=20
<BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa</FONT><=
/FONT>=20
<P>To restrict network access to the registry, create the following =
registry=20
key: <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>HKEY_LOCAL_MACHINE\SYSTEM\CurrentcontrolSet\Control\SecurePipeS=
ervers\winreg</FONT></FONT>=20

<P><B><FONT size=3D+2>Accounts and Policies</FONT></B> <BR>There are a =
variety of=20
modifications we can make to system accounts and permissions. The first =
is to=20
change the name Administrator.&nbsp; By default, this is the logon =
account that=20
has full privileges, so we want to protect this account.&nbsp; By =
changing the=20
name, which everyone in the world already knows, we add one more layer =
of=20
security.&nbsp; Also, have all admin users logon with their own =
respective=20
accounts , without giving them the password for the "Admin" =
account.&nbsp; This=20
allows you to track who is doing what. Another idea is to create a new =
dummy=20
Administrator account that has no privileges, and track to see if anyone =

attempts to logon with the account.=20
<P>Next, we want to control who has access to what on the system.&nbsp; =
I=20
recommend having no more then two groups with access to the firewall,=20
Administrators (for full access) and Power Users or Users (depending on =
what=20
access they need).&nbsp; If you can limit access to only Administrators, =
that is=20
even better.&nbsp; Regardless, the actual number of people who are =
authorized=20
access should be no more then 2-4 people. The fewer hands that touch the =

keyboard, the better.=20
<P>The next step is focusing on the system policies, specifically =
"Account",=20
"User Rights" and "Audit", which you will find under User manager.=20
<UL>
  <LI><B><A href=3D"http://www.enteract.com/~lspitz/account.gif">Account =

  Policy</A></B> controls how user passwords and logon accounts are =
used.&nbsp;=20
  Several changes are recommended here.=20
  <UL>
    <LI>Set "Minimum Password Length" to 8 characters=20
    <LI>Set "Account lockout" to lockout after 3 bad logon attempts, =
reset=20
    counter after 30 minutes. </LI></UL>
  <LI><B><A href=3D"http://www.enteract.com/~lspitz/user.gif">User =
Rights</A>=20
  </B>controls who can access what, such as "Log on locally" and "Manage =

  auditing and security log".&nbsp; I recommend limiting access to the =
two=20
  groups we discussed earlier.&nbsp; If nothing else, be sure to =
eliminate the=20
  group "Everyone" from all access.=20
  <LI><B><A href=3D"http://www.enteract.com/~lspitz/audit.gif">Audit =
Policy</A>=20
  </B>determines what events are logged.&nbsp; As this is our firewall, =
we want=20
  to log a variety of evens.&nbsp; I recommend you audit the following =
events.=20
  <UL>
    <LI>Logon and Logoff (Both Success and Failure)=20
    <LI>Security Policy Changes (Both Success and Failure)=20
    <LI>Restart, Shutdown, and System (Both Success and Failure)=20
</LI></UL></LI></UL>Whenever a user is done using the system for a =
particular=20
session, they should ALWAYS logout with CTL-ALT-DEL.&nbsp; In case they =
forgot=20
to do this, ensure you have a password protected screen saver that kicks =
in=20
after no more then 5 minutes of inactivity.=20
<P><B><FONT size=3D+2>Staying Current</FONT></B> <BR>The problem with =
security is,=20
by the time your system is secured, a&nbsp; new exploit has been =
released!&nbsp;=20
So, to help you stay current, I recommend the following:=20
<UL>
  <LI>First, subscribe to a listserv, so you will be updated via email =
with the=20
  latest security issues. Sometimes I forget to check out what the =
latest=20
  vulnerabilities are.&nbsp; The nice thing about a listserv is it comes =
to=20
  you.&nbsp; I recommend&nbsp; <A =
href=3D"http://www.ntbugtraq.com/">NTbugtraq</A>=20
  or <A href=3D"http://ntsecurity.ntadvice.com/">NTsecurity</A>=20
  <LI>For websites, some of my favorite are <A=20
  href=3D"http://www.ntsecurity.net/">http://www.ntsecurity.net/</A> <A=20
  =
href=3D"http://www.ntobjectives.com/">http://www.ntobjectives.com/</A>,an=
d <A=20
  href=3D"http://www.l0pht.com/">http://www.l0pht.com/</A>,&nbsp; =
ntsecurity=20
  focuses on securing you NT system,&nbsp; ntobjectives has several =
excellent=20
  security and admin NT utilities, and l0pht&nbsp; focus on hacking your =
NT=20
  system.&nbsp; Theses sites make an excellent combination.=20
  <LI>&nbsp;To audit your new installation, I highly recommend the tool =
<A=20
  href=3D"http://www.ipswitch.com/Products/WS_Ping/">WS_Ping =
ProPack.</A>&nbsp;=20
  This Windows 95/NT tools has a variety of great utilities normally =
found on=20
  unix systems, to include a port scanner, snmpwalk, NetBios scanner, =
etc.&nbsp;=20
  Scan your system monthly to ensure nothing has been accidentally left =
open.=20
  <LI>Type the command "netstat -na", and make sure you do not have any=20
  connections open.&nbsp; The command shows what ports are listening, =
and if you=20
  have any established connections. The only connection you should see =
is UDP=20
  161, which is snmp (and that is only if you installed it).&nbsp; I =
highly=20
  recommend you check your system regularly with the "netstat -na"=20
  command.&nbsp; This ensures that no surprises "sneak up on you".=20
</LI></UL><B><FONT size=3D+2>Conclusion</FONT></B> <BR>We have covered =
some of the=20
more basic steps involved in armoring a NT 4.0 box. The key to a secure =
system=20
is having the minimal software installed, with security in layers. There =
are=20
many additional steps that can be taken, such as file permissions, =
additional=20
registry hacks, 3rd party software, etc. Remember, no system is truly =
100%=20
secure. However, with the steps outlined above, you greatly reduce the =
security=20
risks. <BR>&nbsp;=20
<P><B><I><FONT face=3D"Helvetica-Narrow,Arial Narrow">Author's =
bio</FONT></I></B>=20
<BR><I>Lance Spitzner is an active member of the <A=20
href=3D"http://project.honeynet.org/">Honeynet Project</A>. He enjoys =
learning by=20
blowing up systems in his lab at home. Before this, he was an <A=20
href=3D"http://www.enteract.com/~lspitz/officer.html">tanker in the =
Rapid=20
Deployment Force,</A> where he blew up things of a different nature. You =
can=20
reach him at <A =
href=3D"mailto:lance@honeynet.org">lance@honeynet.org</A> .</I>=20
<BR>&nbsp; <BR>&nbsp;=20
<CENTER>
<TABLE border=3D5>
  <TBODY>
  <TR>
    <TD><I><FONT size=3D+2><A=20
      =
href=3D"http://www.enteract.com/~lspitz/pubs.html">Whitepapers</A></FONT>=
</FONT></FONT></I></TD></TR></TBODY></TABLE></CENTER>&nbsp;=20
</BODY></HTML>

