What I’m listening to…

July has found me working out more often and more consistently. One of the big challenges with staying on an exercise machine is the tedium. It is boring. I’ve found audiocasts have helped me pass the time, occupy my mind and make me feel the time spent is more worthwhile. This month and last, I’ve listened to:

  • The keynote presentations from the RedHat Summit 2007
  • Nearly all the videos from the RedHat site
  • Several weekly Technometria audiocasts
  • David Weinberger on ‘Everything is Miscellaneous
  • Chris Lydon interview David Weinberger
  • David Weinberger interviewed Cory Doctorow
  • Several Boston PHP meetings
  • The Massachusetts Technology Leadership Council’s Open Source Summit presentations (thanks Dan Bricklin!), including discussions on GPL3, the OLPC, Lightning Presentations, and more.

I’ll plug them any chance I get: the GigaVox network has some of the best, most interesting, high-quality audiocasts for techies on the web. I’m a contributing member and I encourage you to do the same.

Wicked weather this way comes…

“Cap’n, the dilithium crystals can’na take much more of this…” We’ve been getting battered by thunderstorms for days on end, a pretty unusual weather pattern for northern New England. Normally, we’ll get a line of showers through after a hot spell as cold air blows in. But we’ve been deluged since Sunday with oppressive clouds, lots of lightning and thunder, occasional downpours, ominous mid-day darkness and several blackouts. That’s a good reminder to make sure all your precious electronics are on surge suppressors or UPSes. The UPS on the iMac died an ugly death after a close lightening strike and power blink: it went off, beeped, kicked backed on, worked for a few seconds, beeped, went off,… I powered off the iMac quickly and disconnected the unit. Powering it up the next day, the UPS appeared to be okay, but once I put it under load again, it started showing the same symptoms.

Be careful out there. Power down everything and disconnect it from the walls when you see a storm coming in. Lightening crosses miles of open air to short-circuit the clouds to the ground; leaping across your surge suppressor isn’t even a challenge. And even if the manufacturer offers some cash coverage, it’s likely that having your machine working today, with your data and your applications up and running, is worth a lot more than the depreciated value of the hardware you might get reimbursed.

Resistance is not futile

Tim O’Reilly notes in Update: Firefox vs. IE in OReilly Network Logs, “as of last month, Firefox passed IE, with 46% of all access to OReilly sites, vs IEs 45%.” Now, one percent is not significant, and the cause can likely be explained in a number of ways; perhaps there are more popular FOSS books than new Vista books in the past few months. But it is great to see that competition continues to prod Microsoft to compete, and inspires Mozilla to achieve.

Developers Increasingly Targeting non-Windows Platforms

“Windows dominance on the client is cracking, according to the latest release of Evans Data Corp’s North American Development Survey. Targeting of the Windows OS has declined by 12% from a year ago, continuing a two-year gradual decline. Currently 64.8% of North American developers are targeting some version of Windows, as opposed to 74% last year and this is expected to drop another 2% in the coming year. Although Windows remains the largest market segment, Linux targeting has increased by 34% from 8.8% a year ago to 11.8% today.”

Source: http://www.evansdata.com/n2/pr/releases/WindowsInDecline2007.shtml

Via: http://holdenweb.blogspot.com/2007/07/developers-migrating-away-from-windows.html

The BFC Computing Weblog : Ditching Linux

In the The BFC Computing Weblog, Bill McGonigle explains how Ditching Linux is actually a good case study for why Free/Open Source Software is better than proprietary software. In a word: standards. Bill swaps Linux for BSD, Mac OS for Linux and OpenSolaris for Linux and everything still works.

Brute Force Detection (BFD) script for vsftpd

vsftpd is the “very secure file transfer protocol daemon” and a great product to use for file transfers. Unfortunately, a bunch of script kiddies and zombies runs scripts guessing the 2283 most common user name and password combinations. Sometimes, I’ll see several of these runs of login attempts in a single day, peaking one day at over 13 thousand bogus login attempts. I resent the amount of time, resources, bandwidth and power my server has to spend rejecting these attempts.

Last year, I blogged about the script Brute Force Detection that works with many servers and reads the logs to ban repeated failed login attempts. Unfortunately, it did not have the settings to read vsftpd generated logs, and there were not any directions simple enough for me to understand to set one up. A year passes, I read more, learn more, expecially the great Man Page of the Month sessions at MonadLUG, and I find a couple of hours to hack at this, motivated by yet another log report filled with vsftpd login attempts. Here’s what I did:

BFD uses rules files that are portions of scripts customized for the particular log to read, the messages to look for, and the locations at which the IP addresses of the offending attacker can be found. When each rule file in turn is read into the main BFD script, it becomes part of a set of commands that slices and dices the log, finds the (adjustable) number of excessive attempts, and issues the commands to ban attempts from that IP address. The trick is figuring out what commands you need to implement to return the stream of IP addresses in the correct format. Here’s an example, the sshd rule file:

REQ="/usr/sbin/proftpd"
if [ -f "$REQ" ]; then
LP="/var/log/secure"
TLOG_TF="proftpd"
TRIG="15"

## PROFTP
ARG_VAL=`$TLOGP $LP $TLOG_TF | grep -w proftpd | grep -iwf $PATTERN_FILE | tr '[]' ' ' | tr -d '()' | awk '{print$10" "$13}' | tr -d ':' | awk '{print$1":"$2}' | grep -E '[0-9]+'`
fi

Boy, is that inscrutable! Here’s a quick tour: REQ is the required file (the binary that runs proftpd) so the script only runs if there is such a file (“fi” is the shell script equivalent of “if” – cute!). The other variables are used to feed the main processing line, starting with ARG_VAL. This line processes the log (named LP) through a series of pipes that filters the result down to the items that need to be processed. Grep processes lines through Globally searching, using Regular Expressions and Prints them through to the next command in the pipe. TR translates characters from one set to another, or -Deletes them. Awk is a simple text processing language, really handing for tricks like printing the tenth and thirteenth words out of a line.

Here’s the trick to working this out: take a log file you know has your suspect violations, use cat to feed it into the beginning of the pipe described above, and add item-by-item to the pipe to figure out what each does and what the final result looks like, in this case a text file IP Addresses and login names, something like:

192.168.1.1:fred
192.168.1.1:fred
192.168.1.1:fred
192.168.1.1:fred
192.168.1.1:barney
192.168.1.1:charlie
192.168.1.1:dave
192.168.1.1:eric

This is what BFD gets fed bac k to it. Then, it counts the number of attempts, compares that against the TRIG value set above, and if it exceeds the trigger level, executes the command (set in BFD’s configuration file, conf.bfd) to ban the offending attacker. (It also optionally sends an email to the admin, a good idea to ensure you’ve got things set up properly.)

Now, your installation of vsftpd may be a little different from mine, your logs may have different names and columns in different orders, so use this script only after testing out that it works properly with your configuration. Best of luck with it. Here’s my implementation of a script to detect vsftpd script kiddie attacks:

REQ="/usr/sbin/vsftpd"
if [ -f "$REQ" ]; then
LP="/var/log/messages"
TLOG_TF="vsftpd"
TRIG="15"

## VSFTPD
ARG_VAL=`$TLOGP $LP $TLOG_TF | grep -w vsftpd | grep -i rhost | grep -iwf $PATTERN_FILE | awk '{print $13":"$12}'| tr -d '[]()?@'| cut -d = -f 2,4 | grep -E '[0-9]+'`
fi

The cut command is a new one here: like the use of awk it lets you pick particular columns to slice out of the line, but also gives you the option to specify the delimiter that sets off the columns. In this case, I use cut to pick off the second half of two columns that are formatted as “rhost=192.168.1.1” and “ruser=badguy@badplace.com” to pick off the second values from each of those columns.

DLSLUG notes, 7-June-2007

The Dartmouth – Lake Sunapee Linux User Group held their meeting on the usual first Thursday, but at a new location: the Dartmouth Regional Technology Center, where Bill McGonigle has recently set up his new offices. Nice place!

Seven attendees found their way to the meeting, and we had an informal chat covering a wide range of issue: the challenges of single-person consultancies, the business of consulting, Nagios, Dartware, a new version of Logo from MIT, having a presence at Hanover’s Street Fest (July 28, btw).

Bill had an interesting proposal: that the group create a “chuck box” (Boy Scouts’ term, ref: http://www.troop168.net/forms/patrolboxa.htm) that could contain a GNHLUG-booth-in-a-box: a banner, handouts, a tent/canopy,… what else? Interesting idea.

Bill also recommended we check out http://www.zazzle.com if we’re considering making promotional items.

Good times had by all. No DLSLUG meeting in July; instead, you’re encouraged to come to the GNHLUG-wide BBQ July 15th. Hope to see you there!

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.