diff options
author | Nick Kralevich <nnk@google.com> | 2011-10-24 15:44:27 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2011-10-24 16:45:58 -0700 |
commit | e4e83f8147f92141cd02cc46cccca088c527ea2a (patch) | |
tree | c6447c33a54750c3c51d062d023e0c84ee788e9b /data/rservice.c | |
parent | 3b92542cff3f53ab608c25e1f65c538e42dece1b (diff) | |
download | netcat-jb-release.tar.gz |
Upgrade to openbsd's netcat.android-cts-4.2_r1android-4.2_r1android-4.2.2_r1.2android-4.2.2_r1.1android-4.2.2_r1android-4.2.1_r1.2android-4.2.1_r1.1android-4.2.1_r1android-4.1.2_r2.1android-4.1.2_r2android-4.1.2_r1android-4.1.1_r6.1android-4.1.1_r6android-4.1.1_r5android-4.1.1_r4android-4.1.1_r3android-4.1.1_r2android-4.1.1_r1.1android-4.1.1_r1jb-releasejb-mr1.1-releasejb-mr1-releasejb-mr0-release
Upgrade to openbsd's version of netcat, available for download
from http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
This version has been modified to remove BSD specific calls
and other functionality unnecessary for Android. The removed
portions of code are surrounded by #ifdef ANDROID / #endif.
This code corresponds to the following openbsd versions:
atomicio.c: v1.10
atomicio.h: v1.2
netcat.c: v1.103
The file socks.c and nc.1 are not included in this change.
Change-Id: I39df7fbe335af97e092dd4d4a96f957d6d1a5b5d
Diffstat (limited to 'data/rservice.c')
-rw-r--r-- | data/rservice.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/data/rservice.c b/data/rservice.c deleted file mode 100644 index 1085d9c..0000000 --- a/data/rservice.c +++ /dev/null @@ -1,68 +0,0 @@ -/* generate ^@string1^@string2^@cmd^@ input to netcat, for scripting up - rsh/rexec attacks. Needs to be a prog because shells strip out nulls. - - args: - locuser remuser [cmd] - remuser passwd [cmd] - - cmd defaults to "pwd". - - ... whatever. _H*/ - -#include <stdio.h> - -/* change if you like; "id" is a good one for figuring out if you won too */ -static char cmd[] = "pwd"; - -static char buf [256]; - -main(argc, argv) - int argc; - char * argv[]; -{ - register int x; - register int y; - char * p; - char * q; - - p = buf; - memset (buf, 0, 256); - - p++; /* first null */ - y = 1; - - if (! argv[1]) - goto wrong; - x = strlen (argv[1]); - memcpy (p, argv[1], x); /* first arg plus another null */ - x++; - p += x; - y += x; - - if (! argv[2]) - goto wrong; - x = strlen (argv[2]); - memcpy (p, argv[2], x); /* second arg plus null */ - x++; - p += x; - y += x; - - q = cmd; - if (argv[3]) - q = argv[3]; - x = strlen (q); /* not checked -- bfd */ - memcpy (p, q, x); /* the command, plus final null */ - x++; - p += x; - y += x; - - memcpy (p, "\n", 1); /* and a newline, so it goes */ - y++; - - write (1, buf, y); /* zot! */ - exit (0); - -wrong: - fprintf (stderr, "wrong! needs 2 or more args.\n"); - exit (1); -} |