From 52f56612fc8d64005ed9ac99d468c4bf4b2fb0c3 Mon Sep 17 00:00:00 2001 From: dugsong Date: Thu, 10 Jun 1999 16:04:34 +0000 Subject: [PATCH] nfsshell port --- security/nfsshell/Makefile | 27 ++++++++++++ security/nfsshell/files/md5 | 3 ++ security/nfsshell/patches/patch-aa | 23 ++++++++++ security/nfsshell/patches/patch-ab | 70 ++++++++++++++++++++++++++++++ security/nfsshell/patches/patch-ac | 38 ++++++++++++++++ security/nfsshell/pkg/COMMENT | 1 + security/nfsshell/pkg/DESCR | 30 +++++++++++++ security/nfsshell/pkg/PLIST | 1 + 8 files changed, 193 insertions(+) create mode 100644 security/nfsshell/Makefile create mode 100644 security/nfsshell/files/md5 create mode 100644 security/nfsshell/patches/patch-aa create mode 100644 security/nfsshell/patches/patch-ab create mode 100644 security/nfsshell/patches/patch-ac create mode 100644 security/nfsshell/pkg/COMMENT create mode 100644 security/nfsshell/pkg/DESCR create mode 100644 security/nfsshell/pkg/PLIST diff --git a/security/nfsshell/Makefile b/security/nfsshell/Makefile new file mode 100644 index 00000000000..e535d3a6531 --- /dev/null +++ b/security/nfsshell/Makefile @@ -0,0 +1,27 @@ +# Makefile for: nfsshell +# Version required: 1.0 +# Date created: 10 Jun 1999 +# Whom: dugsong@monkey.org +# +# $OpenBSD: Makefile,v 1.1.1.1 1999/06/10 16:04:34 dugsong Exp $ + +PKGNAME= nfsshell-1.0 + +DISTNAME= nfsshell + +CATEGORIES= security + +WRKSRC= ${WRKDIR}/nfs + +MASTER_SITES= ftp://ftp.cs.vu.nl/pub/leendert/ + +MAINTAINER= dugsong@monkey.org + +NO_CONFIGURE= yes + +ALL_TARGET= nfs + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/nfs ${PREFIX}/bin/nfsshell + +.include diff --git a/security/nfsshell/files/md5 b/security/nfsshell/files/md5 new file mode 100644 index 00000000000..72ccc15c2be --- /dev/null +++ b/security/nfsshell/files/md5 @@ -0,0 +1,3 @@ +SHA1 (nfsshell.tar.gz) = 3939bb683bb29cde3b47344251cce57a2eff1a5e +RMD160 (nfsshell.tar.gz) = 1e496343b268d5683cb8fba2bba9722444011ca2 +MD5 (nfsshell.tar.gz) = d447235518691fc3176ce89a6d836ce7 diff --git a/security/nfsshell/patches/patch-aa b/security/nfsshell/patches/patch-aa new file mode 100644 index 00000000000..6bb12a56efd --- /dev/null +++ b/security/nfsshell/patches/patch-aa @@ -0,0 +1,23 @@ +--- Makefile.orig Tue May 19 16:37:23 1998 ++++ Makefile Thu Jun 10 11:57:48 1999 +@@ -21,11 +21,16 @@ + # LIBS=-L/usr/local/lib -lreadline -lhistory -ltermlib + # + +-# uncomment the following 4 lines for Solaris 2.x ++# OpenBSD + CC = gcc +-CFLAGS = -DSYSV -DREADLINE -I/usr/local/include +-LIBS = -lsocket -L/usr/ucblib -R/usr/ucblib -lrpcsoc -lnsl \ +- -L/usr/local/lib -lreadline -lhistory -ltermlib ++CFLAGS += -DREADLINE ++LIBS = -lreadline -ltermcap ++ ++# uncomment the following 4 lines for Solaris 2.x ++#CC = gcc ++#CFLAGS = -DSYSV -DREADLINE -I/usr/local/include ++#LIBS = -lsocket -L/usr/ucblib -R/usr/ucblib -lrpcsoc -lnsl \ ++# -L/usr/local/lib -lreadline -lhistory -ltermlib + + # uncomment the following 3 lines for AIX + #CC = gcc diff --git a/security/nfsshell/patches/patch-ab b/security/nfsshell/patches/patch-ab new file mode 100644 index 00000000000..dc3c47a43a8 --- /dev/null +++ b/security/nfsshell/patches/patch-ab @@ -0,0 +1,70 @@ +--- nfs.c-orig Thu Jun 10 03:42:59 1999 ++++ nfs.c Thu Jun 10 10:42:56 1999 +@@ -40,7 +40,6 @@ + #include + #include + #include +-#include + #include + #ifdef SYSV + #include +@@ -50,7 +49,6 @@ + #include + #include + #include +-#include + #include "mount.h" + #include "nfs_prot.h" + #include +@@ -58,7 +56,6 @@ + + #ifdef READLINE + #include +-#include + #endif + + /* +@@ -169,7 +166,6 @@ + int authtype = AUTH_UNIX; /* type of authentication */ + int uid = -2; /* remote user id (initialy nobody) */ + int gid = -2; /* remote group id (initialy nobody) */ +-keybuf secretkey; /* remote user's secret key */ + + /* server information (also used as state information) */ + char *mountpath; /* remote mount path */ +@@ -384,7 +380,7 @@ + #ifdef READLINE + if (interact) { + char *line; +- if ((line = readline("nfs> ")) == NULL) ++ if ((line = readline("nfsshell> ")) == NULL) + return 0; + strncpy(buf, line, bufsize); + add_history(line); +@@ -394,7 +390,7 @@ + return 0; + } + #else +- if (interact) printf("nfs> "); ++ if (interact) printf("nfsshell> "); + if (fgets(buf, bufsize, stdin) == NULL) + return 0; + #endif +@@ -447,16 +443,13 @@ + do_setuid(int argc, char **argv) + { + if (argc > 3) { +- fprintf(stderr, "Usage: uid [ []]\n"); ++ fprintf(stderr, "Usage: uid []\n"); + return; + } + + if (argc <= 2) { + authtype = AUTH_UNIX; + uid = argc == 1 ? -2 : atoi(argv[1]); +- } else if (argc == 3) { +- authtype = AUTH_DES; +- memcpy(secretkey, argv[2], HEXKEYBYTES); + } + + if (nfsclient) { diff --git a/security/nfsshell/patches/patch-ac b/security/nfsshell/patches/patch-ac new file mode 100644 index 00000000000..9c188cb65fd --- /dev/null +++ b/security/nfsshell/patches/patch-ac @@ -0,0 +1,38 @@ +--- nfs_prot_xdr.c-orig Thu Jun 10 10:53:42 1999 ++++ nfs_prot_xdr.c Thu Jun 10 10:54:01 1999 +@@ -62,7 +62,7 @@ + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_ftype(xdrs, &objp->type)) + return (FALSE); +- buf = XDR_INLINE(xdrs, 10 * BYTES_PER_XDR_UNIT); ++ buf = (long *)XDR_INLINE(xdrs, 10 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_u_int(xdrs, &objp->mode)) + return (FALSE); +@@ -107,7 +107,7 @@ + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_ftype(xdrs, &objp->type)) + return (FALSE); +- buf = XDR_INLINE(xdrs, 10 * BYTES_PER_XDR_UNIT); ++ buf = (long *)XDR_INLINE(xdrs, 10 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_u_int(xdrs, &objp->mode)) + return (FALSE); +@@ -516,7 +516,7 @@ + + + if (xdrs->x_op == XDR_ENCODE) { +- buf = XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT); ++ buf = (long *)XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_u_int(xdrs, &objp->tsize)) + return (FALSE); +@@ -537,7 +537,7 @@ + } + return (TRUE); + } else if (xdrs->x_op == XDR_DECODE) { +- buf = XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT); ++ buf = (long *)XDR_INLINE(xdrs, 5 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_u_int(xdrs, &objp->tsize)) + return (FALSE); diff --git a/security/nfsshell/pkg/COMMENT b/security/nfsshell/pkg/COMMENT new file mode 100644 index 00000000000..de6162a9d0f --- /dev/null +++ b/security/nfsshell/pkg/COMMENT @@ -0,0 +1 @@ +NFS auditing tool diff --git a/security/nfsshell/pkg/DESCR b/security/nfsshell/pkg/DESCR new file mode 100644 index 00000000000..2f6f8b34797 --- /dev/null +++ b/security/nfsshell/pkg/DESCR @@ -0,0 +1,30 @@ +Date: Mon, 18 May 1998 19:43:50 +0200 +From: Leendert van Doorn +Subject: NFS shell +To: BUGTRAQ@NETSPACE.ORG + +I recently got a request for an nfs shell binary for AIX from one of +our security consultants. Since I just moved to IBM Watson's GSAL group +whose job it is to work on security I decided to look at the program +again. I cleaned it up and since there are already so many old escaped +versions of the program floating around I decided to put up my version. + +Nfs shell provides user level access to an NFS server, over UDP or TCP, +supports source routing and "secure" (privileged port) mounts. Its a +useful tool to manually check (or show) security problems after a security +scanner has detected them. + +The sources are in: + + ftp://ftp.cs.vu.nl/pub/leendert/nfsshell.tar.gz + +Suggestions for improvements are welcome. + +Just be responsible, + + Leendert + +-- +Leendert van Doorn +IBM T.J. Watson Research Center (914) 784-7831 +30 Saw Mill River Road, Hawthorne, NY 10532 diff --git a/security/nfsshell/pkg/PLIST b/security/nfsshell/pkg/PLIST new file mode 100644 index 00000000000..6553cf42992 --- /dev/null +++ b/security/nfsshell/pkg/PLIST @@ -0,0 +1 @@ +bin/nfsshell