Kamis, 08 Januari 2004

Happy 1st Birthday TaoSecurity Blog

Today this Blog is one year old. My first post was 8 Jan 03. I started this Blog as a "hard drive for my brain," since I dislike keeping bookmarks and I prefer to place Internet links and news within context.

I decided today to try to get VMWare 3.x working fully within FreeBSD, so I installed the VMWare3 port (version vmware3 3.2.1.2242-2) on my FreeBSD 4.9 STABLE system. First I made this change as recommended by the port install directions:

janney# sysctl kern.ipc.shm_allow_removed=1
kern.ipc.shm_allow_removed: 0 -> 1

I then added this line to /etc/sysctl.conf to enable this at boot time:

kern.ipc.shm_allow_removed=1

I then mounted linproc:

janney# mount_linprocfs linproc /compat/linux/proc
janney# mount
/dev/amrd0s1a on / (ufs, NFS exported, local)
/dev/amrd0s1h on /home (ufs, local, soft-updates)
/dev/amrd0s1g on /tmp (ufs, local, soft-updates)
/dev/amrd0s1e on /usr (ufs, local, soft-updates)
/dev/amrd0s1f on /var (ufs, local, soft-updates)
procfs on /proc (procfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)

I added this line to /etc/fstab to enable this at boot time:

linprocfs /usr/compat/linux/proc linprocfs rw 0 0

I executed '/usr/local/etc/rc.d/vmware.sh start' and saw it created a new pseudo-interface:

vmnet1: flags=8943 mtu 1500
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::2bd:65ff:fee2:6601%vmnet1 prefixlen 64 scopeid 0x9
ether 00:bd:65:e2:66:01

I also saw the following existed:

janney# ls /compat/linux/dev
hda null tty0 tty10 tty12 tty3 tty5 tty7 tty9 vmnet1
hdb rtc tty1 tty11 tty2 tty4 tty6 tty8 vmmon

I made sure my /usr/local/lib/vmware/licenses/user/license.ws.3.0 file had the appropriate license, and then fired up VMWare. I installed Red Hat Linux 6.2 as a test OS. For networking I created a "custom" entry with /dev/vmnet1. Once the OS installation was complete everything worked. I could ping my gateway and reach the VM from outside hosts.

Selasa, 06 Januari 2004

Finisar Tap Advice Strains the Brain

At left is an image of the Finisar Ethernet tap I use in my basement to monitor traffic. I wrote about it last July when I explained the bad design of Intrusion Inc's tap. Today I was trying to find the UTP IL/1 at Finisar's site. I didn't find it, but I did find a document which shocked me. It's titled "Using Single Port Taps with IDS Systems" (.pdf). (Note to self: Intrusion Detection System Systems?)

This document mentions the IL/1 and advocates plugging the tap outputs into a hub. The problem with this is simple: a tap preserves the full-duplex nature of a link between switches. Full-duplex means both ends can transmit simultaneously. What happens to packets transmitted simultaneously when they enter a hub? BANG -- collision. That's no problem on a half-duplex medium like unswitched Ethernet, since the transmitters will sense the collision (hence Carrier Sense Multiple Access Collision Detection). The parties will back off and retransmit, hoping for better luck next time.

With a full-duplex tap, there is no retransmission. The two simultanous packets collide and the original transmitters never hear the packets' silent death scream. I see many posts to IDS newsgroups advocating this horrible design strategy, with posters cheerfully claiming their IDS handles Fast Ethernet speeds with no packet loss. The problem is their IDS never sees the majority of the traffic, as it dies in a collision-ridden blaze of misfortune.

Below is a capture of the document in question:

Note there is no problem with the Finisar tap itself, only with this poor design advice. This is in contrast with the Intrusion SecureNet IDS Tap 10/100. It sports a single transmit output, meaning it combines two transmission streams, potentially operating at over 50 Mbps, into a single output. When the total of the two TX inputs exceeds 100 Mbps, we have another traffic issue -- dropped packets.

Someone please email me at blogspot at taosecurity dot com to tell me I'm misinterpreting this Finisar document. I don't see how this is a good idea. The document even shows two cables going straight into a hub. Unbelievable.

Options for Security Shell History in FreeBSD

I was looking for a tool to secure shell histories in FreeBSD. Ideally I was looking for the FreeBSD equivalent of Snare, which can record user activities on Linux, Windows, and Solaris. I learned today Snare is the foundation for the Forensix Project. The Honeynet Project links to several tools, including the Sebek LKM. Ryan Barnett of honeypots.sf.net wrote an extensive guide (.pdf) to Snare usage.

Unfortunately I couldn't find exactly that, but I did locate this excellent article at DefCon1.org. The author explains how to use FreeBSD's chflags utility to prevent users from deleting the Bash .history file. The author also explains how to set up process accounting via acct and mentions briefly how to use the sa and lastcomm utilities. His recommendations worked on one of my FreeBSD 4.9 REL boxes as described.

Senin, 05 Januari 2004

Review of Understanding Open Source Software Development Posted

Amazon.com just posted my four star review of Understanding Open Source Software Development, a new addition to my Listmania List on Management and Policy. From the review:

"UOSSD is the perfect introduction to OSS for those outside the community. The book takes a fairly balanced look at the people and processes which define the open source movement. Although some aspects of the book have grown stale over the last three years, I still recommend UOSSD to those desiring a deeper look at the open source phenomenon."

This is my first new review of 2004. Last year I read and reviewed 33 technical books.

Minggu, 04 Januari 2004

Binary Patching with OpenBSD

I tried the Binpatch binary patching system for OpenBSD today on an OpenBSD 3.3 system. I downloaded each of the archives listed for my version and then architecture, and sequentially applied them starting with 001 and ending with 008. The binpatch author Gerardo Santana Gómez Garrido told me I could avoid applying all of the kernel patches if I installed the newest one, but all of the userland patches needed to be applied. Since it was simple enough to install all of the eight archives, I tried that.

Essentially I downloaded all eight archives and applied each as follows. So, to apply the first set of patches:


wget http://www.openbsd.org.mx/pub/binpatch/3.3/i386/binpatch-3.3-i386-001.tgz

tar -xzvpf binpatch-3.3-i386-001.tgz -C /


Then I downloaded the second set and untarred them, and so on. When I was done I rebooted and found my system had a new kernel:


OpenBSD 3.3 (GENERIC) #3: Sat Oct 4 12:38:19 CDT 2003

santana@santana.openbsd.org.mx:/root/binpatch/work-binpatch-3.3/

src/sys/arch/i386/compile/GENERIC


Note my kernel was GENERIC to begin with.

Jumat, 02 Januari 2004

Chaosreader Rocks

For a while I've been looking for a program to extract application layer data from pcap files. We all know how to rebuild sessions using Ethereal and some of us know about tcpflow. Today I found Chaosreader. It's a Perl script which parses pcap or snoop files and extracts email, images, HTML, telnet sessions, and other application data. I think this part of the Perl script defines its capabilities:


# These ports have been selected to be saved as coloured 2-way HTML files

#

@Save_As_HTML_TCP_Ports = (21,23,25,79,80,109,110,119,143,513,514,1080,

3128,4110,5000,5555,6660,6665,6666,6667,6668,7000,8000,8080,9000);

@Save_As_HTML_UDP_Ports = (53);



#

# These ports have been selected to be saved as realtime playback scripts

# (telnet, login, and numerous IRC ports)

#

@Save_As_TCP_Playback_Ports = (23,513,4110,5000,5555,6660,6666,6667,

6668,7000,8000,9000);

@Save_As_UDP_Playback_Ports = (7);


Chaosreader presents the information in .html files for easy browsing. When it rebuilds a session, say for telnet, it creates a Perl script that you can run to watch the keystrokes replay in real time. I'm looking forward to seeing the author implement X11 replay. The Review package is supposed to have this capability but I've never tried it.

Ipsumdump Summarizes Network Traffic

I came across Ipsumdump today. It's a program to read traffic and summarize what it sees in a user-defined format on one line. In the example below I watch the sf1 interface in real time and tell Ipsumdump to show a timestamp, source IP and port, and destination IP and port. Ipsumdump works against multiple interfaces simultaneously as well as pcap files and NetFlow traces. In the example below the first two packets are an ICMP echo and echo reply, followed by the beginning of an SSH session.



bourque# ipsumdump -tsSdD -i sf1

warning: sf1: no IPv4 address assigned

!IPSummaryDump 1.1

!creator "ipsumdump -tsSdD -i sf1"

!host bourque.taosecurity.com

!runtime 1073092478.545313 (Fri Jan 2 20:14:38 2004)

!data timestamp ip_src sport ip_dst dport

1073092486.925087 172.27.20.11 - 192.168.60.3 -

1073092486.925253 192.168.60.3 - 172.27.20.11 -

1073092529.535523 192.168.50.2 23924 192.168.60.3 22

1073092529.535689 192.168.60.3 22 192.168.50.2 23924

1073092529.543094 192.168.50.2 23924 192.168.60.3 22

1073092529.545758 192.168.60.3 22 192.168.50.2 23924