[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <NDBBKKOCALIBPMFFNMEMKEEJFDAA.cseagle@redshift.com>
From: cseagle at redshift.com (Chris Eagle)
Subject: mydoom.c information
Gyrniff wrote:
>
> As I recall the -L option (persistent listener) only works on the windows
> port.
>
If you want it for Unix:
--- nc110/netcat.c 1996-03-20 16:38:04.000000000 -0800
+++ netcat.c 2004-03-07 18:17:55.000000000 -0800
@@ -73,6 +73,7 @@
#include <errno.h>
#include <signal.h>
#include <fcntl.h> /* O_WRONLY et al */
+#include <resolv.h>
/* handy stuff: */
#define SA struct sockaddr /* socket overgeneralization braindeath */
@@ -153,6 +154,7 @@
USHORT o_alla = 0;
unsigned int o_interval = 0;
USHORT o_listen = 0;
+USHORT o_harder = 0;
USHORT o_nflag = 0;
USHORT o_wfile = 0;
USHORT o_random = 0;
@@ -1344,6 +1346,8 @@
signal (SIGPIPE, SIG_IGN); /* important! */
#endif
+recycle:
+
/* if no args given at all, get 'em from stdin, construct an argv, and hand
anything left over to readwrite(). */
if (argc == 1) {
@@ -1389,7 +1393,7 @@
/* If your shitbox doesn't have getopt, step into the nineties already. */
/* optarg, optind = next-argv-component [i.e. flag arg]; optopt = last-char
*/
- while ((x = getopt (argc, argv, "ae:g:G:hi:lno:p:rs:tuvw:z")) != EOF) {
+ while ((x = getopt (argc, argv, "ae:g:G:hi:lLno:p:rs:tuvw:z")) != EOF) {
/* Debug (("in go: x now %c, optarg %x optind %d", x, optarg, optind)) */
switch (x) {
case 'a':
@@ -1429,6 +1433,8 @@
if (! o_interval)
bail ("invalid interval time %s", optarg);
break;
+ case 'L': /* listen harder mode */
+ o_harder++;
case 'l': /* listen mode */
o_listen++; break;
case 'n': /* numeric-only, no DNS
lookups */
@@ -1532,6 +1538,8 @@
x = readwrite (netfd); /* it even works with UDP! */
if (o_verbose > 1) /* normally we don't care */
holler (wrote_txt, wrote_net, wrote_out);
+ if (o_harder)
+ goto recycle;
exit (x); /* "pack out yer trash" */
} else /* if no netfd */
bail ("no connection");
@@ -1619,6 +1627,8 @@
errno = 0;
if (o_verbose > 1) /* normally we don't care */
holler (wrote_txt, wrote_net, wrote_out);
+ if (o_harder)
+ goto recycle;
if (Single)
exit (x); /* give us status on one connection */
exit (0); /* otherwise, we're just done */
Powered by blists - more mailing lists