/*
 * 
 * auth
 *
 * This plugin was written by Renaud Deraison and is released
 * under the GPL
 *
 */
#include <includes.h>
#define NAME "auth enabled"
#define DESC "\
The auth service provides sensitives informations\n\
to the intruders : it can be used to find out\n\
which accounts are running which servers. \n\
This may help attackers to focus on services that\n\
are worth hacking (those owned by root)\n\
If you do not use this service, disable it in\n\
/etc/inetd.conf.\n\
Risk factor: medium"
#define COPYRIGHT "distrubuted under the GPL"
#define SUMM "checks if auth is enabled"




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, "Misc.");
	return(0);
}


PlugExport int plugin_run(struct arglist * env);
PlugExport int plugin_run(struct arglist * env)
{
	int soc;
	char * data;
	if(!host_get_port_state(env, 113))return(0);
	
	soc = open_sock_tcp(env, 113);
	if(soc<0)return(0);
	post_info(env, 113,
"The auth service provides sensitives informations\n\
to the intruders : it can be used to find out\n\
which accounts are running which servers. \n\
This may help attackers to focus on services that\n\
are worth hacking (those owned by root)\n\
If you do not use this service, disable it in\n\
/etc/inetd.conf.\n");
 	shutdown(soc, 2);
        close(soc);
	return(0);
}
