home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / phrack2 / phrack45.t15 < prev    next >
Encoding:
Text File  |  2003-06-11  |  33.5 KB  |  823 lines

  1.                               ==Phrack Magazine==
  2.  
  3.                  Volume Five, Issue Forty-Five, File 15 of 28
  4.  
  5. ****************************************************************************
  6.  
  7.                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  8.                         Some Helpful VAX/VMS utilities
  9.  
  10.                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  11.  
  12. Introduction :
  13. ^^^^^^^^^^^^
  14. This article contains a brief introduction to some not so often used
  15. utilities, found on the Virtual Address eXtentions/ Virtual Memory System or
  16. better known to us as the VAX/VMS.
  17.  
  18. Please note that this file is meant for the so called VMS "newbies". It gives
  19. an insight to the processes that are running in the different "Hibernation"
  20. states on VMS, quite similar to the background processes running on UNIX and
  21. its clones. If you have "extensive" experience on VMS as a systems programmer
  22. or a SysOp, you might want to skip it !!
  23.  
  24. Portions of this file are taken from the ever blabbering VMS HELP, which is
  25. where many of us, myself included, learn about the VAX/VMS. VMS has lots of
  26. secrets. Locations of "hidden" files are a very well kept secret, known
  27. not even to the SysOp but only to the system programmer.
  28.  
  29. Ok.... Lets get started...
  30.  
  31.  
  32. SHOW SYSTEM   :
  33. ^^^^^^^^^^^
  34. This command ($Show system) will display information about the
  35. status of the processes running on the system.
  36. There are various options to this command, some of which are listed below.
  37.  
  38.  
  39.     /BATCH     /CLUSTER   /FULL      /NETWORK   /NODE      /OUTPUT
  40.     /PROCESS   /SUBPROCESS
  41.  
  42.  
  43.  
  44.  
  45.          1.  $ SHOW SYSTEM
  46.  
  47.        VAX/VMS 5.4  on node DARTH 19-APR-1990 17:45:47.78  Uptime  2 21:53:59
  48.          Pid    Process Name   State Pri      I/O       CPU  Page flts Ph.Mem
  49.        27400201 SWAPPER        HIB   16        0  0 00:29:52.05      0      0
  50.        27401E03 DOCBUILD       LEF    4    37530  0 00:05:47.62  96421    601
  51.        27402604 BATCH_789      LEF    4     3106  0 00:00:48.67   4909   2636 B
  52.        27401C05 BATCH_60       LEF    6      248  0 00:00:06.83   1439   1556 B
  53.        27400207 ERRFMT         HIB    8     6332  0 00:00:41.83     89    229
  54.        27400208 CACHE_SERVER   HIB   16     2235  0 00:00:05.85     67    202
  55.        27400209 CLUSTER_SERVER HIB    8     4625  0 00:22:13.28    157    448
  56.        2740020C JOB_CONTROL    HIB   10   270920  0 01:07:47.88   5163   1384
  57.        2740020D CONFIGURE      HIB    9      125  0 00:00:00.53    104    264
  58.         .
  59.         .
  60.         .
  61.        27400E8D Sir Lancelot   LEF    5      226  0 00:00:07.87   4560    697
  62.        2740049A Guenevere      LEF    4      160  0 00:00:02.69    534    477
  63.        27401EA0 BATCH_523      CUR  4 4    17470  0 03:25:49.67   8128   5616 B
  64.        274026AF GAWAIN         CUR  6 4    14045  0 00:02:03.24  20032    397
  65.        274016D5 GAHERIS        LEF    6      427  0 00:00:09.28   5275   1384
  66.        27401ED6 knight_1       HIB    5      935  0 00:00:10.17   3029   2204 S
  67.        274012D7 BATCH_689      LEF    4    49216  0 00:14:18.36   7021   3470 B
  68.        274032D9 DECW$MAIL      LEF    4     2626  0 00:00:51.19   4328   3087 B
  69.        274018E3 SERVER_0021    LEF    6      519  0 00:00:07.07   1500    389 N
  70.        274016E8 NMAIL_0008     HIB    4    10955  0 00:00:55.73   5652    151
  71.        274034EA MORDRED        LEF    4     2132  0 00:00:23.85   5318    452
  72.        274022EB S. Whiplash    CUR  6 4      492  0 00:00:12.15   5181    459
  73.        274018EF DwMail         LEF    5   121386  0 00:28:00.97   7233   4094
  74.        27401AF0 EMACS$RTA43    LEF    4    14727  0 00:03:56.54   8411   4224 S
  75.        27400CF4 TRISTRAM       HIB    5    25104  0 00:06:07.76  37407   1923
  76.        274020F5 Morgan         LEF    7    14726  0 00:02:10.74  34262   1669
  77.        27400CF6 mr. mike       LEF    9    40637  0 00:05:15.63  18454    463
  78.  
  79.            The information in this example includes the following:
  80.  
  81.             o Process identification (PID) code-A 32-bit binary value that
  82.               uniquely identifies a process.
  83.  
  84.             o Process name-A 1- to 15-character string used to identify a
  85.               process.
  86.  
  87.             o Process state-The activity level of the process, such as COM
  88.               (computing), HIB (hibernation), LEF (local event flag) wait,
  89.               or CUR (if the process is current). If a multiprocessing
  90.               environment exists, the display shows the CPU ID of the
  91.               processor on which any current process is executing.
  92.  
  93.               Note that the SHOW SYSTEM command examines the processes on
  94.               the system without stopping activity on the system. In this
  95.               example process information changed during the time that the
  96.               SHOW SYSTEM command collected the data to be displayed. As
  97.               a result, this display includes two processes, named GAWAIN
  98.               and S. Whiplash, with the state CUR on the same CPU, CPU ID
  99.               6 in the example.
  100.  
  101.             o Current priority-The priority level assigned to the process
  102.               (the higher the number, the higher the priority).
  103.  
  104.             o Total process I/O count-The number of I/O operations
  105.               involved in executing the process. This consists of both
  106.               the direct I/O count and the buffered I/O count.
  107.  
  108.             o Charged CPU time-The amount of CPU time that a process has
  109.               used thus far.
  110.  
  111.             o Number of page faults-The number of exceptions generated by
  112.               references to pages that are not in the process's working
  113.               set.
  114.  
  115.             o Physical memory occupied-The amount of space in physical
  116.               memory that the process is currently occupying.
  117.  
  118.             o Process indicator-Letter B indicates a batch job; letter
  119.               S indicates a subprocess; letter N indicates a network
  120.               process.
  121.  
  122.             o User identification code (UIC)-An 8-digit octal number
  123.               assigned to a process. This number is displayed only if the
  124.               /FULL qualifier is specified.
  125.  
  126.  
  127.  
  128.          2.  $ SHOW SYSTEM /CLUSTER
  129.  
  130.  
  131.        VAX/VMS V5.4 on node APPLE 19-APR-1990 09:09:58.61  Uptime    0 2:27:11
  132.        Pid       Process Name   State  Pri I/O  CPU           Page flts Ph. Mem
  133.        31E00041  SWAPPER        HIB    16    0  0 00:00:02.42     0       0
  134.        31E00047  CACHE_SERVER   HIB    16   58  0 00:00:00.26    80      36
  135.        31E00048  CLUSTER_SERVER CUR     9  156  0 00:00:58.15  1168      90
  136.        31E00049  OPCOM          HIB     7 8007  0 00:00:33.46  5506     305
  137.        31E0004A  AUDIT_SERVER   HIB     9  651  0 00:00:21.17  2267      22
  138.        31E0004B  JOB_CONTROL    HIB    10 1030  0 00:00:11.02   795     202
  139.  
  140.           .
  141.           .
  142.  
  143.            The SHOW SYSTEM command in this example shows all processes on
  144.            all nodes of the cluster.
  145.  
  146.  
  147.          3.  $ SHOW SYSTEM /NODE=NEON
  148.        VAX/VMS V5.4 on node NEON 19-APR-1990 09:19:15.33  Uptime    0 02:29:07
  149.        Pid       Process Name   State  Pri  I/O  CPU           Page flts Ph. Mem
  150.        36200041  SWAPPER        HIB    16     0  0 00:00:12.03     0       0
  151.        36200046  ERRFMT         HIB     8   263  0 00:00:05.89   152      87
  152.        36200047  CACHE_SERVER   CUR    16     9  0 00:00:00.26    80      51
  153.        36200048  CLUSTER_SERVER CUR     8    94  0 00:00:30.07   340      68
  154.        36200049  OPCOM          HIB     6  2188  0 00:02:01.04  1999     177
  155.        3620004A  AUDIT_SERVER   HIB    10   346  0 00:00:10.42  1707      72
  156.           .
  157.           .
  158.           .
  159.  
  160.  
  161.            The SHOW SYSTEM command in this example shows all processes on
  162.            the node NEON.
  163.  
  164.  
  165.                                ----- X -----
  166.  
  167.    So now that we beat the SHOW SYSTEM command to death, lets take on another
  168.    command. Hmmm..let's see..Ahhhaaaa the MONITOR SYSTEM !!!!!
  169.  
  170.    This is a pretty neat command and one of my favorite "play" commands. Don't
  171.    get me wrong, there's a lot to be learned from "play" commands like these.
  172.    It really gives us some useful information. The reason why I like this
  173.    utility is because it gives a GRAPHICAL representation of the
  174.    data given by the SHOW SYSTEM. I would have included a short example
  175.    of the graphics, but not everyone receiving this article would be running
  176.    VMS on a terminal with ANSI emulation. So, if you want to see the ANSI
  177.    graphics, follow my instructions...
  178.  
  179.  
  180. MONITOR
  181.  
  182.    Invokes  the  VMS  Monitor  Utility  (MONITOR)  to  monitor  classes  of
  183.    system-wide  performance  data   at  a  specified  interval.  It produces
  184.    three types of optional output:
  185.  
  186.       o  Recording file
  187.       o  Statistical terminal display
  188.       o  Statistical summary file
  189.  
  190.    You  can collect data from a running system or from a previously created
  191.    recording file.
  192.  
  193.    You can execute a single  MONITOR request,  or enter MONITOR interactive
  194.    mode to execute a series of requests.  Interactive mode is entered  when
  195.    the MONITOR command is issued with no parameters or qualifiers.
  196.  
  197.    A MONITOR request can be terminated by pressing CTRL/C or CTRL/Z. CTRL/C
  198.    causes MONITOR to enter interactive mode; CTRL/Z returns to DCL.
  199.  
  200.  
  201.    The  MONITOR  Utility  is described in detail in the VMS Monitor Utility
  202.    Manual.
  203.  
  204.    Format:
  205.           MONITOR  class-name[,...]
  206.  
  207.    There are quite a few different options available for the MONITOR utility.
  208.    We are not going to get into too much detail about each option, but I will
  209.    take the time to discuss a few. The different options for MONITOR are....
  210.  
  211.   ALL_CLASSES           CLUSTER    DECNET     DISK       DLOCK      FCP
  212.   FILE_SYSTEM_CACHE     IO         LOCK       MODES      MSCP_SERVER
  213.   PAGE       POOL       PROCESSES  RMS        SCS        STATES     SYSTEM
  214.   TRANSACTION           VECTOR
  215.   /BEGINNING /BY_NODE   /COMMENT   /DISPLAY   /ENDING    /FLUSH_INTERVAL
  216.   /INPUT     /INTERVAL  /NODE      /RECORD    /SUMMARY   /VIEWING_TIME
  217.   /ALL       /AVERAGE   /CPU       /CURRENT   /FILE      /ITEM      /MAXIMUM
  218.  
  219.  
  220.      MONITOR Parameter class-name[,...]
  221.  
  222.       Specifies one or more classes of performance data to be monitored.
  223.       The available class-names are:
  224.  
  225.           ALL_CLASSES       All MONITOR classes.
  226.           CLUSTER           Cluster wide information.
  227.           DECNET            DECnet-VAX statistics.
  228.           DISK              Disk I/O statistics.
  229.           DLOCK             Distributed lock management statistics
  230.           FCP               File system primitive statistics.
  231.           FILE_SYSTEM_CACHE File system caching statistics.
  232.           IO                System I/O statistics.
  233.           LOCK              Lock management statistics.
  234.           MODES             Time spent in each of the processor modes.
  235.           MSCP_SERVER       MSCP Server statistics
  236.           PAGE              Page management statistics.
  237.           POOL              Space allocation in the nonpaged dynamic pool.
  238.           PROCESSES         Statistics on all processes.
  239.           RMS               VMS Record Management Services statistics
  240.           SCS               System communication services statistics.
  241.           STATES            Number of processes in each scheduler state.
  242.           SYSTEM            System statistics.
  243.           TRANSACTION       DECdtm services statistics.
  244.           VECTOR            Vector Processor scheduled usage.
  245.  
  246.  
  247. MONITOR
  248.  
  249.   /ALL
  250.  
  251.    Specifies that a table of current, average, minimum, and  maximum
  252.    statistics is to be included in display and summary output.
  253.  
  254.    /ALL is the  default for all class-names except MODES, STATES and
  255.    SYSTEM. It may not be used with the PROCESSES class-name.
  256.  
  257.  
  258.                          ---- X ----
  259.  
  260.      Well, I hope this little file helps a few people out, by providing them
  261.  with a better understanding of the background processes running on the system
  262.  and by providing a better perception of the amount of CPU and I/O time taken
  263.  by each process.
  264.  
  265.  
  266.  
  267.  
  268. DARTH VADER
  269.  
  270.  
  271. P.S : Look for a file on ACL (Access Control Listing) in the near future.
  272.  
  273. ------------------------------------------------------------------------------
  274.  
  275.                         ----------------------------
  276.                         VAX/VMS AUTHORIZATION SYSTEM
  277.                         ----------------------------
  278.  
  279. Introduction:
  280. ------------
  281.  
  282. Well, since Phrack issues containing VMS articles are pretty rare I will
  283. examine in deep the authorization sub-system on VAXes.
  284.  
  285. Keep in mind that I will take under consideration that you are probably
  286. under some new VMS version (5.5-X). If you are on some older VMS, don't
  287. worry, commands are the same, just some flags and display was added on
  288. later versions.  The knowledge of the authorization sub-system is of great
  289. importance for a VAX hacker since he must keep himself an access to the
  290. system, and this is the right way to do it.
  291.  
  292. Also keep in mind that this is just a practical guide oriented to a hacker's
  293. needs and was done to be understandable by and useable by everybody,
  294. even those who are not so familiar with VMS. That's why I included some
  295. references to VMS filesystem, privileges, etc.
  296.  
  297. AUTHORIZE:
  298. ---------
  299.  
  300. The authorization subsystem is the one that will let you create accounts
  301. under the VMS operating system. The command you need to execute is the:
  302.  
  303.                         SYS$SYSTEM:AUTHORIZE.EXE
  304.  
  305. What do you need to execute that program ?
  306.  
  307.                         READ/WRITE PRIVS over SYSUAF.DAT
  308.                         EXECUTE PRIVS    over SYS$SYSTEM:AUTHORIZE.EXE
  309.  
  310. How can you check if you got all needed to start creating accounts ?
  311.  
  312. DIR SYS$SYSTEM:AUTHORIZE.EXE/FULL
  313.  
  314. Directory SYS$SYSROOT:[SYSEXE] <----- Directory you are listing
  315.  
  316. AUTHORIZE.EXE;1               File ID:  (2491,5,0)
  317. Size:          164/165        Owner:    [SYSTEM] <---- Owner is Sys Manager
  318. Created:  20-JUL-1990 08:30:34.18  <------- Creation Date of program
  319. Revised:  17-AUG-1992 09:45:36.31 (4) <------ Last modification over program
  320. Expires:   <None specified>    <---- No expiration, will last for ever
  321. Backup:    <No backup recorded>
  322. File organization:  Sequential
  323. File attributes:    Allocation: 165, Extend: 0, Global buffer count: 0
  324.                     No version limit, Contiguous best try
  325. Record format:      Fixed length 512 byte records <--- record organization
  326. Record attributes:  None
  327. RMS attributes:     None
  328. Journaling enabled: None
  329. File protection:    System:RWED, Owner:RWED, Group:R, World: <---- (*)
  330. Access Cntrl List:  None
  331. Total of 1 file, 164/165 blocks.
  332.  
  333. (*) This is the field that will tell if you are authorized to execute the
  334.     program. In this case if you own a privileged account you
  335.     can run it. That doesn't mean that you will be able to view/modify
  336.     any account found on the SYSUAF.DAT. But 95 % of the time any user
  337.     can execute the AUTHORIZE program even if you don't have READ privilege
  338.     on the SYS$SYSTEM directory. That means that if you do a :
  339.  
  340.     DIR SYS$SYSTEM
  341.  
  342.     and you find that you don't have the privilege to view the files contained
  343.     in that directory you may still be able to execute the AUTHORIZATION
  344.     subsystem, of course, you have a real low chance of getting the SYSUAF.DAT
  345.     read or modified.
  346.  
  347. If you find that the authorize program cannot be executed a good method is
  348. to send it UUENCODED from another VAX where you *DO* have at least read access
  349. to SYS$SYSTEM:AUTHORIZE.EXE . If you are working on the X-25's you can send
  350. it via PSI mailing. If you are on the Internet, just send it using the
  351. normal mail routing method to the user on the VAX you want the AUTHORIZE.EXE
  352. to get executed by.  Once you get it just UUDECODE it and place it in your
  353. SYS$LOGIN directory and execute it!.
  354.  
  355. The authorize will work as a module, and won't try to overlay any other module
  356. to make it work correctly.  If you can run the authorize you should receive :
  357.  
  358. "UAF>" prompt.
  359.  
  360. THE SYSUAF.DAT:
  361. --------------
  362.  
  363. The SYSUAF.DAT is the most important file of the authorization subsystem.
  364. All the accounts are stored here with their :
  365.  
  366.         - PASSWORDS     (encrypted)
  367.         - ENVIRONMENT
  368.         - DIR
  369.         - privileges
  370.         - RIGHTS OVER THE FILES
  371.         ... and more
  372.  
  373. The SYSUAF.DAT is somehow like the /etc/passwd file on Unix OS.
  374. Under UNIX you can take the password file and with an editor add yourself
  375. an account or modify an existing one without problem. Well this is not
  376. possible under VMS. You need a program that knows SYSUAF.DAT record structure
  377. (like AUTHORIZE) to take action over accounting system.
  378.  
  379. The main difference is that the SYSUAF.DAT is not a PLAIN TEXT FILE, its
  380. a binary file structured to be read only by the AUTHORIZE program.
  381. Another main difference is that is not world readable, can usually be only
  382. read from high privileged accounts or from accounts which can override
  383. system protection flags (will talk about this later).
  384.  
  385. The SYSUAF.DAT can be found in the same directory as the AUTHORIZE.EXE
  386. program, the SYS$SYSTEM. You will usually find a few versions of this file
  387. but normally with the same protections as the working one.
  388. What can be interesting is that you can usually find files produced by the
  389. output of the LIST command (under AUTHORIZE) which can be WORLD readable where
  390. you will have all the accounts listed with the OWNER/DIR/PRIVS..etc. That will
  391. help you a lot to try to hack some accounts if you still can't run authorize.
  392. Those files are called normally: SYSUAF.LIS, and you might find more than
  393. just one of them. Of course try to get the latest one since the older
  394. ones will contain some expired/deleted accounts.
  395.  
  396. To check what privilege you have over the SYSUAF.DAT issue :
  397.  
  398. DIR SYS$SYSTEM:SYSUAF.DAT/FULL
  399.  
  400. Directory SYS$COMMON:[SYSEXE]
  401. SYSUAF.DAT;1                  File ID:  (228,1,0)
  402. Size:          183/183        Owner:    [SYSTEM]
  403. Created:  20-JUL-1990 08:30:21.50
  404. Revised:  14-JAN-1994 03:33:27.75 (34812) <--- Last Creation/Modification
  405. Expires:   <None specified>
  406. Backup:    <No backup recorded>
  407. File organization:  Indexed, Prolog: 3, Using 4 keys
  408.                              In 3 areas
  409. File attributes:    Allocation: 183, Extend: 3, Maximum bucket size: 3
  410.                     Global buffer count: 0, No version limit
  411.                     Contiguous best try
  412. Record format:      Variable length, maximum 1412 bytes
  413. Record attributes:  None
  414. RMS attributes:     None
  415. Journaling enabled: None
  416. File protection:    System:RWED, Owner:RWED, Group:R, World: (*)
  417. Access Cntrl List:  None
  418.  
  419. Total of 1 file, 183/183 blocks.
  420.  
  421. In this case, if you are under a standard user account you won't be
  422. able to READ or/and WRITE the SYSUAF.DAT.  So when you will execute the
  423. AUTHORIZE program, it will quit and kick you back to shell.
  424. IF you have World : R, you will be able to  LIST/SHOW     accounts.
  425. IF you have World : RW, you will be able to CREATE/MODIFY accounts.
  426.  
  427. But if you happen to have SYSPRIV you will be able CREATE/MODIFY the
  428. SYSUAF.DAT at your pleasure!  Since you can override the system protection
  429. that has been imposed over that file.  Of course, if you have SETPRV
  430. privilege you have ALL privilege, and you can do whatever you want
  431. with the VAX.
  432.  
  433. Privileges needed to CREATE/MODIFY accounts :
  434.  
  435. Process privileges:
  436. *SETPRV               may set any privilege bit
  437. Explanation: With this only you can assign yourself all the privileges you
  438. need with a SET PROC/PRIVS=ALL.
  439.  
  440. *SYSPRV               may access objects via system protection
  441. Explanation: If you have this one you will be able to read the SYSUAF.DAT.
  442.  
  443. *BYPASS               may bypass all object access controls
  444. Explanation: If you have this one you can read the SYSUAF.DAT since
  445. all the objects (ie:files) will be made accessible to you. I suggest that
  446. if you happen to have some problems, change the files access flags to
  447. let it be WORLD (you) readable/writable. So use :
  448.  
  449.                  SET FILE/PROT=(w:rwed) SYS$SYSTEM:SYSUAF.DAT
  450.  
  451. *READALL              may read anything as the owner
  452. Explanation:  Well this is obvious, SYSUAF.DAT will be read without problems
  453. but of course you won't be able to CREATE/MODIFY accounts to your pleasure.
  454. At least you can LIST/SHOW all the accounts as deep as you want.
  455.  
  456. Entering AUTHORIZE:
  457. ------------------
  458. Once you've executed AUTHORIZE you will receive its main prompt:
  459.  
  460. RUN SYS$SYSTEM:AUTHORIZE
  461.  
  462. UAF>
  463.  
  464. UAF stands for User Authorization File.
  465.  
  466. First of all you will first need to get a list of all the accounts on the
  467. system with some of their settings also. To do this issue the command:
  468.  
  469. UAF>SHOW USERS/BRIEF
  470.  
  471.        Owner         Username           UIC       Account  Privs Pri Directory
  472.  
  473. ALLIN1V24CREATED     A1$XFER_IN      [660,1]               Normal  4 Disuser
  474. ALLIN1V24CREATED     A1$XFER_OUT     [660,2]               Normal  4 Disuser
  475. JOHN_FAVORITE        JFAVORITE       [300,2]      LEDGER   Devour  4 DEV$DUA2
  476. :[ABDURAHMAN]
  477.  
  478. IBRAHIM ALBHIR       ALBHIR           [60,111]    GOTVOT   Normal  4 DUA2:[ALB
  479. HIR]
  480.  
  481. ALGHAMDI             ALGHAMDI        [300,1]      LEDGER   Normal  4 DUA2:[ALG
  482. HAMDI]
  483.  
  484. ALHAJAJ              ALHAJAJ         [325,3]      BUDGET   Devour  4 GOTDEV$DU
  485. A2
  486.  
  487. Explanation:
  488.  
  489. 1) Owner: Owner of the account
  490.  
  491. 2) Username: This is the guy's login name
  492.  
  493. 3) UIC: User Identification Code. This serves to the OS to recognize you and
  494.         rights you have over files, directory, etc.
  495.  
  496. 4) Account: This is to let the operator know what the group is
  497.             that owns/manages the account.
  498.  
  499. 5) Pri: don't worry about it.
  500.  
  501. 6) Directory: This is the account HOME directory. Where the owner of the
  502.               account will work on.
  503.  
  504. After you have captured the output of the SHOW command you can start
  505. trying to create yourself some accounts by modifying some already existing
  506. ones (which I suggest strongly).
  507.  
  508. To create an account issue the following command :
  509.  
  510. CREATE JOHN/DIR=JOHNS_DIR/DEVICE=SYS$USER/PASSWORD=JOHNS_PASSWORD
  511. /ACCESS=(DIALUP,NETWORK)/PRIVS=(NETMBX,TMPMBX)/DEFPRIVS=(NETMBX,TMPMBX)
  512. /ACCOUNT=USERS/OWNER=JOHN
  513.  
  514. Effects of this command:
  515.  
  516. Will create a user called JOHN which will log under the JOHNS_DIR directory,
  517. who will have just normal user privileges (TMPMBX/NETMBX) who, when listed,
  518. will appear to be as part of the group name USERS and the account's owner
  519. will be JOHN.
  520.  
  521. After you issue this command a NEW UIC will be added to the RIGHTSLIST.DAT
  522. file being assigned to your user.
  523.  
  524. Explanation:
  525.  
  526. DIR: can be any directory name you saw on the system. Of course if you are
  527. not using all the privileges, check that its READ/WRITE-able
  528. so you won't have problems at login.
  529.  
  530. DEVICE: is where the DIR can be found. That means that you have to tell in
  531. which physical/logical device that directory will be found. Since VAXes will
  532. have at least 1 or 2 magnetic supports you must say on which one the directory
  533. can be found. Normally they already have some logical names assigned like
  534. SYS$USER,SYS$SYSTEM,SYS$SPECIFIC,SYS$MANAGER, etc.
  535.  
  536. PASSWORD: is the password you want for the account which will never be shown
  537. to anyone, so use whatever one you like.
  538.  
  539. ACCESS: tells the system from where you will authorize logins for this
  540. account. For example I'm sure you've seen this message:
  541.  
  542. Username: BACKUP
  543. Password:
  544. Cannot login from this source.
  545.  
  546. Well this is the result of an account being setup with the DIALUP flags in
  547. the access field as NODIALUP.
  548.  
  549. So if u want to give the account all kind of access just use :
  550. ACCESS=ALL
  551.  
  552. and this will authorize all login sources for the account.
  553.  
  554. PRIVS: will setup the privileges on the named account. If you just want it
  555. to be a normal user account use TMPMBX,NETMBX.  If you want it to be
  556. a super-user account you can use ALL. But this is not the right way
  557. if you don't want your account to get discovered fast.
  558.  
  559. Valid Process privileges:
  560.  
  561.  CMKRNL               may change mode to kernel
  562.  CMEXEC               may change mode to exec
  563.  SYSNAM               may insert in system logical name table
  564.  GRPNAM               may insert in group logical name table
  565.  ALLSPOOL             may allocate spooled device
  566.  DETACH               may create detached processes
  567.  DIAGNOSE             may diagnose devices
  568.  LOG_IO               may do logical i/o
  569.  GROUP                may affect other processes in same group
  570.  ACNT                 may suppress accounting messages
  571.  PRMCEB               may create permanent common event clusters
  572.  PRMMBX               may create permanent mailbox
  573.  PSWAPM               may change process swap mode
  574.  ALTPRI               may set any priority value
  575.  SETPRV               may set any privilege bit
  576.  TMPMBX               may create temporary mailbox
  577.  WORLD                may affect other processes in the world
  578.  MOUNT                may execute mount acp function
  579.  OPER                 may perform operator functions
  580.  EXQUOTA              may exceed disk quota
  581.  NETMBX               may create network device
  582.  VOLPRO               may override volume protection
  583.  PHY_IO               may do physical i/o
  584.  BUGCHK               may make bug check log entries
  585.  PRMGBL               may create permanent global sections
  586.  SYSGBL               may create system wide global sections
  587.  PFNMAP               may map to specific physical pages
  588.  SHMEM                may create/delete objects in shared memory
  589.  SYSPRV               may access objects via system protection
  590.  BYPASS               may bypass all object access controls
  591.  SYSLCK               may lock system wide resources
  592.  SHARE                may assign channels to non-shared devices
  593.  GRPPRV               may access group objects via system protection
  594.  READALL              may read anything as the owner
  595.  SECURITY             may perform security functions
  596.  
  597. Check the last section on tips on creating accounts.
  598.  
  599. ACCOUNT: this is pretty useless and is just for displaying purposes at the
  600. SHOW USER under authorize.
  601.  
  602. OWNER: This field is also used just at SHOW time but keep in mind to use
  603. an owner that won't catch the eye of the system manager.
  604.  
  605. You can use the MODIFY command the ame as you used the CREATE. The only
  606. difference is that no account will be created but ALL types of modifications
  607. will affect the specified account.
  608.  
  609. You can use the LIST command to produce an output of the accounts to a file.
  610. Use this command as you use the SHOW one.
  611.  
  612. Of course, the authorize sub-system is so huge you can actually set hours of
  613. login for users, expirations, disk quotas, etc., but this is not the purpose
  614. of this article.
  615.  
  616. Tips to create accounts:
  617. -----------------------
  618. First of all, what I suggest strongly is to MODIFY accounts not to CREATE
  619. new ones. Why this?  Well, new account names can jump out at the operator
  620. and he will kick you off the system very soon.
  621.  
  622. The best way I think is to get a non-used account, change its privileges
  623. and change the password and use it!.
  624.  
  625. First of all try to find a never-logged account or at least one account
  626. whose last log comes from few months ago. From the UAF prompt just
  627. do a SH USER/FULL and check out the dates that appear in the *Last Login*
  628. record. If this happens to be a very old one then it can be marked as
  629. valid to take control of. Of course you have to find a non used account
  630. since you will have to change the account's password.
  631.  
  632. Check the flags field also. This flags can really bother you:
  633.  
  634.                             Captive     (worst one!)
  635.                             Ctly        (ctrl-y deactivated)
  636.                             Restricted  (OS does more checks than normal)
  637.                             DisUser     (ACCOUNT IS NOT ENABLED!!!)
  638.  
  639. I suggest you take out all the flag's fields.
  640. just issue: MODIFY JOHN/FLAGS=(NOCAPTIVE,NOCTLY,NORESTRICED,NODISUSER)
  641. If you find an account that is DisUser I suggest not to own it since the
  642. DisUser flags will take on when listing the accounts. If system manager
  643. sees an account that was OFF now ON..well it's a bit suspicious don't
  644. you think ?
  645.  
  646. Check if the FIELD account is being used. If not own this one since it
  647. already has ALL privileges and will not look suspicious at all. Just change
  648. its password.  (FIELD is the account normally used by Digital Engineers
  649. to check the VAX).
  650.  
  651. Remember to check also that DIALUP access is permitted or you won't be able
  652. to login your account.
  653.  
  654. Once you've chosen the perfect account you can now change its password.
  655. Issue: MODIFY JOHN/PASSWORD=MY_PASSWORD. (John is the account name you found)
  656.  
  657. After you finished just type CTRL-Z and to exit. If you happen to logoff
  658. without exiting AUTHORIZE, don't worry.  Changes to SYSUAF.DAT are done
  659. instantly when the command finishes its execution.
  660.  
  661. One other advice, under SHELL if you happen to have SECURITY privilege
  662. Issue: SET AUDIT/ALARM/DISABLE=(AUTHORIZE)
  663.  
  664. If you don't do this, each time you run AUTHORIZE, modified accounts will be
  665. logged into OPERATOR.LOG so remember to do so.
  666.  
  667. After playing a bit with AUTHORIZE you won't have much problems understanding
  668. it. Hope you have PHUN! ;-)
  669.  
  670. ------------------------------------------------------------------------------
  671.  
  672. $ ! FACILITY: Mailback     (MAILBACK.COM)
  673. $ !
  674. $ ! ABSTRACT: VAXVMS to VAXVMS file transfer, using the VAX/PSI_MAIL
  675. $ !           utility of VAXPSI, over an X.25 link.
  676. $ !
  677. $ ! ENVIRONMENT: VAX/VMS operating system.
  678. $ !
  679. $! -------------------------------------------------------------------
  680. $ saved_verify := 'f$verify(0)'
  681. $ set noon
  682. $ ws = "write sys$output"
  683. $ ws ""
  684. $ ws "   MAILBACK transfer utility V1.0 (via Backup and PSI_Mail) 21-May-1990"
  685. $ ws ""
  686. $!
  687. $ if f$logical("debug").nes."" then set verify
  688. $ ask_p1:
  689. $ if P1.eqs."" then read/prompt="MailBack> Send or Receive (S/R) : " -
  690.                     sys$command P1
  691. $ P1 = f$edit(P1, "UPCASE,COMPRESS,TRIM")
  692. $!
  693. $!
  694. $ if P1.EQS."" then exit 1+0*f$verify(saved_verify)
  695. $ if P1.EQS."R" then goto receive_file
  696. $ if P1.nes."S" then goto ask_P1
  697. $! -------------------------------------------------------------------
  698. $!
  699. $! Sending File(s)
  700. $! ===============
  701. $ if P2.eqs. "" then -
  702.      read/prompt="MailBack> Recipient mail address (PSI%nnn::user) : " -
  703.      sys$command P2
  704. $ if P2.eqs."" then exit 1+0*f$verify(saved_verify)
  705. $!
  706. $!
  707. $ if P3.eqs."" then read/prompt="MailBack> File(s) : " sys$command P3
  708. $!
  709. $ ws "MailBack> ... Backuping the file(s) ..."
  710. $ Backup/nolog 'P3' sys$scratch:mailbck.tmp/sav/block=2048
  711. $!
  712. $ ws "MailBack> ... Converting format ..."
  713. $ convert/fdl=sys$input sys$scratch:mailbck.tmp sys$scratch:mailbck.tmp
  714. record
  715.  carriage_control carriage_return
  716. $!
  717. $ ws "MailBack> ... Sending a (PSI_)mail ..."
  718. $ on warning then goto error_sending
  719. $ mail/subject="MAILBACK Backup-File" -
  720.       /noself sys$scratch:mailbck.tmp 'P2'
  721. $ ws "MailBack> ... SEND command SUCCESSfully completed."
  722. $!
  723. $ fin_send:
  724. $ delete = "delete"
  725. $ delete/nolog/noconfirm sys$scratch:mailbck.tmp;,;
  726. $ exit  1+0*f$verify(saved_verify)
  727. $!
  728. $ Error_sending:
  729. $ ws "MailBack> Error detected while sending the mail ; ..."
  730. $ ws "MailBack> ... Fix the problem, then retry the whole procedure."
  731. $ goto fin_send
  732. $! -------------------------------------------------------------------
  733. $!
  734. $! Inbound File(s) Processing
  735. $! ==========================
  736. $receive_file:
  737. $!
  738. $ if P2.eqs."" then -
  739.      read/prompt="MailBack> Destination directory (<CR>= []) : " sys$command P2
  740. $ if P2.eqs."" then p2 ="[]"
  741. $!
  742. $!
  743. $!
  744. $ if P3.eqs."" then -
  745.      read/prompt="MailBack> Mail file (<CR>= default mail file) : " -
  746.      sys$command P3
  747. $ gosub build_file
  748. $ ws "MailBack> ... Extracting a (PSI_)mail from the NEWMAIL folder ..."
  749. $ define/exec sys$output nl:            ! ped 18-May-90 (wipe out mail displays)
  750.  
  751. $ if P3.eqs."" then goto normal_get
  752. $ define/nolog new_mail_file 'p3'
  753. $ define/user sys$command sys$input
  754. $ set message/nofacility/noseverity/notext/noident
  755. $ mail
  756. set file new_mail_file
  757. select NEWMAIL
  758. sear MAILBACK Backup-File
  759. extract/NOHEADER out_file
  760. $ deassign new_mail_file
  761. $ goto clean
  762. $ if P3.nes."" then p2 ="[]"
  763. $!
  764. $!
  765. $ normal_get:
  766. $ define/user sys$command sys$input
  767. $ set message/nofacility/noseverity/notext/noident
  768. $ mail
  769. select NEWMAIL
  770. sear MAILBACK Backup-File
  771. extract/NOHEADER out_file
  772. $!
  773. $ clean:
  774. $ deassign sys$output                           !
  775. $ set message/facility/severity/text/ident
  776. $ if f$search("out_file") .eqs. "" then goto nomessage
  777. $ on warning then goto error_conv
  778. $ ws "MailBack> ... Converting format ..."
  779. $ convert/fdl=sys$input out_file out_file /pad=%x00
  780.  record
  781.  format fixed
  782.  carriage_control none
  783.  size 2048
  784. $!
  785. $ ws "MailBack> ... Restoring file(s) from the backup saveset ..."
  786. $ on warning then goto error_back
  787. $ backup/nolog out_file/save 'P2'*.*
  788. $!
  789. $ delete = "delete"
  790. $ delete/nolog/noconfirm  'file';,;
  791. $ ws "MailBack> ... RECEIVE command SUCCESSfully completed."
  792. $!
  793. $ finish_r:
  794. $ deassign out_file
  795. $ exit  1+0*f$verify(saved_verify)
  796. $! -------------------------------------------------------------------
  797. $ error_conv:
  798. $ ws "MailBack> " + -
  799.      "An error occurred during the fdl convert of the extracted mail ;"
  800. $ ws "MailBack> ... the file ''file' corresponds to " + -
  801. $ ws "MailBack> ... the message extracted from Mail."
  802. $ goto finish_r
  803. $!
  804. $ error_back:
  805. $ ws "MailBack> An error occurred during the file restore phase with BACKUP ;"
  806. $ ws "MailBack> ... the file ''file' corresponds to "
  807. $ ws "MailBack> " + -
  808.      "... the  message extracted from Mail, converted as a backup Saveset."
  809. $ delete/nolog/noconfirm  'file';-1
  810. $ goto finish_r
  811. $!
  812. $ nomessage:
  813. $ ws "MailBack> No mail message has been found in the NEWMAIL folder."
  814. $ goto finish_r
  815. $!
  816. $Build_file:                    ! Build a unique (temporary) file_name
  817. $file = "sys$scratch:mail_" + f$cvtime(f$time(),,"month")+ -
  818. f$cvtime(f$time(),,"day") + f$cvtime(f$time(),,"hour")+ -
  819. f$cvtime(f$time(),,"minute")+ f$cvtime(f$time(),,"second") + ".tmp"
  820. $define/nolog out_file 'file'
  821. $return
  822.  
  823.