/*
 * 
 * dumpenv
 *
 * This plugin was written by Renaud Deraison and is released
 * under the GPL
 *
 */
#include <includes.h>

#define NAME "dumpenv"
#define DESC "The dumpenv CGI is a cgi-script which is\n\
part of the Sambar server. It can give away several informations\n\
that don't need to be known to the public\n\
Risk factor : Low/Medium"
#define COPYRIGHT "no copyright"
#define SUMM "checks for the 'dumpenv' CGI"




PlugExport int plugin_init(struct arglist *desc);
PlugExport int plugin_init(struct arglist *desc)
{
	plug_set_name(desc, NAME);
	plug_set_description(desc, DESC);
	plug_set_summary(desc, SUMM);
	plug_set_copyright(desc, COPYRIGHT);
	plug_set_category(desc, ACT_GATHER_INFO);
	plug_set_family(desc, "CGI abuses");
	return(0);
}


PlugExport int plugin_run(struct arglist * env);
PlugExport int plugin_run(struct arglist * env)
{
	if(host_get_port_state(env, 80)<=0)return(0);
        if(is_cgi_installed(env, "dumpenv.pl"))
        {
         post_info(env, 80,
"The CGI program 'dumpenv.pl' is installed, which is not\n\
a really good thing.\n\
Even though this is no a major flaw, you should delete\n\
this script");
        }
	return(0);
}
