Friday, July 09, 2004

Using Perl to follow a symlink

Problem: If someone has a stupid app that puts a link say in /etc/rc3.d on say RedHat Linux chkconfig --list won't know about it because the corresponding source script isn't in /etc/init.d.

Solution:
In Perl after making use of the opendir call and reading all of the files you have two options to follow the symlink.
1. Blindly follow the symlink with open(FH,glob("Filename"))
2. Do it the more efficient way with readlink("filename"); This will return the path the link is pointing to


More info see perldoc perlfunc

Thursday, July 08, 2004

Dumping a partition table on MacOS X

How do you dump the partition table on OS X?
Coming from Linux I would have thought you would use fdisk, however, I found that fdisk is not the tool you should reach for. Instead pdisk is the command and its argument list is a little "backward". It takes the device first then the option.

pdisk /dev/disk0 -dump

More info pdisk(8)
or by man pdisk on OS X.

Wednesday, July 07, 2004

Experiences installing MetaSploit 2.1 on Panther (10.3.4)

Metasploit is covered more extensively in Richard Bejtlich blog "The goal is to provide useful information to people who perform penetration testing, IDS signature development, and exploit research." Seemed like a great tool / toy Metasploit Project for IDS.

Once downloaded the install requirements are Term::ReadLine::Gnu which ships as part of the Metasploit (framework) distribution, but it requires the readline library in order to install, so grab your trusty Developer Tools CD, or readline and the patch and install readline.

Once completed installing Net::SSLeay is a simple of matter of either "perl Makefile.PL && make && sudo make instal" or using CPAN to install the module.

Now you should be able to cd into the frameworks directory and execute the user interface that you feel comfortable with.

Installing ReadLine-4.3 Panther (10.3.4)

This was a painful experience, I did this while at a T-mobile hotspot and didn't have my trusty Developer Tools CD. In my search to make this work I found the following patch: http://stats.math.uni-augsburg.de/~urbanek/readline-4.3-OSX-patch that allows you to "./configure && make && make install" readline-4.3 without incident.

Welcome to my blog

I opted to make use of myaccounts, because I couldn't think of a more generic way to describe "The world through my eyes."