This doesn't seem like ethical hacking.
Also I wrote a perl program to do something like that which I posted on another forum.

I'll post it here later.