/*
 * 
 * count_cgi
 *
 * This plugin was written by Renaud Deraison and is released
 * under the GPL
 *
 */
#include <includes.h>
#define NAME "Count.cgi (wwwcount)"
#define DESC "The 'count.cgi' cgi is subject to a bug which allow\n\
a remote user to execute arbitrary commands on the attacked host\n\n\
Risk factor : high"
#define COPYRIGHT "no copyright"
#define SUMM "determines the presence of the 'Count.cgi' (wwwcount)"

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 * args);	
PlugExport int plugin_run(struct arglist * args)
{
	if(!host_get_port_state(args, 80))return(0);
	if(is_cgi_installed(args, "Count.cgi"))
	{
	 post_hole(args, 80, "The 'Count.cgi' is present\n\
A buffer overflow may allow remote http users to execute arbitrary\n\
commands on the attacked host");
	}
	return(0);
}
