This paper looks at daemon programs and kernel modifications to a FreeBSD server which monitor and log these suspicious network activities. A summary and review of the last seven months of log information will be given for the FTP and WWW server - minnie.cs.adfa.oz.au.
There are many tools available for network administrators to discover possible weaknesses in a server's network security - SATAN and Strobe are two examples. These tools are just as useful to would-be intruders. `Underground' FTP and WWW sites also have tools to perform attacks such as IP spoofing, shared-library attacks, and to exploit known holes in such programs as sendmail and telnetd. Existing operating systems do not detect the use of these tools and methods, nor do the attacked systems let the network administrator know of their use. CERT advisories describing these attacks can be found on the CERT and AUSCERT FTP servers at ftp://ftp.cert.org/ and ftp://ftp.auscert.org.au/.
Over the past few years I have been running a small FTP and WWW site to provide information about FreeBSD and NetBSD. I've also been involved in setting up an Internet firewall at ADFA. After reading several papers and books about network security and firewalls, I quickly realised how vulnerable most Internet systems are. As part of the security-tightening on my own server, I was motivated to modify the source code of the server's kernel to detect attempts to connect on unused network ports, and to reject packets with `suspicious' options. These modifications allow me to observe many of the attacks currently in use and may also highlight those services which intruders believe to be vulnerable.
I've also modified my server to prevent IP and TCP spoofing attacks and to log incoming packets for services such as TFTP, NFS and RSH. Although none of these have been triggered yet, they should provide more information about the intentions of a would-be intruder.
Minnie runs no other services. I use the wonderful tool called TCP_Wrappers, written by Wietse Venema, to protect services such as rsh, rlogin and converse. TCP_Wrappers allows or denies connections to particular services depending on the IP address from where the request comes. On Minnie, requests to these services from outside my department are rejected, and the requests are logged. TCP_Wrappers is a great utility, and if you're running any Internet connected Unix machine, I'd recommend using TCP_Wrappers on it.
The following kernel modifications were made, adding 37 extra lines of C code to the system:
These changes don't log the contents of the packets for two reasons. Firstly, logging packet contents will slow down the kernel and lower the system's performance. Secondly, the amount of data logged will be enormous; Minnie receives broadcast packets to UDP port 520 every few minutes from the subnet's router, not something that I'm particularly interested in logging.
To remedy this, I have written my own replacements, tcpsuck and udpsuck which are run by inetd to log TCP and UDP packets on particular unused ports. For ports which do have services on them, TCP_Wrappers can divert suspicious requests to these programs while still servicing legitimate users.
None of these programs have yet been triggered by would-be intruders. However, here are some example logs where I have tried to break in to Minnie from an external site:
Jan 25 12:15:10 Pkt from some.where.com port 1062 to tftp 0- 00012f65 74632f70 61737377 64006e65 ../etc/passwd.ne 16- 74617363 696900 tascii.
Jan 25 13:35:03 Data from some.where.com port 1016 to login 0- 00776b74 00726f6f 74007874 65726d2f .wkt.root.xterm/ 16- 39363030 00 9600.
Due to the design of the Sun RPC protocols, a simple UDP packet logger won't capture the attempted RPC request. A program like Bellovin's portmopper program is required. I've altered Wietse Venema secure portmap daemon to perform RPC logging. Here's an example attempt to mount Minnie's root filesystem:
Feb 16 12:32:34 bad getport(nfs) from happy.cs.adfa.oz.au Feb 16 12:32:34 bad getport(mountd) from happy.cs.adfa.oz.au Feb 16 12:32:35 fake connect from happy.cs.adfa.oz.au to mountd 0- 322031d2 00000000 00000002 000186a5 2 1............. 16- 00000001 00000001 00000001 00000030 ...............0 32- 3123dd3a 00000013 68656e72 792e6373 1#.:....happy.cs 48- 2e616466 612e6f7a 2e617500 00000000 .adfa.oz.au..... 64- 00000000 00000002 00000000 00000000 ................ 80- 00000000 00000000 00000001 2f000000 ............/...
This minimises the chance of receiving fake log messages.
All system administrators need a tool which summarises the log files and highlights what the system administrator considers suspicious activity. How frequently the tool runs and what it highlights depends on the system's security requirements. On Minnie, a cron job reads through through the logs daily looking for suspicious behaviour. The result is emailed to me on another machine. A part of the summary shows TCP_Wrapper's activity and the results of my kernel modifications. Here is an example report:
From: Minnie Bannister
Date: Fri, 26 Jan 1996
To: wkt@cs.adfa.oz.au
TCP Connections
---------------
ftp connections: 378 ftp refusals: 0
sendmail connections: 10 sendmail refusals: 0
finger connections: 0 finger refusals: 2
rlogin connections: 0 rlogin refusals: 0
rsh connections: 0 rsh refusals: 0
telnet connections: 2 telnet refusals: 0
08:53:49 fingerd[13074]: ccadfa.cc.adfa.oz.au
10:28:07 fingerd[18732]: rudolph.north.pole.com
Attempted TCP Port Connects: 1
--------------------------------
Port 1713: 1 attempt
14:21:48 TCP proto 1713 from 206.20.189.10, port 1075
Attempted UDP Port Connects: 3
--------------------------------
Port 33492: 1 attempts
Port 33493: 1 attempts
Port 33494: 1 attempts
10:50:12 UDP proto 33492 from 129.72.40.4, port 41776
10:50:13 UDP proto 33493 from 129.72.40.4, port 41776
10:50:14 UDP proto 33494 from 129.72.40.4, port 41776
The first section summarises the information from TCP_Wrappers. There were only two connection refusals, both to the finger service. The next two sections show the attempted connects to unused TCP and UDP ports. The UDP connections show a traceroute to Minnie. I have no idea what's on TCP port 1713; the program which produced the summary would have given the name of the port if it was in the file /etc/services.
There is not much to report here. There were a few rlogin attempts, but none as root. Throughout May and June there was a person trying to ntalk to Minnie on the POP3 port, with no success.
The main suspicious activity here was SNMP packets. On 12 April 1996 I received two SNMP requests for Minnie's `public' SNMP information. On 15 June 1996, I had 16 SNMP packets for the following information: public, private, noAuth and medusa. These must be considered suspicious. There were no SunRPC requests, surprisingly.
| Port | Jan | Feb | Mar | Apr | May | Jun | Jul | Total |
| auth | 555 | 533 | 1134 | 1711 | 1860 | 1144 | 1468 | 8405 |
| 0 | 1 | 0 | 0 | 264 | 0 | 1 | 4 | 270 |
| nntp | 18 | 7 | 11 | 10 | 3 | 1 | 2 | 52 |
| alt-www | 1 | 4 | 6 | 2 | 2 | 0 | 3 | 18 |
| time | 0 | 15 | 0 | 0 | 0 | 0 | 0 | 15 |
| alt-www | 3 | 3 | 2 | 0 | 5 | 0 | 0 | 13 |
| gopher | 4 | 0 | 0 | 1 | 1 | 4 | 2 | 12 |
| daytime | 0 | 0 | 5 | 1 | 3 | 1 | 1 | 11 |
| 4987 | 0 | 0 | 7 | 0 | 0 | 0 | 0 | 7 |
| utcd | 0 | 0 | 0 | 0 | 6 | 0 | 0 | 6 |
| 2263 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 6 |
| 2924 | 5 | 0 | 0 | 1 | 0 | 0 | 0 | 6 |
| callbook | 0 | 0 | 1 | 0 | 2 | 0 | 0 | 3 |
| nfsd-status | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
The connects to auth are legitimate Ident requests which are mainly sent by remote mail servers. Connects to the nntp, gopher and alt-www ports failed because I don't run these services, and my Web server runs on port 80, not 8080 or 8001.
Some of the connection attempts were the result of TCP port strobes; I had ten strobes from five machines in the seven-month period, with one machine performing six of the strobes. I cannot explain why the remaining connect attempts were done.
| Port | Jan | Feb | Mar | Apr | May | Jun | Jul | Total |
| 2371 | 3 | 2 | 3 | 0 | 0 | 101 | 10 | 119 |
| netbios-ns | 0 | 0 | 0 | 0 | 0 | 20 | 68 | 88 |
| 9067 | 0 | 0 | 0 | 0 | 0 | 69 | 0 | 69 |
| 1198 | 7 | 10 | 3 | 0 | 2 | 3 | 1 | 26 |
| 1792 | 4 | 6 | 0 | 4 | 7 | 1 | 4 | 26 |
| 3066 | 14 | 1 | 3 | 2 | 3 | 1 | 1 | 25 |
| mciautoreg | 5 | 3 | 2 | 7 | 1 | 4 | 1 | 23 |
| 1723 | 5 | 8 | 0 | 2 | 3 | 2 | 3 | 23 |
| 2761 | 10 | 4 | 1 | 2 | 1 | 2 | 2 | 22 |
| 2645 | 6 | 6 | 2 | 1 | 2 | 2 | 3 | 22 |
| submitserver | 6 | 6 | 1 | 3 | 0 | 1 | 4 | 21 |
| bootserver | 6 | 2 | 2 | 1 | 2 | 0 | 1 | 14 |
| 33487 | 2 | 1 | 2 | 3 | 1 | 2 | 2 | 13 |
| 33490 | 2 | 1 | 4 | 1 | 2 | 2 | 1 | 13 |
| 33493 | 6 | 0 | 2 | 1 | 1 | 2 | 1 | 13 |
| 33494 | 6 | 0 | 2 | 1 | 1 | 2 | 1 | 13 |
I have no idea why there is much more unwanted UDP traffic than TCP traffic. Packets to submitserver and bootserver ports might be suspicious, and I will add a UDP sucker to these ports. The packets to ports 33,480 and up are the result of traceroutes to Minnie and are normal. Again, I am at a loss to explain why the other packets were sent.
From January to July, bursts of TCP connection packets were seen 21 times. Most of these events were caused by over-enthusiastic Web robots or FTP catalogue agents. Three of these events, on 3 February 3, 23 February and 25 March 1996, were likely TCP sequence attacks. Because Minnie's TCP sequence number code has been fixed, the attacks failed.
| Login Name | Attempts | Login Name | Attempts |
| anonymous | 15 | new | 2 |
| guest | 11 | sys | 1 |
| root | 8 | user1 | 1 |
| ftp | 3 | uucp | 1 |
| www | 2 |
OAA25891: to=/root/dead.letter, ctladdr= root (0/0), delay=00:00:00, mailer=*file*, stat=Can't create output: Permission denied
On 9 April 1996, a remote user tried to use the EXPN and VRFY mail commands. These are disabled as Minnie has no users other than the super-user.
| Login Name | Attempts | Login Name | Attempts |
| guest | 15 | quit | 5 |
| root | 12 | cd | 5 |
| user | 6 | pwd | 1 |
| ls | 6 |
The number of misspellings of `anonymous' is quite incredible:
ANONYNOUS, ananonymous, anaoymous, annonymous, announimous, annoymous, anomous, anomymous, anon, anonimous, anonmous, anonomous, anonumouns, anonymosu, anonymouis, anonymouns, anonymous, anonymouse, anonymouys, anonymoyus, anonymozs, anonympp, anonympus, anonynous, anonyomos, anonyomus, anonyous, anoymous, anoynmous
As well as bad FTP logins, many anonymous logins tried to create new files and directories, change permissions on and/or delete existing files and directories. Only one anonymous login downloaded /etc/passwd and /etc/group. This didn't matter, as the copies used by the anonymous login don't contain any passwords and have several user-ids removed.
| Missing Script Name | Requests | Missing Script Name | Requests |
| cgi-bin/pursuit | 13 | cgi-bin/phf | 2 |
| cgi-bin/query | 7 | cgi-bin/news | 1 |
| cgi-bin/nph-randurl | 3 | cgi-bin/mail-archive.pl | 1 |
| cgi-bin/dave.html | 2 | cgi-bin/where | 1 |
Minnie does not attract much attention as she is a small server on the Internet. Results from machines like archie.au or munnari.oz.au would be much more interesting.
I have added code to the FreeBSD kernel to detect connections on unused TCP and UDP ports and other suspicious network packets. Results to date show little suspicious behaviour. I have also written programs to log actual packet contents for suspicious connection attempts which can give even more information about attempted breakins.
Logging information is useless unless the information it contains is brought to the system administrator's attention in a useful and timely way. Automated and semi-automated tools are needed to summarise the logged data and present it to the administrator in a way which highlights activity which she/he considers suspicious.
Finally, individual system administrators can only monitor their own systems. They are not in a position to perceive trends in intruder activity. The collection of suspicious activity logs from several machines by an organisation such as AUSCERT may help to detect potential intruders before they wreak too much havoc. This can only be done if the information can be provided in a rational and machine-parseable format, and if the collection and analysis is performed in a (nearly) fully-automatic manner.
If you have control over your network connection, and in particular the routers, you should consider implementing some form of firewall. There are several commercial and freeware products to help you do this. Before you start, get one of the following two books:
These books outline what a firewall is, what it can and cannot do, how to set up firewalls, routers and bastion hosts, how to construct a network security policy and what to do if you are attacked. Cheswick & Bellovin's book was reviewed in the February 1995 AUUGN, and Chapman & Zwicky's book was reviewed in the October 1995 AUUGN.
The kernel patches and user-mode tools I've described in this paper are available at ftp://minnie.cs.adfa.oz.au/pub/NetSecurity/ In there you will find the following tar files:
Return to Conference Proceedings