titantools-4.0.11.orig/0040755000175000017500000000000007757526011013100 5ustar jfsjfstitantools-4.0.11.orig/noshell.c0100644000175000017500000000406307757526011014710 0ustar jfsjfs/* This tool suite was written by and is copyrighted by Brad Powell, Matt */ /* Archibald, and Dan Farmer 1999, 2000, 2001 */ /* The copyright holder disclaims all responsibility or liability with */ /* respect to its usage or its effect upon hardware or computer */ /* systems, and maintains copyright as set out in the "LICENSE" */ /* document which accompanies distribution. */ /* additional fixes from Andrew Wansink */ /* Titan version 4.0.11 April 22 11:21:02 PDT 2001 */ #include #include #include /* this is so that the what(1) command will show the version */ #ifndef lint static char sccsid[] = "@(#)noshell.c bpowell- Titan 4.0.11 4/22/01"; #endif /* not lint */ #ifndef NSIG /* SunOS8 */ #ifdef _sys_siglistn #define NSIG _sys_siglistn #endif /* _sys_siglistn */ /* Linux */ #ifdef _NSIG #define NSIG _NSIG #endif /* _NSIG */ #endif /* NSIG */ #define perrorexit(s) { perror(s); exit(1); } int main (int argc, char **argv) { extern char **environ; int i; /* Useless assignments to clear compiler warning */ i = argc; i = (int) sccsid[0]; /* * Fix the environment. */ if (environ != 0) environ[0] = 0; /* * Fix the signals. */ for (i = 1; i < NSIG; i++) (void) signal (i, SIG_IGN); /* * Log the login attempt. */ openlog (argv[0], LOG_PID, LOG_AUTH); syslog ( LOG_WARNING, "Titan warning: user %s login from a disabled shell", getlogin() ); closelog(); return 0; } titantools-4.0.11.orig/Makefile0100644000175000017500000000066407757071504014545 0ustar jfsjfs# Titan Makefile for Solaris VERSION = 4.0 CC = cc CPPFLAGS = CFLAGS = -Bstatic LDFLAGS = -dn LIBS = -Bstatic /usr/lib/libc.a -Bstatic /usr/ccs/lib/libtermcap.a -Bstatic /usr/lib/libnsl.a LIBS2 = -Bstatic /usr/lib/libc.a # default target all: noshell runas noshell: noshell.o $(CC) $(CFLAGS) -o noshell $(LIBS) $(LDFLAGS) noshell.o runas: stubs.o runas.o $(CC) $(CFLAGS) -o runas $(LIBS2) $(LDFLAGS) stubs.o runas.o titantools-4.0.11.orig/Makefile.linux0100644000175000017500000000067107757071475015710 0ustar jfsjfs# Titan Makefile for Linux VERSION = 4.0 CC = gcc CPPFLAGS = CFLAGS = -static LDFLAGS = -dn LIBS = -static /usr/lib/libc.a -static /usr/i486-linuxaout/lib/libtermcap.a -static /usr/lib/libnsl.a LIBS2 = -static /usr/lib/libc.a # default target all: noshell runas noshell: noshell.o $(CC) $(CFLAGS) -o noshell $(LIBS) $(LDFLAGS) noshell.o runas: stubs.o runas.o $(CC) $(CFLAGS) -o runas $(LIBS2) $(LDFLAGS) stubs.o runas.o titantools-4.0.11.orig/Makefile.fbsd0100644000175000017500000000062207757071511015452 0ustar jfsjfs# Titan Makefile for Free BSD VERSION = 4.0 CC = cc CPPFLAGS = CFLAGS = -static LDFLAGS = -dn LIBS = -static /usr/lib/libc.a -static /usr/lib/libtermcap.a LIBS2 = -static /usr/lib/libc.a # default target all: noshell runas noshell: noshell.o $(CC) $(CFLAGS) -o noshell $(LIBS) $(LDFLAGS) noshell.o runas: stubs.o runas.o $(CC) $(CFLAGS) -o runas $(LIBS2) $(LDFLAGS) stubs.o runas.o titantools-4.0.11.orig/runas-v1.c0100644000175000017500000000630307757071517014725 0ustar jfsjfs/* This tool suite was written by and is copyrighted by Brad Powell, Matt */ /* Archibald, and Dan Farmer 1999, 2000, 2001 */ /* The copyright holder disclaims all responsibility or liability with */ /* respect to its usage or its effect upon hardware or computer */ /* systems, and maintains copyright as set out in the "LICENSE" */ /* document which accompanies distribution. */ /* Titan version 4.0.10 March 25 10:01:02 PDT 2001 */ /* */ /* Special Thanks to Keith Watson for rewriting this and cleaning up my */ /* numerous errors -bpowell */ /* */ #include #include #include #include #include #include #include #include #include #ifndef lint static char sccsid[] = "@(#)runas.c Titan 4.0.10 3/25/01"; #endif /* not lint */ extern int errno; int main(argc, argv, envp) int argc; char **argv; char **envp; { struct passwd *pwEntry; struct group *grEntry; uid_t newUID; gid_t newGID; if (argc < 4) { fprintf(stderr, "Titan Usage: %s username/UID groupname/GID command [opts]\n", argv[0]); return(1); } /* check that we are running as root */ if (geteuid() != 0) { fprintf(stderr, "Titan warning %s: must be run as root.\n", argv[0]); return(1); } /* null out all environment variables */ envp[0] = NULL; /* eliminate all supplementary groups */ if (setgroups(0, NULL) < 0) { fprintf(stderr, "%s: unable to eliminate supplementary groups: %s\n", argv[0], strerror(errno)); return(1); } /* check GID argument; only allow a numeric argument */ if (isdigit((int)argv[2][0])) newGID = atoi(argv[2]); else { if ((grEntry = getgrnam(argv[2])) == NULL) { fprintf(stderr, "%s: Invalid group name: %s\n", argv[0], argv[2]); return(1); } newGID = grEntry->gr_gid; } /* switch GID */ if (setgid(newGID) < 0) { fprintf(stderr, "%s: unable to set group ID: %s\n", argv[0], strerror(errno)); return(1); } /* check UID argument; only allow a numeric argument */ if (isdigit((int)argv[1][0])) newUID = atoi(argv[1]); else { if ((pwEntry = getpwnam(argv[1])) == NULL) { fprintf(stderr, "%s: Invalid user name: %s\n", argv[0], argv[1]); return(1); } newUID = pwEntry->pw_uid; } /* check that we are not setting the UID to root (0) */ if (newUID == 0) { fprintf(stderr, "%s: UID 0 (root) not allowed.\n", argv[0]); return(1); } /* switch UID; this must be done last or eliminating supplementary groups and switching GIDs will not work. */ if (setuid(newUID) < 0) { fprintf(stderr, "%s: unable to set user ID: %s\n", argv[0], strerror(errno)); return(1); } /* execute the command */ execvp(argv[3], argv + 3); /* this point is only reached if execvp() fails */ fprintf(stderr, "%s: unable to execute command: %s\n", argv[0], strerror(errno)); return(1); } titantools-4.0.11.orig/runas-v2.c0100644000175000017500000000704107757071524014724 0ustar jfsjfs/* The copyright holder disclaims all responsibility or liability with */ /* respect to its usage or its effect upon hardware or computer */ /* systems, and maintains copyright as set out in the "LICENSE" */ /* document which accompanies distribution. */ /* Titan version 4.0.10 March 25 01:21:02 PDT 2001 */ /* */ /* runas.c -- A tool to execute processes under a different UID, GID, */ /* and umask. */ /* */ /* */ /* $Id: runas.c,v 1.4 2001/02/25 01:44:01 Exp $ */ #include #include #include #include #include #include #include #include #include #include extern int errno; int main(argc, argv, envp) int argc; char **argv; char **envp; { struct passwd *pwEntry; struct group *grEntry; mode_t uMask; uid_t newUID; gid_t newGID; if (argc < 5) { fprintf(stderr, "Usage: %s username/UID groupname/GID umask command [opts]\n", argv[0]); return(1); } /* check that we are running as root */ if (geteuid() != 0) { fprintf(stderr, "%s: must be run as root.\n", argv[0]); return(1); } /* null out all environment variables */ envp[0] = NULL; /* eliminate all supplementary groups */ if (setgroups(0, NULL) < 0) { fprintf(stderr, "%s: unable to eliminate supplementary groups: %s\n", argv[0], strerror(errno)); return(1); } /* parse GID argument; only allow a numeric argument */ if (isdigit((int)argv[2][0])) newGID = atoi(argv[2]); else { if ((grEntry = getgrnam(argv[2])) == NULL) { fprintf(stderr, "%s: Invalid group name: %s\n", argv[0], argv[2]); return(1); } newGID = grEntry->gr_gid; } /* switch GID */ if (setgid(newGID) < 0) { fprintf(stderr, "%s: unable to set group ID: %s\n", argv[0], strerror(errno)); return(1); } /* parse UID argument; only allow a numeric argument */ if (isdigit((int)argv[1][0])) newUID = atoi(argv[1]); else { if ((pwEntry = getpwnam(argv[1])) == NULL) { fprintf(stderr, "%s: Invalid user name: %s\n", argv[0], argv[1]); return(1); } newUID = pwEntry->pw_uid; } /* check that we are not setting the UID to root (0) */ if (newUID == 0) { fprintf(stderr, "%s: UID 0 (root) not allowed.\n", argv[0]); return(1); } /* switch UID; this must be done last or eliminating supplementary groups and switching GIDs will not work. */ if (setuid(newUID) < 0) { fprintf(stderr, "%s: unable to set user ID: %s\n", argv[0], strerror(errno)); return(1); } /* set umask */ if (isdigit((int)argv[3][0])) { int ccnt; uint readMask; ccnt = sscanf(argv[3], "%o", &readMask); if (ccnt != 1) { fprintf(stderr, "%s: umask %s is not an octal value\n", argv[0], argv[3]); return(1); } uMask = (mode_t)readMask; } else { fprintf(stderr, "%s: umask %s is not an octal value\n", argv[0], argv[3]); return(1); } /* set the umask */ (void) umask(uMask); /* execute the command */ execvp(argv[4], argv + 4); /* this point is only reached if execvp() fails */ fprintf(stderr, "%s: unable to execute command: %s\n", argv[0], strerror(errno)); return(1); } titantools-4.0.11.orig/runas.c0100644000175000017500000001151407757071531014375 0ustar jfsjfs/* The copyright holder disclaims all responsibility or liability with */ /* respect to its usage or its effect upon hardware or computer */ /* systems, and maintains copyright as set out in the "LICENSE" */ /* document which accompanies distribution. */ /* Titan version 4.0.10 March 24 01:21:02 PDT 2001 */ /* */ /* */ /* runas.c -- A tool to execute processes under a different UID, GID, */ /* and umask. */ /* */ /* $Id: runas.c,v 1.5 2001/03/24 12:21:27 Exp $ */ /* */ #include #include #include #include #include #include #include #include #include #include extern int errno; void usage(char *cmdName) { fprintf(stderr, "Usage: %s [-c dir] username/UID groupname/GID umask command [opts]\n", cmdName); fprintf(stderr, " -c dir chroot(2) to directory before execution\n"); } int main(argc, argv, envp) int argc; char **argv; char **envp; { /* option parsing (getopt) variables */ extern char *optarg; extern int optind; short errFlag = 0; int c; char *cmdName = argv[0]; struct passwd *pwEntry; struct group *grEntry; mode_t uMask; uid_t newUID; gid_t newGID; char *chrootDir; short useChroot = 0; /* parse commmand line looking for "chroot" option */ while ((c = getopt(argc, argv, "c:")) != EOF) { switch (c) { case 'c': chrootDir = optarg; useChroot++; break; case '?': errFlag++; } } if (errFlag) { usage(cmdName); return(1); } /* advance pointer if argument was parsed */ if (useChroot) argv += optind - 1; /* check the total number of arguments */ if (argc < (optind - 1) + 5) { usage(cmdName); return(1); } /* check that we are running as root */ if (geteuid() != 0) { fprintf(stderr, "%s: must be run as root.\n", cmdName); return(1); } /* null out all environment variables */ envp[0] = NULL; /* eliminate all supplementary groups */ if (setgroups(0, NULL) < 0) { fprintf(stderr, "%s: unable to eliminate supplementary groups: %s\n", cmdName, strerror(errno)); return(1); } /* parse GID argument; only allow a numeric argument */ if (isdigit((int)argv[2][0])) newGID = atoi(argv[2]); else { if ((grEntry = getgrnam(argv[2])) == NULL) { fprintf(stderr, "%s: Invalid group name: %s\n", cmdName, argv[2]); return(1); } newGID = grEntry->gr_gid; } /* switch GID */ if (setgid(newGID) < 0) { fprintf(stderr, "%s: unable to set group ID: %s\n", cmdName, strerror(errno)); return(1); } /* parse UID argument; only allow a numeric argument */ if (isdigit((int)argv[1][0])) newUID = atoi(argv[1]); else { if ((pwEntry = getpwnam(argv[1])) == NULL) { fprintf(stderr, "%s: Invalid user name: %s\n", cmdName, argv[1]); return(1); } newUID = pwEntry->pw_uid; } /* check that we are not setting the UID to root (0) */ if (newUID == 0) { fprintf(stderr, "%s: UID 0 (root) not allowed.\n", cmdName); return(1); } /* chroot to the new location */ if (useChroot) { if (chroot(chrootDir) < 0) { fprintf(stderr, "%s: unable to chroot to %s: %s\n", cmdName, chrootDir, strerror(errno)); return(1); } } /* switch UID; this must be done last or eliminating supplementary groups and switching GIDs will not work. */ if (setuid(newUID) < 0) { fprintf(stderr, "%s: unable to set user ID: %s\n", cmdName, strerror(errno)); return(1); } /* set umask */ if (isdigit((int)argv[3][0])) { int ccnt; uint readMask; ccnt = sscanf(argv[3], "%o", &readMask); if (ccnt != 1) { fprintf(stderr, "%s: umask '%s' is not an octal value\n", cmdName, argv[3]); return(1); } uMask = (mode_t)readMask; } else { fprintf(stderr, "%s: umask '%s' is not an octal value\n", cmdName, argv[3]); return(1); } /* set the umask */ (void) umask(uMask); /* execute the command */ execvp(argv[4], argv + 4); /* this point is only reached if execvp() fails */ fprintf(stderr, "%s: unable to execute command '%s': %s\n", cmdName, argv[4], strerror(errno)); return(1); } /* * $Log: runas.c,v $ * Revision 1.5 2001/03/24 10:21:27 * Added chroot(2) capabilities. Also, created a function for the usage * message. Added quotes to some error messages to make the string that * caused the error to stand out. * */ titantools-4.0.11.orig/stubs.c0100644000175000017500000000050707757071536014412 0ustar jfsjfs/* Straight from the Solaris FAQ */ #ifndef lint static char sccsid[] = "@(#)stubs.c for runme bpowell- Titan 4.0.10 03/24/01"; #endif /* not lint */ char* dlopen() { return 0;} int dlclose() { return 0;} char* dlsym() { return 0;} char* dgettext() { return "";} char* dlerror() { return "dynamic linking not loaded";} titantools-4.0.11.orig/LICENSE0100600000175000017500000001351407757071661014104 0ustar jfsjfs Titan Security Toolkit® Release 4.1 The authors (Brad, Dan and Matt) would like to take this opportunity to thank the employers who supported this effort as well as some freeware authors who have made direct or indirect and positive contributions to the development of Titan: SUN, Alec Muffett, Casper Dik, Wietse Venema, David Safford, Keith Watson, and many others _________________________________________________________________ Titan is, and has been, publically distributed under copyright and license by Team Titan (Brad, Matt and Dan) since May 1998. This is to state the conditions under which this Package known as Titan, which is copyright Brad M. Powell, Dan Farmer, and Matthew Archibald, may be copied, such that the Copyright Holder maintains some control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Neither Sun Microsystems Inc., EarthLink Networks Inc., or any other institution or companies bear any liability or responsibility whatsoever for the software, including (but not restricted to) responsibility for its existence, structure, content, function or use by any person anywhere. _________________________________________________________________ (Much of this is taken from the 'Artistic License', distributed as part of the Perl v4.0 kit by Larry Wall, which is available from most major archive sites) Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification, or segments thereof. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when AND WHY you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide separate documentation for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4) You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5) You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. YOU MAY NOT CHARGE A FEE FOR THIS PACKAGE ITSELF. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that YOU DO NOT ADVERTISE this package as a product of your own. 6) The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 7) THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. _________________________________________________________________ titantools-4.0.11.orig/noshell.o0100644000175000017500000000241407757072000014714 0ustar jfsjfsELFÄ4( U‰åƒìƒäð¸)Ä‹E‰Eü¾‰Eüƒ=t ¡ÇÇEüƒ}ü@~ëÇD$‹Eü‰$èüÿÿÿEüÿëÞÇD$ ÇD$‹E ‹‰$èüÿÿÿèüÿÿÿ‰D$ÇD$Ç$èüÿÿÿèüÿÿÿ¸ÉÃ@(#)noshell.c bpowell- Titan 4.0.11 4/22/01Noshell warning: user %s login from a disabled shellGCC: (GNU) 3.3.2 (Debian).symtab.strtab.shstrtab.rel.text.data.bss.rodata.note.GNU-stack.comment4£ ÄH %à. +0 5 8UHUpQ|  |Gñÿ .£&.7>noshell.csccsidmainenvironsignalopenloggetloginsyslogcloselog" * R v { ‡“˜