Selasa, 11 November 2003

The Game of 'Life' in PostScript

Do you know the game of "Life"? The game was created by mathematician John Conway and described in this 1970 Scientific American article. Based on a small set of rules, the game looks at the initial configuration of a set of counters (representing "organisms") and moves them forward through time. Certain arrangements result in life, while others perish. The coolest implementation of this game is one in PostScript. Remember PostScript is a programming language, although it's mainly used to format documents. There's a Java version and another here.

SilentPCReview.com Provides Info on Quiet PCs

I'm thinking of building my own firewall appliance. It would be nice to have a "quiet" PC. I found SilentPCReview.com offers reviews, forums, and news on the quiet PC scene.

Minggu, 09 November 2003

My C-64 Rides Again



Thanks to a RR-Net kit, my Commodore 64 is now on the Internet. I browsed taosecurity.com using the Contiki Web browser and I served Web pages sing the Contiki Web server. It's slow, but really amazing to think a machine that hasn't been used in 13 years is now on the Internet! There's also a version of VNC which I haven't tried yet.



I still need to try downloading software and getting it to the C-64. The RR-Net package arrived with a 5 1/4 floppy containing Contiki.



Update: The Web server doesn't seem too stable. Twice I've left the box running in the basement only to find Contiki exited several hours later. Oh well, that's why I run FreeBSD.

Jumat, 07 November 2003

Using fastest_cvsup and freebsd-update Tools

While reading a OSNews thread on FreeBSD 4.9, I heard of a tool called fastest_cvsup. You use it in conjunction with cvsup on FreeBSD, NetBSD, and OpenBSD to find the "fastest" source distribution site. I use it in a shell script to update one of my boxes like this:


#!/bin/sh
# Ports updater by Richard Bejtlich
# 0925 07 Nov 03
SERVER=`fastest_cvsup -q -c us`

echo "cvsup -g -L 2 -h $SERVER /usr/local/etc/ports-supfile"
cvsup -g -L 2 -h $SERVER /usr/local/etc/ports-supfile

echo "cd /usr/ports; make index"
cd /usr/ports
make index

echo "portsdb -u"
portsdb -u

echo "cd /var/db"
cd /var/db

echo "pkgdb -F"
pkgdb -F

echo "portversion -v"
portversion -v

echo "portupgrade -PrRva"
portupgrade -PrRva

echo "Done updating ports tree at `/bin/date`."
exit


I changed my portsdb instruction after reading this thread. This article and this thread have tips too.

I also gave freebsd-update a try. It's a way to perform binary updates on FreeBSD systems that have not rebuilt the 'world' after installing a fresh RELEASE. I used freebsd-update on a 4.8 RELEASE system using these commands:

pkg_add -r ftp://ftp.freebsd.org/pub/FreeBSD/ports/packages/security/freebsd-update-1.4.tgz

cp /usr/local/etc/freebsd-update.conf.sample /usr/local/etc/freebsd-update.conf

mkdir /usr/local/freebsd-update

rehash

freebsd-update -v fetch

freebsd-update -v install


freebsd-update warned me "Don't forget to rebuild any statically linked ports to use the updated libraries after you install them." Colin gave me some background on this:

"Most applications from the ports tree (and packages) are dynamically linked, but a few aren't.
On my system, the only static binaries I have installed from the ports tree are bash and m3build.
If you have portupgrade installed, the following script will locate any static binaries which might be
out of date and run portupgrade interactively to rebuild them." Note this script should have backslashes
at the end of lines 2-5, but Blogger is removing them:

#!/bin/sh
find /usr/local -type f -perm +111 ! -newer
/usr/lib/`ls -art /usr/lib | tail -1` -print0 |
xargs -0 file | grep "statically linked" | cut -f 1 -d ':' |
xargs pkg_which | grep -v '^\?$' | sort -u |
while read x; do portupgrade -fi $x < /dev/tty; done

Colin continues: "Unfortunately, there isn't any easy way to determine if packages distributed from ftp.freebsd.org have been rebuilt with new libraries; in general, it's better to install the ports tree (and keep it up to date by using cvsup) and build everything locally."

Right now the freebsd-update maintainer, Colin Percival, only has the resources to provide binary updates for FreeBSD 4.7, 4.8, and 4.9. He's accepting donations via PayPal so he can support the 5.x tree. As of this morning he's got pledges and donations of $915, so I sent him $20 to show my support. Please consider matching my donation to get Colin above the $1000 level, where he'll build a new system to provide binary updates for the 5.x tree. Thank you!

This is an amazing tool. It only took minutes rather than the hours it might take to do everything from source. The major drawback is that it only supports the GENERIC kernel. This is fine for a project like the Sguil on FreeBSD appliance for which I wrote the documentation. However, people with multi-processor systems who need to add SMP support by rebuilding their kernel cannot use the current version of freebsd-update. When FreeBSD 5.2 is released, this will not be a problem. Colin told me "FreeBSD 5.2 is going to be an ideal target for FreeBSD Update, in fact, since the 'SMP problem' will be gone -- jhb committed code to -CURRENT a few days ago which eliminates the uniprocessor/multiprocessor distinction for kernels, so having more than one processor will no longer require that the kernel be recompiled."

One more tip: if you want to create a package when installing a port, use 'make package' after 'make'. If you want to create the associated dependencies when creating a package, use 'make package-recursive'.

Kamis, 06 November 2003

Testers for DRAFT Sguil on FreeBSD Installation Guide Needed

I announced the availability of Sguil 0.3.0, so I've been working on a new installation guide. I'm not a big Linux fan so I've been wanting to move my document to reflect FreeBSD. Today I completed the install guide and posted it at http://taosecurity.com/install_freebsd_4-9-REL_DRAFT.zip. If you're so inclined, download the installation doc and try it out.

I used FreeBSD 4.9 RELEASE only to have access to that distro's ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4.9-release/ packages. These are the same as would be found on the 4.9 CD-ROM. The only package I used from the ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4-stable/ section was OpenSSL, as version 0.9.7c was the latest. It appeared in the stable tree as ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4-stable/security/openssl-0.9.7c.tgz.

The reason I used the packages and not the ports tree was ease of installation. It can take quite a while to build some ports from source, so I opted for package installations for everything except Sguil, Snort, and Barnyard. The guide uses Snort 2.0.3 which was just released. Thankfully everything worked out fine.

I appreciate any comments people might have on the doc. I'd like to declare the guide "FINAL" by Monday.

Rabu, 05 November 2003

Snort 2.0.3 Released

Yesterday Marty released Snort version 2.0.3, which contains a few bug fixes. Last week Bamm announced the release of Sguil version 0.3.0. I still need to update the documentation. I had already planned a FreeBSD-only installation guide, even before all the turmoil with Red Hat Linux. I hope to have the guide done by next week.

A few weeks ago a good thread on snort-users discussed hardware for Snort and ways to avoid dropping packets.

Do You Bluejack?

Here's a great example of creative minds taking advantage of new technology. Those crafty, meddling kids in the United Kingdom have popularized a way to send text messages to unsuspecting owners of Bluetooth-enabled phones and PDAs. The BluejackQ (or "Bluejack You") site, apparently run by a 13 year old English girl, has all the details. Her site has been hammered recently by visitors, but she reports it's weathered the storm. Netcraft reports she's running Apache on Linux, so good for her!

A poorly edited by technically informative Slashdot post describes the underlying mechanics of the system used to send messages. As another Slashdot poster mentions, Bluetooth isn't like the Internet. If you get an unsolicited Bluetooth message, turn around. The sender can't be more than a few dozen yards away!