/*
 * 
 * jj
 *
 * This plugin was written by Renaud Deraison and is released
 * under the GPL
 *
 */
#include <includes.h>
#define NAME "cgi jj"
#define DESC "\
The 'jj' cgi allow a remote user to execute any\n\
command on the target system with the same privileges\n\
as the web server\n\n\
Risk factor : High"
#define COPYRIGHT "no copyright"
#define SUMM "determines the presence of the 'jj' 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_ATTACK);
	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, "jj"))
	post_hole(args, 80, "\
The remote web server has the 'jj' cgi\n\
installed. This cgi is a sample which is\n\
full of security leaks and which allows\n\
an intruder to execute any commands with\n\
the same rights as the HTTP daemon.\n\
Solution: remove it from the cgi-bin directory\n\
of your HTTP server");
	return(0);
}

