Sunteți pe pagina 1din 4

Network Security Using Firewalls

* * **
Robert Györödi , Cornelia Györödi , George Pecherle
Radu Lucaciu***
*
Associate professor Phd. Eng.,** Phd student, *** Student
Department of Computer Science, Faculty of Electrotehnics and Informatics, University of Oradea, Str. Universitatii 1, 410087,
Oradea, Romania
Phone: +40 (0) 259 408-226, E-Mail: cgyorodi@uoradea.ro, rgyorodi@rdsor.ro, gpecherle@uoradea.ro

Abstract. As networks increase in size and complexity, There are quite a few ways to defend an internal
security products are growing in sophistication and network like using a bastion-host, setting up a perimeter
security threats are becoming more ingenious. The usage network or using a firewall. However none of these
of security solutions has become inevitable for all methods are complete solutions for security, each suffering
modern organisations. There is no perfect security, but from different flaws. The best bet against a security breach
the idea is to make a network so hard to access, that it is using a combination of these techniques. It must be said
doesn’t worth trying. One of the crucial components that that a 100% breach resistant system is impossible to build.
contribute to this security are firewalls. It is important to The goal is to make breaching the system hard enough so
prevent undesired data before it ever gets into the target that the effort isn’t worth it.
system. This is the job of firewalls and the article covers
this topic.

1. Introduction 2. Firewall techniques


Due to the ever increasing request for connectivity The whole philosophy of the Internet is based on the
and inter-human communications, the Internet has known TCP/IP protocol. This protocol was designed as a set of
a booming growth in the last years. Even though it started overlaying layers, each with a complete and specific role.
as a way to connect Universities through expensive circuit The four layers that compose the TCP/IP protocol are the
switching methods, the following breakthroughs in Application Layer (consisting of applications and services
networking protocols as well as physical technologies that use the network), Host-to-Host Transport Layer
meant that Internet connectivity has become widely (providing end-to-end data delivery services), the Internet
available even to home users. Computer interconnections layer (handling the routing of the data) and the Network
have provided us with the means for quick Access Layer (consisting of routines for addressing
communications and great ways for sharing information. physical elements)[15].
These advantages, however, do not come without their
downsides. One might think this new, easy way to have The fundamental TCP/IP communication unit is the
access to any site in the world is great, but one might also packet. The data that needs to be transmitted between two
notice that it has enabled shady, uninvited characters to hosts is broken down into small fragments [5]. To these
pop up and stick their noses into other people’s business. fragments each of the composing layers attaches a header.
Thus the need for security devices, meant to keep intruders A TCP/IP packet usually contains the source IP address
out as well as classified information in, has been and port number, the destination IP address and port
acknowledged as a very important part of managing a number, the original data and various TCP/IP options [4].
network or site. Even if a site or network doesn’t have any
classified information to keep secret, many times a little Two different approaches are to be considered when
effort invested in network security can save huge amounts building a firewall. The first one, packet filtering, relies on
of time spend trying to repair a malevolent person’s monitoring the source and destination fields in the IP
actions against the site. From another point of view, even packet to determine whether a packet should be forwarded
if a network doesn’t have any information it wants to or dropped. The second method is implemented using
protect, trouble could still arise from the network’s usage proxy services. A proxy server runs on a dual-homed host
as a 3rd party attacking clone. After all, nobody wants the (a host connected simultaneously to two networks) and
Internet Service Provider to suspend the site’s Internet acts as a intermediary between two hosts that want to
connection because attacks seem to be initiated from the communicate to each other. This way, to each of the hosts
site itself [7][9]. it seems they are directly communicating with the other

38
one, but instead they are both communicating with the
proxy server.
vulnerable to forgery attacks where the attacker’s machine
There are two forms of packet filtering. The first one, assumes the identity of a trusted machine. The second way
the simplest, is filtering by address. This kind of filtering of filtering is filtering by service. Filtering by service takes
permits control over the flow of packets based on the into account not only the source/destination addresses but
source and/or destination address. Filtering by address is the source and destination ports too.

Figure 1: The representation of a proxy service

This paper will focus on packet filtering theory and


it’s practical implementation.

As a packet travels from its source to its destination it


will have to pass through different network nodes. Each of Figure 2: Packet filtering
these nodes has an equipment, called a router, that
determines which way a packet should go to reach it’s Packet filtering should be implemented in as many
destination. Since a packet usually only contains the routers as possible without having a noticeable effect on
destination and not the way to it, the routers have to the performance of a host/network. Also one should take
communicate between them to determine a route. This into account the maintenance issue. Having a big number
communication between routers is done through specific of routers that have to be maintained could raise problems.
protocols like Routing Information Protocol or Open
Shortest Path First. A router that implements the packet
filtering technique determines not only where a packet
should go but also if it should be allowed to go. 3. The application

Packet filtering allows control over the packet stream The primary goal of the programmer when designing
based on their source address, destination address and this application was to create a modular, efficient program,
application protocols used to send the data. that occupies a minimum of resources when running.

Packet filtering has the following advantages: The vast majority of firewalls available on the market
• It is available in both hardware and software today have a negative impact on the resources of the
implementations system where it runs. The firewall that we developed is
• It is built-in in many routers minimal and it offers only filtering based on the IP address,
• It offers great leverage over an entire network. port and protocol, and not based on the service.
One filter placed in a strategic choke-point can
protect an entire network However, no filtering method is perfect. If we suppose
• It is transparent to the end-user that a certain port will always be used by a certain service,
all connections from that port will be accepted. However,
However, packet filtering isn’t flawless. Following are a to an attacker with admin rights on the system, it would be
few disadvantages: quite easy to use a program that runs on that port.
• Packets cannot be filtered based on the data they
contain To build the application layout and the user interface,
• It cannot be used to fully back trace an attack. we have used the features of the Microsoft Foundation
The logs can tell you the address where an attack Class (MFC) [11][12][13]. Based on this, the rest of the
came from but not the user. application has been developed. The graphical user
• There are protocols that are not suited for packet interface is below:
filtering, such as some Remote Control Protocols
because they use random ports to connect to a
host.

39
The Rules button from the interface will display a
dialog box to view the security rules. Right clicking any
rule will allow the user to manage them. Adding a new rule
is done through a dialog box. The two windows are
presented in figure 5 below:

Figure 3: The Graphical User Interface

Because a firewall should always run when the


computer is working, we considered that its permanent
presence on the dektop and also on the taskbar would be
unpleasant and it would just waste useful space. This
determined us to implement a window minimize model
that reduces the interface to a simple icon in the System
Tray. This icon offers a menu with a minimum of possible
actions. To see a menu with the actions that can be done,
right click the system tray icon. Figure 5: The dialog boxes for managing the rules

The Logs button will display a window that allows the


real time monitoring of the traffic through all network
interfaces. This screen in presented in figure 6 below:

Figure 4: The System Tray icon

In order to keep the resource consumption to a


minimum, instead of dealing with the packets itself, the
application programs the network interface to reject or
allow packets from specific addresses and ports, letting the
interface to deal with the packets.

To accomplish this, the program will iterate through


all the active networking interfaces on the computer, and
will create a filter.

When setting up a rule, the user can set the source


address and port, the destination address and port, the
protocol (can be selected from TCP, UDP, ICMP, All) and
action (Allow/Drop). For example, the following rule:
Source IP: 192.168.0.3; Source Port:1025; Destination IP:
0.0.0.0; Destination Port:0; Protocol: UDP; Action: Drop,
would drop all packets originating from 192.168.0.3 port Figure 6: The dialog box that monitors the
1025 and going to all other IP addresses. network traffic

40
Some of the main classes from the project are: 4. Conclusion
CAboutDlg (that implements the About dialog box of the
application); CFirewallApp (the base class of the Packet filtering by itself is not flawless, but when
application; at run-time, an object from this class is created combined with other protection techniques it can be very
and then it gets the control); CMainFrame (this class efficient. A good compromise must be found between the
processes the messages received from the operating system security level and the amount of effort needed to setup and
and it is responsible with the creation and management of maintain a firewall or security policy.
the visualization and document classes).
The application was designed to provide a passive
The OnAppExit() takes care of the normal program protection, meaning it will not scan the ports for services
exit. Also, because MFC doesn’t implement functions that trying to connect to the Internet and will only block or
handle the SystemTray icons, we had to create such a allow packets based on the rules specifically set up by the
function: TrayMessage() creates and registers, or removes user. It should not be considered a perfect protection tool
the icon. and should not be used as the only protection device.

The function that actually implements the packet


filtering routine is StartFirewall(). PIP_ADAPTER_INFO
is a data structure containing specific data about each
network interface, and IP_ADDR_STRING is a data
structure for keeping an IP address as a string of 5. References
characters.
[1] Leonard Kleinrock, Information Flow in Large
The modularity is implemented through the use of Communication Nets, 1961, MIT
plug-ins. The plug-in can be a collection of classes and/or [2] Michael Hauben, The untold history of the
methods with a completely different functionality than that ARPANET, 1995, Univeristy of Columbia
of the original application. The module will be compiled to [3] Steve Crocker, The Documentation Conventions
a DLL file (Dynamic Link Library) and copied to the RFC, 1969
Plugins subfolder of the application. [4] Andrew S. Tanenbaum, Reţele de calculatoare,
Compter Press Agora, 1998
At startup, the program will check to see which plug- [5] Andrew S. Tanenbaum, Modern Operating
ins are currently available, but none of the plug-ins are Systems, Prentice Hall, 1992
loaded unless specifically requested by the user. This is [6] Peter L. Kantor, History: USENET, Hudson
done in order to prevent malicious plug-ins that could Valley Community College, 2003
cause harm without the user being aware. After installing a [7] D. Brent Chapman, Elizabet D. Zwicky, Building
new plug-in the application needs to be restarted in order Internet Firewalls, O’Reilly, 1995
to correctly detect the newly installed module. [8] Robert Gyorodi, Sisteme de operare Teorie şi
Aplicaţii, Ed. Universităţii din Oradea. 2000
A plugin can have any number of classes, but it is [9] S&C Enterprises, Hacking secrets revealed, 2000
necessary to contain these three functions. The [10] Anonim, Maximum Security: A hacker’s guide to
LoadPlugin() function receives a string of characters as a protecting your Internet Site and Network, Macmillan
parameter containing the full path to a plugin that is first Computer Publishing, 1997
checked and then loaded into the memory. [11] Kate Gregory, Using Visual C++ 6 Special
Edition, Que, 1998
To load plugins, it is necessary they are identified. [12] Marshall Brain, Lance Lovette, Developing
This is done by the LoadPluginsIntoList() function. This Professional Applications in Windows 95 and NT Using
will scan all subfolders from \Plugins to identify all MFC, Prentice Hall, 1996
plugins. [13] MSDN Library Visual Studio 6.0, Microsoft,
2000
Running a plugin can be done on user request by [14] Anonymous, Hacking into computer systems – A
selecting the corresponding plugin and then the Run
beginner’s guide, 1998
button. This will execute the void [15] Cisco, Understanding TCP/IP
CPluginDlgBar::OnButtonRunPlugins() function. [16] Terry Dawson, Philip Hazel, Linux Network
Administrator’s Guide, O’Reilly 1993

41

S-ar putea să vă placă și