Click here to Skip to main content
Click here to Skip to main content

Network Security Fundamentals

, 22 Sep 2002
Rate this:
Please Sign up or sign in to vote.
The first in a series on network security for web developers

Network security fundamentals

This is the first in (hopefully) a series of security articles. These will mainly be aimed at web developers, but I hope they will be helpful to anyone wanting to learn more about the subject.

As developers we are in a constant struggle – we are required to make our applications as easy as possible for the user, but we must also make them as hard as possible for hackers to crack. An important note at this stage – traditionally hackers were good programmers, while malicious programmers/hackers were known as crackers. Unfortunately thanks to Hollywood, crackers are now known as hackers. For the moment I shall continue to call them crackers – feedback on this issue would be appreciated.

A basic corporate network from a security standpoint:

Corporate networks should be behind a firewall. Any home pc that has a permanent (broadband/ADSL) connection should also at least have at least a software firewall such as Zonealarm (www.zonelabs.com) . Firewalls basically work as follows

There are 3 areas to a firewall – Untrusted, Trusted and DMZ (demilitarised zone).

The untrusted port takes in the connection to the outside world (eg ADSL line).

The DMZ is an area of your network containing servers which the world can see, the most common example is your web server. Mail relay servers also sit in this area.

The trusted area is the inside LAN of your network. All your users sit in the trusted area. It is wise to use two totally different IP address ranges and subnets on your DMZ and trusted area’s of the network (you have no choice on the Untrusted IP – this is allocated by your ISP). This means that even if a cracker should manage to compromise a machine in your DMZ he will not have any information on how you have set the trusted area of your network up. It is also wise to have one administrator username and password for your trusted network, and totally separate ones for each of your servers in the DMZ. Again, should a cracker compromise an administration user name and password for one web server, your other web servers in the DMZ will remain safe. However, this should NEVER happen.

Prevention is better than cure – this cannot be over-emphasized with network security.

Picture this – you have an e-commerce site, people are happily purchasing goods through you, using their credit cards. Some malicious individual finds that he can’t get in and steal any information on people using your site, or their credit card details. He does however manage to place his own index.htm page on your site containing a skull and crossbones, and the words “You’ve been hacked!”. At this stage you may as well close down shop. It doesn’t matter how much you try to explain that no information was stolen – the bad press will destroy you. And promising to improve security in the future will not help either, the general public will have lost all confidence in your brand.

Initial Steps to protect your network:

Never have an account called administrator, guest, test or user. Remove or disable the guest account immediately. Rename the administrator account – but not to admin! Having too many usernames and passwords to remember can cause slip-ups in itself, but fortunately the entire trusted side only needs one administrator account. As I said above, it would be wise to have separately named administrator accounts for each machine in the DMZ area. These servers are the most likely to be attacked as they must have at least one port open to the world (80 and 443 for a web server), and when a window is open , someone determined enough will manage to find a way in.

Find a reliable port scanner and scan for open ports from outside of your network (eg. from home in the evenings). There are 65353 ports, with the first 1024 known as common ports (they have something assigned for them – if programming network software, always use a port above 1024). If one of these ports are open, there is a window in. Unfortunately to be useful, servers must have at least one port open. The main ones we are concerned with in a DMZ are 80 (http), 443 (https – secure) and 25 (smtp - for mail relay servers). All other ports should be closed down. Unfortunately Windows tends to open many ports, in order to save processing time should a program you run wish to use one of them. Nice from a user point of view, really bad from a security point of view. Portscan your network frequently from home, a friends office, etc. If you find open ports, close them down.

It is also necessary to scan both TCP and UDP ports. As many firms only check that their TCP ports are closed, crackers will hide on the UDP ports in order to break into your machines.

Another important thing is never to call your homepage index , default or home. Set your web server to look for something else (eg. companynamehome.asp), this way if a hacker does manage to copy his own version of index to your web server, it won’t be displayed as your server will be looking for something else.

Check your server logs daily. This is useful for a couple of reasons. Firstly, you can see how many people use your site each day. You can use reporting software (eg. Crystal Reports) to show this information in a more friendly format than the text file your firewall provides. Also, you will notice if someone is repeatedly looking for suspicious things on your server – I regularly see requests for cmd.exe on our logs. If someone can get to cmd.exe they have control over your machine. It will not take long to learn to spot suspicious activity. Fortunately there are things you can do about this – if you see an IP address constantly requesting things that aren’t part of your web site, perform a whois lookup on it. The easiest way to do this is to go to www.samspade.org and enter the IP address in the IP Whois field. This will give you information on which country the person is in, and who their ISP is. If this activity continues, contact the ISP. They are then required to contact the person and explain that cracking is not an acceptable through their portal.

Checking your logs regularly in this way is your best defence against crackers. If you can stop them before they get any useful information about your network, they have no way in.

Early vigilance will save you a lot of headaches and your firm a lot of embarrassment.

The methods above are just a sample of the ways you can avoid huge losses. Fortunately people are becoming more aware of the benefits of proper network security. The methods of programming you use can also have a huge impact on whether crackers can abuse your site or not. My next article will focus on these methods.

In closing I would like to say that my eyes were only opened to the importance of tight network security 6 months ago. What I found most amazing is that most crackers are not highly sophisticated individuals with great understanding of computer systems. The majority are “script kiddies” – 13 year olds who have downloaded free network security tools such as port scanners and merely learnt to run them, without any understanding of how they work. When the scanner alerts them to a vulnerability they go in and graffiti the site – they have little or no interest in stealing your data. Unfortunately, their graffiti is often enough to bring a good firm down. When I realised this, I decided that from that point onwards I wanted to have total control of my site, rather than leaving it at the mercy of such individuals. It seems to me that the best way to accomplish this is for developers to share information they same way crackers do.

Happy scanning!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Megan Forbes
Web Developer
Australia Australia
I am a South African web / SQL developer currently spending my time as a mum. My other passion is photography and have put a small portfolio up here[^]

Comments and Discussions

 
QuestionSECURITY PinmemberMember #382172621-Feb-07 20:53 
QuestionAnyone who knows Trojans??? PinmemberJack.Fu13-Mar-05 21:36 
AnswerRe: Anyone who knows Trojans??? Pinmembereternalnetworker4-Aug-07 10:21 
GeneralFree Firewall With Source Code Pinmemberxiamy3-Nov-03 5:53 
GeneralNot Free Source Code --- $98 PinsussAnonymous28-Jan-04 8:30 
GeneralRe: Free Firewall With Source Code Pinmembersudhir_mangla3-Mar-04 17:04 
GeneralRe: Free Firewall With Source Code PinmemberMihai Moga29-Mar-06 0:43 
GeneralOther Parts Pinmemberfifi24-Oct-03 4:32 
GeneralVGA [Very Good Article] PineditorBrian Delahunty8-Oct-02 9:29 
GeneralRe: VGA [Very Good Article] PinmemberMegan Forbes8-Oct-02 20:09 
GeneralRe: VGA [Very Good Article] PineditorBrian Delahunty8-Oct-02 22:34 
GeneralNice PinmemberMax Santos5-Oct-02 14:42 
GeneralRe: Nice PinmemberMegan Forbes5-Oct-02 23:19 
GeneralSecurity... PinmemberDaniel Madden24-Sep-02 8:16 
GeneralWhois lookup and IP address. PinmemberChris Meech24-Sep-02 7:08 
GeneralRe: Whois lookup and IP address. PinmemberShabana Parveen14-Mar-13 1:04 
GeneralRe: Whois lookup and IP address. PinmemberShabana Parveen14-Mar-13 1:06 
GeneralNice! PinmemberJon Sagara24-Sep-02 5:25 
GeneralInteresting... PinmemberShog923-Sep-02 13:21 
GeneralRe: Interesting... PinmemberMegan Forbes23-Sep-02 21:43 
GeneralYou beat me to a security article! PinmemberPaul Ingles23-Sep-02 12:51 
GeneralRe: You beat me to a security article! PinmemberMegan Forbes23-Sep-02 21:41 
GeneralThanks! Pinmemberannonymos23-Sep-02 12:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 23 Sep 2002
Article Copyright 2002 by Megan Forbes
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid