This is a VERY old command line tool for probing around websites looking for open directories.
Generally used just for snooping around where you really shouldn't be, or making sure your own sites aren't exposing anything unintentionally.
Cgichk is from a much older time. I barely remember anything about it, and I certainly don't recognize the code.
Hell, I can't even remember if I wrote this from scratch back in the day, or if I modified someone elses code!
How do you like that?! ;)
UPDATE: Just had to peek inside the main file to get answer that one: nope, I forked this from a tool called "CGI Checker" by a dude named "su1d sh3ll".