Friday, December 30, 2005

Build a gentoo stage1 tarball without catalyst

I've written a script that will generate a Gentoo stage1 tarball without catalyst. It basically emerges packages.build to /tmp/stage1root (much like catalyst). But rather on relying on a stage3 tarball to generate the stage1 as catalyst does, my script will use your current system compiler, binutils, glibc, etc to build it. One could also use this within a chroot also.


For example, I downloaded the Gentoo stage3-i686-2005-r1.tar.bz2. I then untarred, mounted, then chrooted into it. From there, I upgraded my compiler to gcc 4.1, binutils to 2.16-r1, and glibc to 2.3.90 (Conrad Method 8.3) . I then use this script to generate a stage1 with the new toolchain. The resulting tarball can now be installed via the normal bootstrap.sh && emerge - e system method. All the overlay, /etc/portage, and make.conf stuff is already in the tarball. You may want to edit the make.conf to comment out the stage1 C{XX}FLAGS and uncomment the original system C{XX}FLAGS.


Anyway, I use it frequently so I figured others may find it of some use. Here is the script and ChangeLog . I'll probably be adding a non-interactive flag in the near future, so watch for the update ;)

Monday, December 05, 2005

Gtk2 enabled frontend for Nmap in Gentoo

UPDATE: My Gtk2 stuff is now in nmap stable :)
UPDATE: New development version of Nmap with my patch incorporated is available. Check out the "Official" blessing :)
UPDATE: Looks like the patch was accepted upstream and will be included in the next release of nmap. I've attached the email I received below :)

Nmap is a very powerful network scanning tool. While the command line is sufficient, the gui allows one to see all the various options at a glance. Unfortunately, the gui frontend is written in gtk1 (yuck!). So I, believing I'm not the only one who is faced with this dilemma, queried my best friend, Google. He pointed me to this article that provided a very good starting point.
Using these sources, I generated a patch and ebuild for Gentoo. I also added support for using the gksu package to launch the frontend with root privileges. This is quite hackish, so be warned.

Old and Busted
New Hotness

The Ebuild is here

Edit:
I've submitted this to the Gentoo Bugzilla and also filed a Problem Report for FreeBSD


From: Fyodor <fyodor@insecure.org>
Date: December 6, 2005 4:19:34 PM CST
To: Meethune Bhowmick <meethune@oss-institute.org>
Subject: Re: [PATCH] Build NmapFE with GTK2

On Tue, Dec 06, 2005 at 09:32:51AM -0600, Meethune Bhowmick wrote:
<snip>

Thanks, I have applied this for the next version of Nmap.The next
development version should be posted to the nmap-dev list within the
next few days (maybe today).

Cheers,
-F

Friday, October 14, 2005

Blacklist SSH Bruteforce Fools

If you run OpenBSD. Add this to your pf.conf
#table of bad-guys
table <fsckers> persist file "/var/db/fsckers.txt"
#Block Blacklisted IPs
block in on $external from <fsckers> to any
/var/db/fsckers.txt is a plaintext file with each blacklisted ip / ip-block on a seperate line. Lines starting with # are considered comments.

Then I wrote this little script that I run hourly via cron to update my blacklist table based on failed password attempts.
#!/bin/sh
echo "Started on: $(date)"
for each in $(grep 'Failed password' /var/log/authlog | sed 's/^.*from //;s/port.*$//' | uniq)
do
echo -n "$each\t\t--->"
pfctl -t fsckers -T add $each 2>&1
done
I guess I also need to extend this so that it also adds it to /var/db/fsckers.txt, but that is trivial. The text file in only needed when initially loading the list.

To view the current list of blacklisted ip, type:
pfctl -t fsckers -T show
EDIT: here is my script to dump the current blacklist to fsckers.txt
#!/bin/sh
pfctl -t fsckers -T show | sed 's/^ //' > /var/db/fsckers.txt

Thursday, October 13, 2005

...and darn it, people like you.

"Happiness is not achieved by the conscious pursuit of happiness; it is generally the by-product of other activities."
- Aldous Huxley

Wednesday, October 12, 2005

Create and burn DVD's from the command line.

One of the more annoying "features" of Linux burning software are the innumerable parameters and switches. After doing a "man growisofs" too many times, I decided to take matters into my own hands. Once again, bash comes to the rescue.
I rarely create data dvds. I am usually creating my own dvd video or burning backups of my dvds. So these scripts are specifically for creating and burning dvd video .iso files. They depend on 3 programs. The first is growisofs which is provided by dvdrtools (http://www.nongnu.org/dvdrtools/). Second is dvdimgcmp (ftp://sunsite.unc.edu/pub/linux/apps/video/dvdimagecmp-0.3.tgz). It will verify a burned image is the same as the original .iso . The last program is mkisofs which is provided by cdrtools (http://cdrecord.berlios.de/old/private/cdrecord.html). The only thing I think that you probably need to install is dvdimgcmp (or comment out that portion of the script). Anyway, here are the scripts. I've only tested it on my gentoo machine. So as always, I take no responsibility if it breaks your machine or makes your mother cry. And if it doesn't work for you, don't use it :) .

http://www.mercymachines.net/scripts/burndvd
(edit ${DVD_BURNER} so that it points to your burning device)

http://www.mercymachines.net/scripts/mkdvdiso

Monday, October 10, 2005

Backup your Firefox profile.

Here is a little script I wrote to backup one's firefox profile. It won't handle multiple profiles, so be warned.

http://www.mercymachines.net/scripts/backup-firefox

Saturday, September 03, 2005

Help! Katrina survivors in Picayune need immediate assistance!

It has been brought to my attention that Picayune, MS is out of survival supplies (food, water, ice, medicine). Many people from New Orleans evacuated to Picayune. Feds are nowhere in sight. Like always, it is up to the generous and caring citizens of this great nation to pull together and get things done. If you or anyone you know can get supplies to Picayune, do so now. OSSI has some advice on how you can help. Cash donations to the Red Cross are nice, but the people in Picayune are in dire straits and actual survival supplies are needed now. Things are getting desperate. I will post more information as it becomes available.