home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / network / rconfaq.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  18.1 KB  |  374 lines

  1. RCONSOLE Hacking
  2.  
  3. In this article I intend on showing you how to extract the RCONSOLE password
  4. from a sniffer trace to gain access to a Novell Netware's server console.
  5. While versions 3.x and 4.x employ packet signature and encryption techniques
  6. for a user to login, RCONSOLE (Remote CONSOLE) used a single password to 
  7. launch a remote session to the server's console, allowing an administrator 
  8. to type in commands as if they are at the console itself. 
  9.  
  10. While this article assumes some basic Netware knowledge, I do want to cover
  11. a few items regarding security.
  12.  
  13. Security Quick Basics
  14. ---------------------
  15.  
  16. There are 5 different levels of security within Netware at the file level. 
  17. These are:
  18.  
  19. 1. Not logged in. All you need is a connection to the server, you do not
  20. need to log in. This level of access allows running the most simple commands,
  21. such as LOGIN.EXE, SLIST.EXE, and basically any utility loaded into the
  22. SYS:LOGIN directory that doesn't require additional access.
  23.  
  24. 2. Logged in. Basic access controlled through Trustee Rights.
  25.  
  26. 3. Operator access. Operators have basic access and can control print queues,
  27. run a few special commands including FCONSOLE.
  28.  
  29. 4. Supervisor access. Full access to the file system. This is the access level
  30. most guarded, as you can get to any and every file on the system, administer
  31. and control virtually every aspect from user access to server configuration
  32. to security.
  33.  
  34. 5. OS access. This is the level of access that processes running on the 
  35. server run at. Most commands typed in at the console run at this level, and 
  36. while you cannot access the file system at the level of detail that you can 
  37. as a Supervisor, you can certainly open the door for Supervisor access. NLMs 
  38. (Network Loadable Modules) are programs that when loaded at the console 
  39. become a part of the Netware OS environment. Some NLMs stay loaded, some 
  40. perform their task and then unload themselves, but all of them run at this 
  41. level of security. Gaining access to the console gives you this level of 
  42. access.
  43.  
  44. What we are going to cover is an inherit weakness within the security system 
  45. of Netware -- remote access to the console. While Novell has gone to great
  46. lengths to ensure adequate security for security levels 1-4 listed above,
  47. RCONSOLE access is protected by a single password with simple encryption, 
  48. encryption that can be broken. One of the tools I will refer to is RCON.EXE. 
  49. This utility, written by itsme of the Netherlands (author of HACK.EXE, 
  50. KNOCK.EXE and several other notorious Netware tools), allows you to take 
  51. information gained from a sniffer trace of the RCONSOLE initialization 
  52. conversation and break the encryption -- essentially "decrypting" the 
  53. RCONSOLE password.
  54.  
  55. Once you have the RCONSOLE password, you can employ other techniques to open
  56. a door to the entire file system -- Supervisor access.
  57.  
  58. The hardest part, in my opinion, is getting the trace. Most of the 
  59. information in this article involves technical items based on predictable and
  60. repeatable facts. But getting the capture of a trace using a sniffer can be 
  61. very tricky. You are dealing with a few different items - accessability, 
  62. availability, and timing.
  63.  
  64. Accessability
  65. -------------
  66.  
  67. You will need access to the network. Specifically, you will need to run your 
  68. sniffer trace either on the server's segment or the user's segment, otherwise 
  69. you may never see the conversation. While it is possible to run the trace on 
  70. a segment over which the traffic passes, it is easier to find out the segment 
  71. of the user. The easiest way is to log into the a server that the target user 
  72. logs into and type USERLIST /A. From the list you should see the network and 
  73. the node address. The network number is the segment the user is on, and the 
  74. node address is the 12-digit hex number burnt into the network interface card 
  75. (NIC), also known as the MAC, or Media Access Control address.
  76.  
  77. Of course the proceeding paragraph assumes you have physical access to the 
  78. network. It is possible to dial into a LAN running pcAnywhere, install a 
  79. DOS-based sniffer, and capture packets. It is also possible to get to a Unix
  80. box and start up a sniffer there. I will not get into those details here, but
  81. you have to assume that the System Administrator doesn't have the pcAnywhere 
  82. dial-in machine right there at his desk, or you can get by the firewall. S/he
  83. might notice a sniffer running and start a trace.
  84.  
  85. Availability
  86. ------------
  87.  
  88. Running a sniffer trace is pretty CPU intensive. The CPU must be fast enough 
  89. to copy all info from the NIC's buffer to RAM without missing a packet. If 
  90. your sniffer is filtering information, that is, if it is looking at the 
  91. insides of each packet and only saving those that meet certain criteria, this 
  92. can be even more CPU intensive. Some of you may have already noticed a big 
  93. dilemma. You have to have a sniffer running on a computer that can handle a 
  94. decent amount of CPU activity (486 recommended), attached to a specific 
  95. network, and allowed to run without someone walking up and noticing. And the 
  96. brings us to the last problem.
  97.  
  98. Timing
  99. ------
  100.  
  101. This one is the kicker. If you can meet the previous requirements, then you 
  102. are left with the hardest one -- getting the actually packet captured. This 
  103. can be accomplished in one of two ways. First, through some social 
  104. engineering you can create a need for the Sys Admin to launch RCONSOLE, or 
  105. you can filter out and look for that single packet that contains the 
  106. password. 
  107.  
  108. The first way is a bit tricky, but not impossible. Posing as a new employee,
  109. call the Sys Admin and say that when you try to log in you keep getting the
  110. message "The SUPERVISOR has disabled the login function". To fix this, the
  111. normal thing to do is type ENABLE LOGIN at the console prompt. The Admin will
  112. invariably launch RCONSOLE to correct the problem, and then you have your
  113. packet. S/he will tell you that everything looks okay, so then say "my 
  114. computer is locked up". They will probably conclude that the problem is at
  115. your workstation and advise you to reboot, with the chances being very good
  116. they'll say "When it comes up you should be okay, so call me back if there
  117. is a problem" and then hang up. Fine. You've got the packet.
  118.  
  119. The second one depends on your sniffer. If it can actually analyze packets
  120. in real time, have it capture only packets between the Sys Admin's desk and
  121. the server, plus only save SPX packets. If it only works using a pattern
  122. match of some kind, use the detailed information on identifying the packets
  123. to find a specific pattern for your sniffer to key off of. At the end of the 
  124. next section are some pattern matching tips.
  125.  
  126. A final note on accessability, availability, and timing -- a carefully placed
  127. laptop with an Ethernet PCMCIA running sniffer software AND filtering
  128. capabilities will get you everything.
  129.  
  130. Analyzing the Packets
  131. ---------------------
  132.  
  133. Once you've captured packets from your user, you need to be able to look at
  134. the data and interpret it. You must be able to find the packets coming from 
  135. the user going to the server. Depending on your sniffer, this may prove to be
  136. quite a task. Most of the high-priced sniffers allow you to filter on 
  137. addresses and packet type, and these features are great for finding exactly 
  138. what you need. But the low-end solutions, especially freeware or shareware, 
  139. may have little or no filtering capability, and that means looking at a lot 
  140. of hex dumps.
  141.  
  142. But we will assume that you know how to use your sniffer (or get the dump 
  143. from a promiscuous network card) and at least get to the point of finding the
  144. user's and the server's conversation. To help you find these packets, we will
  145. discuss ways to find the addresses.
  146.  
  147. Now here are the first three packets that are sent after the user has hit 
  148. enter after entering the password.
  149.  
  150. Ethernet packet sent from the workstation to the server to establish the SPX 
  151. connection:
  152.  
  153. ADDR  OFFSET
  154. BASE  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
  155. ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
  156. 0000  00 80 29 00 34 35 00 00  A2 00 3D 77 00 2A FF FF
  157. 0010  00 2A 04 05 00 00 00 03  00 00 00 00 00 01 81 04
  158. 0020  00 00 00 02 02 60 8C A7  E9 AA 50 0E C0 00 44 00
  159. 0030  FF FF 00 00 00 00 00 06  ED 05 00 00
  160.  
  161. The server responses:
  162.  
  163. ADDR  OFFSET
  164. BASE  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
  165. ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
  166. 0000  00 00 A2 00 3D 77 00 80  29 00 34 35 00 2A FF FF
  167. 0010  00 2A 01 05 00 00 00 02  02 60 8C A7 E9 AA 50 0E
  168. 0020  00 00 00 03 00 00 00 00  00 01 81 04 80 00 90 82
  169. 0030  44 00 00 00 00 00 00 00  08 00 5A 7F
  170.  
  171. And the password is sent:
  172.  
  173. ADDR  OFFSET
  174. BASE  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
  175. ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
  176. 0000  00 80 29 00 34 35 00 00  A2 00 3D 77 00 AC FF FF
  177. 0010  00 AC 04 05 00 00 00 03  00 00 00 00 00 01 81 04
  178. 0020  00 00 00 02 02 60 8C A7  E9 AA 50 0E 40 00 44 00
  179. 0030  90 82 00 00 00 00 00 06  FE FF 47 45 5A 4D 4C 24
  180. 0040  8C 9C 8A 3A B3 46 33 25  13 15 6E 94 94 4F C0 5B
  181. 0050  08 14 A5 0A 70 E5 F2 0B  F4 70 AA 03 FA 3F C4 88
  182. 0060  C0 79 FF 85 CB 0B 27 56  B6 D3 CF 8E 2D 9F 7D 25
  183. 0070  85 25 7C E8 B3 95 29 AF  8C 8E 4E 11 EE F7 37 8C
  184. 0080  35 C4 AD A3 F9 80 18 4E  0C CD 9E 26 0B 65 2A 3B
  185. 0090  1A 1E F4 AD 43 BB 6E 06  35 8C 49 3B 3B 3A B6 00
  186. 00A0  39 CB 17 6B C2 5C 63 38  D1 0B 3C A0 EB B0 40 66
  187. 00B0  87 DE E6 3E 1C 2A 12 FC  A2 37                  
  188.  
  189. To explain a bit of what is going on, let's look at what makes up these 
  190. packets, starting with the first one.
  191.  
  192. Offset 00h through 0Dh is the Data Link Control layer:
  193.  
  194. ADDR  OFFSET
  195. BASE  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
  196. ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
  197. 0000  00 80 29 00 34 35 00 00  A2 00 3D 77 00 2A        Offset 00h through 0Dh
  198.                                                         is the Data Link
  199.                                                         Control layer.
  200.  
  201. 0000                                             FF FF  Start of IPX header, 
  202. 0010  00 2A 04 05                                       FF FF is a checksum
  203.                                                         10h and 11h is the IPX 
  204.                                                         length, 12h is the
  205.                                                         transport control, 13h
  206.                                                         is the IPX packet type 
  207.                                                         (05 is SPX).
  208.  
  209. 0010              00 00 00 03  00 00 00 00 00 01 81 04  14h through 1Fh is the
  210.                                                         packet destination
  211.  
  212. 0020  00 00 00 02 02 60 8C A7  E9 AA 50 0E              20h through 29h is the
  213.                                                         packet source
  214.  
  215. 0020                                       C0 00 44 00  2Ch starts the SPX 
  216.                                                         section with 2Ch the
  217.                                                         control type, 2Dh the
  218.                                                         datastream type, and
  219.                                                         2Eh and 2Fh the SPX
  220.                                                         source connection ID.
  221.  
  222. 0030  FF FF 00 00 00 00 00 06                           30h and 31h are the 
  223.                                                         destination connect
  224.                                                         ID. FF FF is a 
  225.                                                         broadcast or the 1st
  226.                                                         SPX packet in this 
  227.                                                         conversation. The 
  228.                                                         next 3 byte pairs are
  229.                                                         the sequence number,
  230.                                                         the acknowledgement 
  231.                                                         number and the 
  232.                                                         allocation number.
  233.  
  234. 0030                                       ED 05 00 00  The minimum length for
  235.                                                         a packet will be 60
  236.                                                         bytes, so if there 
  237.                                                         is no data then the
  238.                                                         last 4 bytes are 
  239.                                                         padded with junk.
  240.  
  241. Pattern Matching Tips 
  242.  
  243. 1. Look for FF FF xx xx xx 05 to find an SPX packet starting at offset 0Eh.
  244. 2. The address of the server starts at offset 14h, in the above packet it is 
  245.    00000003:000000000001 with an IPX socket of 8104. All IPX conversations use                  
  246.    IPX socket numbers, so pattern match off of 14h through 1Dh.   
  247. 3. The address of the user starts at offset 20h, in the above packet it is 
  248.    00000002:02608CA7E9AA with an IPX socket of 500E. Pattern match on offset
  249.    20h through 29h.
  250.  
  251. With the information above you should be able to identify an SPX packet when 
  252. you see one, and identify the addresses of the server and the user. Now let's
  253. use this information to get what we need out of the third packet we've
  254. captured, the one with the RCONSOLE password.
  255.  
  256. ADDR  OFFSET
  257. BASE  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
  258. ----  -- -- -- -- -- -- -- --  -- -- -- -- -- -- -- --
  259. 0000  00 80 29 00 34 35 00 00  A2 00 3D 77 00 AC FF FF
  260. 0010  00 AC 04 05 00 00 00 03  00 00 00 00 00 01 81 04
  261. 0020  00 00 00 02 02 60 8C A7  E9 AA 50 0E 40 00 44 00
  262. 0030  90 82 00 00 00 00 00 06  FE FF 47 45 5A 4D 4C 24
  263. 0040  8C 9C 8A 3A B3 46 33 25  13 15 6E 94 94 4F C0 5B
  264. 0050  08 14 A5 0A 70 E5 F2 0B  F4 70 AA 03 FA 3F C4 88
  265. 0060  C0 79 FF 85 CB 0B 27 56  B6 D3 CF 8E 2D 9F 7D 25
  266. 0070  85 25 7C E8 B3 95 29 AF  8C 8E 4E 11 EE F7 37 8C
  267. 0080  35 C4 AD A3 F9 80 18 4E  0C CD 9E 26 0B 65 2A 3B
  268. 0090  1A 1E F4 AD 43 BB 6E 06  35 8C 49 3B 3B 3A B6 00
  269. 00A0  39 CB 17 6B C2 5C 63 38  D1 0B 3C A0 EB B0 40 66
  270. 00B0  87 DE E6 3E 1C 2A 12 FC  A2 37                  
  271.  
  272. What we need is the network address (offset 20h through 23h), the node 
  273. address (offset 24h through 29h) and the actual encrypted password. In the
  274. data section starting at 38h, 38h will always be FE and 39h will always be 
  275. FF. The next 8 bytes will be the password bytes. I know what you're thinking,
  276. there's a lot of other bytes there, but the first 8 are the significant ones.
  277. Not exactly C2, are we?
  278.  
  279. Running RCON
  280. ------------
  281.  
  282. From the example above, the password is 47455A4D4E248C9C, the network is
  283. 00000002 and the node is 02608CA7E9AA. Therefore you would run RCON as 
  284. follows:
  285.  
  286. RCON 47455A4D4E248C9C 00000002 02608CA7E9AA
  287.  
  288. It will response with the following:
  289.  
  290. decrypted pw:
  291. 0000 : 47 45 5a 4f 4e 44 00 3b e9 aa 15 15 15 17 17 75  - GEZOND.;Θ¬.....u
  292. node address after encryption:
  293. 0000 : 11 11 11 13 13 71 9d b8 e5 a6                    - .....q¥╕σª      
  294.  
  295. As you can see, the RCONSOLE password is "GEZOND".
  296.  
  297. The Next Step
  298. -------------
  299.  
  300. Now a few things to keep in mind when accessing the console remotely. When 
  301. using RCONSOLE, your activities are being recorded. So after getting the
  302. password, don't just jump into RCONSOLE without planning on doing something
  303. to cover your tracks. And to cover your tracks you must gain access to the
  304. file system.
  305.  
  306. A quick note -- since the Supervisor password also works with RCONSOLE,
  307. always try to login as Supervisor with the password you have uncovered. If
  308. you get in, great. Full access to the file system.
  309.  
  310. Now I'm not going to go into a LOT of detail here, but there are several
  311. techniques you can use to gain access to the file system as Supervisor. All
  312. of the ones I'm going to mention involve uploading NLMs to the file server
  313. and then running them. RCONSOLE has a built-in option to upload files to
  314. the server (hit * on the keypad and select the option for transferring
  315. files to the server). You should immediately upload a nefarious NLM to gain
  316. file system access and wipe your tracks. Here is a quick example, once again 
  317. assuming some general Netware admin knowledge:
  318.  
  319. 1. At the system console, type in UNLOAD CONLOG. If CONLOG is loaded, every
  320. response to every command at the console is being written to a file. The 
  321. CONLOG.NLM comes with 4.x but works with 3.x.
  322.  
  323. 2. Upload BURGLAR.NLM and create a new user with Supervisor rights, or 
  324. upload SETPWD.NLM and reset a Supervisor equivalent user ID's password
  325. (BURGLAR.NLM and SETPWD.NLM can be found on the Internet).
  326.  
  327. 3. Exit RCONSOLE and login.
  328.  
  329. 4. Delete BURGLAR.NLM or SETPWD.NLM and purge it from the system.
  330.  
  331. 5. If CONLOG was loaded, find and delete or edit the CONSOLE.LOG file to 
  332. remove your activity. Delete or edit SYS$LOG.ERR and remove any activity 
  333. you create there. If you delete these files, purge them. If you edit these
  334. files, use FILER to reset the ownership of the file.
  335.  
  336. Of course the quick-witted admin might notice CONLOG isn't loaded -- if I
  337. think an admin is going to notice that, I reboot the server by running an
  338. NCF file with the following lines:
  339.  
  340. REMOVE DOS
  341. DOWN
  342. EXIT
  343.  
  344. When running this NCF file, I remain remoted into the console in case I need 
  345. to answer Yes to the "are you sure" questions. For more information on
  346. creating and running NCF files, refer to one of hundreds of Netware books
  347. currently available at any bookstore.
  348.  
  349. Conclusions
  350. -----------
  351.  
  352. Well, the first conclusion is that Netware's RCONSOLE utility isn't very
  353. secure! If you are an administrator, the only way to thwart this type of
  354. attack at this time is to upgrade to 4.x and use packet signature.
  355.  
  356. Of course the other items to recap are 1) you are going to need a little
  357. time and access, both at the RIGHT time; 2) you are going to have to have a
  358. couple more tools (like SETPWD.NLM or BURGLAR.NLM) to gain file system
  359. access; 3) it is highly recommended you work quickly (duh); and 4) you should
  360. cover your tracks as best you can.
  361.  
  362. Have fun and happy hacking.
  363.  
  364. [ Thanks to itsme for coding RCON.EXE and Jeff Carr for assisting in testing
  365. of the techniques of this article. RCON.EXE can be found at ftp.fastlane.net
  366. in the /pub/nomad/nw directory. ]
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.