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

  1.  
  2. From gregmi@galileo.mis.net Sat Oct 12 23:31:23 1996
  3. Date: Sat, 03 Aug 1996 22:39:21 -0400
  4. To: netware-hack@dey-systems.com
  5. From: Greg Miller <gregmi@galileo.mis.net>
  6. Message-ID: <2.2.32.19960804023921.00673238@mis.net>
  7. Subject: Draft of "A Few Attacks on the Zero Knowledge State In  Novell's NetWare"
  8.  
  9.  
  10.         This is a text draft of my paper on the zero knowledge state attacks
  11. of Netware.  The finished document will be distributed in PostScript format
  12. which will produce a document which is much easier to read.
  13. ------------------------------------------------------------------------------
  14.  
  15.  
  16.  
  17.        A Few Attacks on the Zero Knowledge State In Novell's NetWare
  18.  
  19.                                 Greg Miller
  20.                                July 30, 1996
  21.  
  22.  
  23.  
  24.  
  25.                                   Abstract
  26.  
  27. Novell's NetWare has employed a number of security measures to ensure the
  28. protection of  data on both the workstation and the server.  However, a few
  29. design flaws allows even the most secure version of NetWare (NetWare 4.0) to
  30. fall to attacks.  The attacks employed have been well known throughout the
  31. cryptographic community for several years.  The features Novell has added
  32. include packet signatures and two different elaborate login protocols (one
  33. for NetWare 3.x and one for 4.x).  I will show that these added features
  34. fail to provide the security they intend to as well as feasible means of
  35. implementing the attacks on a NetWare internetwork.
  36.  
  37.  
  38.  
  39. 1.0 Introduction
  40.  
  41.     Contrary to the number of security measures Novell has added to its NetWare
  42. servers over the years, there still remain a few serious flaws.  Some of the
  43. flaws can be bypassed through the reconfiguration of the server and the
  44. workstations.  However, some of the attacks require the security features of
  45. NetWare to be redesigned.
  46.     I will start with a general overview of the relevant security features of
  47. NetWare, then move on to a description of the attacks I will be using to
  48. defeat these security features.  The two attacks I will be using are the Man
  49. in the Middle Attack, and the Chessmaster Attack (or Grand Chessmaster
  50. Attack).  Having described these attacks in general terms, I will then show
  51. how the attacks can be implemented feasibly on a NetWare network.  The
  52. attacks will include a method which allows the attacker to execute any
  53. arbitrary program on a given workstation, a method which allows an attacker
  54. to log in as a given user without knowing the user's password (separate
  55. attacks are given for 3.12 and 4.x), an attack which allows the intruder to
  56. do an off-line guessing attack on NetWare 4.x passwords, and one attack
  57. which enables the intruder to modify data sent to a workstation.
  58.     After I have presented the attacks, I will describe a few changes in the
  59. network configuration which can be used to secure the network against most
  60. of the attacks.  However, some of the attacks can only be secured by
  61. redesigning the way NetWare implements its security features.
  62.  
  63.     Throughout the paper I will make use three different names to describe
  64. entities in the network.  I call them Alice, Jane, and Bob.  I will assume
  65. that Alice and Jane are two entities which wish to communicate securely, and
  66. that Bob wishes to attack the security features Alice and Jane implement in
  67. their protocols.  In some cases it is necessary to indicate that Alice will
  68. request to initiate the conversation, while Jane will accept (or deny) the
  69. request.
  70.  
  71.  
  72. 2.0 An Overview of NetWare Security Features
  73.  
  74.     Novell has implemented features into NetWare to prevent methods such as
  75. address spoofing and password capturing through the use of packet sniffers.
  76. Also a feature added to NetWare 4.0 was added to prevent the use of an
  77. off-line password guessing attack.  The features include a packet signing
  78. scheme, an encrypted login sequence, and NetWare 4.0 employs the use of
  79. public key cryptography.
  80.  
  81. 2.1 Packet Signatures
  82.  
  83.     Packet signatures were added to NetWare 3.12 to prevent address spoofing
  84. attacks after a few students at Leiden University put together a program
  85. which allowed anyone to grant supervisor rights to every user on the NetWare
  86. server.
  87.     To solve the problem, Novell added a feature to NetWare 3.12 which allows
  88. the client and the server to sign packets based on the common knowledge of a
  89. hash of the user's password.  In its default configuration the NetWare
  90. server doesn't require all clients to sign packets.  The server can be
  91. configured for packet signatures in three different ways:  not sign packets
  92. at all, only sign packets if the client can, and always require the client
  93. to sign packets (if the client cannot sign packets, then the login sequence
  94. fails).
  95.     NetWare 4.x employs a different method of signing packets.  The
  96. configuration is the same, but the algorithm used to sign the packets
  97. changed.  The combination of the RSA algorithm and the Guillou-Quisquarter
  98. authentication scheme are used.  Here the client uses the GQ key while the
  99. server uses the RSA key.  Please note that these are only used for
  100. authentication and not encryption of network traffic.
  101.     In either case, only the first 52 bytes of each packet are signed to
  102. increase efficiency.  Novell claims that this is sufficient to guard all the
  103. vital data in the packet.  I will show that this is not true.
  104.  
  105. 2.2 The NetWare 3.12 Encrypted Login Sequence
  106.  
  107.     The login sequence isn't really encrypted, but for some reason all the
  108. literature states it that way.  Really a one way hash is performed on the
  109. password, and then a hash is performed on the hash.  The user's actual
  110. password is never transmitted in a reversible way across the network (nor is
  111. the hash of the password).  The login sequence is as follows:
  112.  
  113. 1.  Alice sends a login request to the server.
  114. 2.  The server retrieves a hash of Alice's password (X) and Alice's user ID
  115. (s) stored in the server's database, then computes a random value (R), and
  116. sends the pair (s,R) to Alice.
  117. 3.  Alice computes X'=hash(password,s), then computes Y'=hash(X',R).  Then
  118. sends the value Y' to the server.
  119. 4.  The server checks to see if Y=Y', if so, Alice is granted access.
  120. 5.  If both Alice and the server agree to use packet signatures, they both
  121. compute another hash of the triple (X,R,c) (where c is some constant value).
  122. This value is then used as a common secret for generating hashes of the
  123. vital data in packets sent between Alice and the server.
  124.  
  125. 2.3 The NetWare 4.x Encrypted Login Sequence
  126.  
  127.     The login protocol for NetWare 4.x is similar to that used in NetWare 3.12.
  128. It differs in the fact that it uses RSA encryption to prevent an off-line
  129. guessing attack, and RSA authentication is performed if Alice and the server
  130. agree to use packet signatures.  The protocol is as follows:
  131.  
  132. 1.  Alice sends a login request to the server.
  133. 2.  The server retrieves Alice's UID (s) and generates a random value (R)
  134. and sends the pair (s,R) to Alice, as well as the server's public RSA key.
  135. 3.  Alice generates X'=hash(password,s) and Y'=hash(password,R) and
  136. generates       another random value (R2).  Alice then encrypts the pair
  137. (R2,Y') with the server's public key and sends the result to the server.
  138. 4.  If the server verifies that Y=Y', the server will retrieve Alice's
  139. private RSA key (P) from the server's database, compute P XOR R2, then
  140. encrypt the result with Y, and will send this value back to Alice.
  141. 5.  Alice decrypts her private key, and generates a GQ key which she uses to
  142. sign packets.
  143.  
  144.     The primary advantage (and apparently the only advantage) this protocol has
  145. over the 3.12 protocol is that it prevents an off-line guessing attack
  146. through the encryption of the (R2,Y') pair with the server's public key.
  147.     A rather odd feature is the encryption of the P XOR R2 result with Y in
  148. step #5.  This appears to have no effect on the security of the protocol
  149. since the only way to reveal R2 is to decrypt the (Y',R2) pair.  If Bob can
  150. decrypt the pair (Y',R2), he will also know Y if Y=Y' and thus, can decrypt
  151. the value sent to Alice in step #5.
  152.  
  153. 3.0 The Man in the Middle Attack
  154.  
  155.     A Man in the Middle Attack can be implemented on a protocol which uses a
  156. reliable transport layer such as SPX or TCP without requiring the attacker
  157. (Bob) to be physically in the middle of the two communicating parties (Alice
  158. and Jane).
  159.     One method for implementing an attack using a single machine with a single
  160. entry point in to the network was done Joncheray in [JON95].  Joncheray's
  161. attack has two disadvantages:  it requires that the connection be closed
  162. then re-opened, and it causes the generation of a significant number of
  163. packets which overload the network.  Due to these two disadvantages the
  164. attack can be detected.  One other thing to note about this attack is that
  165. it won't work with SPX.
  166.     I'll present an attack which will work for both TCP and SPX, but requires
  167. more resources to be available than Joncheray's attack.  I will later show
  168. that due to a design flaw in the SPX implementation that the need for these
  169. added resources can be removed when Alice and Jane are using SPX.
  170.     Under normal circumstances, when Alice wishes to initiate a conversation
  171. with Jane, the setup goes as follows:
  172.  
  173. 1.  Alice sends a connect request to Jane.
  174. 2.  Jane responds by sending her public key to Alice.
  175. 3.  Alice uses Jane's public key to encrypt some secret which will be used
  176. for authentication for the remainder of the session.
  177. 4.  Jane decrypts the secret and uses it to authenticate packets to and from
  178. Alice.
  179.  
  180.     Now suppose Bob wants to interrupt this protocol so that he may participate
  181. in the conversation with Alice and Jane without their knowledge.  For this,
  182. Bob will need two entry points into the network (one close to Alice, the
  183. other close to Jane).  Bob will also need a "fast" transmission medium
  184. between these two entry points, such as wireless network cards, cellular
  185. capable modems, normal modems over existing phone lines, etc. (this may
  186. require the use of more than one computer system).
  187.     I will now define a few parameters needed for the attack:
  188.  
  189. A            The network Alice is physically connected to.
  190. B            The network of Bob's first entry point close to Alice.
  191. C            The network of Bob's second entry point close to Jane.
  192. D            The network Jane is physically connected to.
  193. s[j],s[b]            Jane's and Bob's private key.
  194. p[j],p[b]            Jane's and Bob's public key.
  195. S(a,b)            The secret shared between Alice and Bob
  196. S(b,j)            The secret shared between Bob and Jane.
  197. E(a,b)            S(a,b) encrypted with p[b].
  198. E(b,j)            S(b,j) encrypted with p[j].
  199. P(x,y)            The propagation delay between points x,y in the Network.
  200. Pb(x,y)            The propagation delay over Bob's "fast" medium between x,y.
  201.  
  202.     For the attack to work, Bob must define a topology where B and C are
  203. between A and D and P(B,C)1 must be much greater than Pb(B,C)2.  This allows
  204. Bob to observe a packet at point B, retrieve the information from it, alter
  205. it, and introduce the altered packet into the network at point C (and vice
  206. versa).  Bob will use the sequence numbers retrieved at point B in the
  207. packet introduced at point C.  Bob's altered packet will beat Alice's packet
  208. to Jane.  When Jane receives Alice's packet, it will be discarded as a
  209. duplicate.
  210.     To interrupt the protocol, the following procedure will be followed:
  211.  
  212. 1.  Alice will send a connect request to Jane.
  213. 2.  Jane will send p[j] to Alice.
  214. 3.  Bob will see p[j] at point C, and copy the packet into memory, replace
  215. p[j] with p[b], and introduce the packet into the network at point B.
  216. 4.  Alice will receive p[b] believing that it's p[j], and will use p[b] to
  217. encrypt S(a,b) yielding E(a,b) which she will send to Jane.
  218. 5.  Alice will receive p[j] and will discard it as a duplicate since the
  219. sequence numbers match that of the packet containing p[b].
  220. 6.  Bob will see E(a,b) at point B, copy the packet into memory, decrypt
  221. E(a,b) with s[b], encrypt the result with p[j] yielding E(b,j) which he
  222. introduces into the network at point C3.
  223. 7.  Jane will receive E(b,j), decrypt it will s[j], and use the value to
  224. authenticate packets to and from Alice.
  225. 8.  Jane will receive E(a,b), but will discard it as a duplicate.
  226.  
  227. Note:  Bob does not have to send false ACKs to Alice and Jane for the
  228. packets he introduces into the network, because Alice and Jane will ACK the
  229. packets appropriately.
  230.  
  231.     If Alice and Jane use the secret to encrypt data, Bob only needs to sniff
  232. the data off the network at point B or C.  But to send packets as Alice or
  233. Jane, he has to sniff the packet at either B or C and introduce them at the
  234. opposite end to keep the sequence numbers synchronized.
  235.  
  236. 4.0  The Grand Chessmaster Attack
  237.  
  238.     Using the same method as above, a Chessmaster attack can also be
  239. implemented against two entities in a network using a reliable transport
  240. layer such as TCP or SPX.  The normal protocol (when not interrupted)
  241. proceeds as follows:
  242.  
  243. 1.  Alice broadcasts a request for a service.
  244. 2.  Jane responds indicating she can provide the service.
  245. 3.  Alice sends a connect request to Jane
  246. 4.  Jane responds by sending her public key.
  247. 5.  Alice encrypts some secret with Jane's public key and sends it to Jane.
  248. 6.  Jane decrypts the secret, and Alice and Jane use the secret for secure
  249. communication over the network.
  250.  
  251.     If Bob would like to appear to provide this service without actually being
  252. capable of doing so, he could use the following procedure:
  253.  
  254. 1.  Alice broadcasts a request for a service.
  255. 2.  Both Bob and Jane respond indicating they can provide the service.
  256. 3.  Alice arbitrarily chooses to use the service provided by either Bob or
  257. Jane and sends a connect request4 (we'll assume she chooses Bob).
  258. 4.  Bob responds by sending his pubic key to Alice.
  259. 5.  Alice encrypts some secret with Bob's public key and sends it to Bob.
  260. 6.  Bob decrypts the secret and uses the secret to communicate with Alice.
  261. 7.  Bob sends a connect request to Jane.
  262. 8.  Jane responds by sending Bob her public key.
  263. 9.  Bob encrypts some secret with Jane's public key and sends it to Jane.
  264. 10.  Jane decrypts the secret and uses it to communicate with Bob.
  265.  
  266.     When Alice makes a request:
  267.  
  268. 1.  Alice sends the request to Bob.
  269. 2.  Bob sends the request to Jane.
  270. 3.  Jane sends the reply to Bob.
  271. 4.  Bob sends the reply to Alice.
  272.  
  273.     This attack has several advantages over the Man in the Middle Attack: (1)
  274. it is much easier to implement (doesn't require packet filtering or address
  275. spoofing), (2) Less resources are required to implement the attack, (3) Bob
  276. does not have to be on a network between Alice and Jane, he can be on any
  277. network Alice is attached to which is closer to Alice than the network Jane
  278. is attached to.
  279.     There are also disadvantages to this attack: (1) Bob must identify himself
  280. to everyone on the network (and may get requests from other stations on the
  281. network), (2) Bob has to continuously forward all traffic between Alice and
  282. Jane.  As a result, this attack is detectable, and the attack will trip
  283. alarms on some NetWare servers on the network.
  284.  
  285. 5.0  Attacking the NetWare Login Protocols
  286.  
  287. 5.1  The NetWare 3.x Login Protocol
  288.  
  289.     Bob can use a combination of the Man in the Middle Attack and the
  290. Chessmaster attack to log in to a NetWare 3.x server without knowing the
  291. password of the user he is logging is as, and without revealing his
  292. intentions to other stations on the network (or even Alice).  Bob can use
  293. the following procedure to do so (this requires the resources as described
  294. in the Man in the Middle Attack).
  295.  
  296. 1.  Alice sends a login request as Alice to the server.
  297. 2.  Bob sees the request at either point B or C and sends a login request as
  298. Alice to the server.
  299. 3.  The server will respond by generating two random values (Ra and Rb) and
  300. send them to with Alice's UID to Alice and Bob respectively.
  301. 4.  Bob will receive Rb at point C, and then send Rb to Alice, introducing
  302. the packet into the network at point B.
  303. 5.  Alice will receive Rb, compute X'=hash(password,UID) and Y'=hash(X`,Rb)
  304. and will send this value to the server.
  305. 6.  Bob will see Alice's Y' at either point B or C, and copy it from the
  306. network and send it to the server.  This will effectively authenticate Bob
  307. as Alice.
  308. 7.  The server will receive two identical Y' values, the value Alice sent
  309. will most likely be wrong, while Bob's will be correct.  As a result, Bob
  310. will be granted access while Alice will be denied.
  311. 8. a.  If the server is configured to request packet signing, it will
  312. request Bob to sign his packets.
  313. b.  If the server is  configured to require packet signing, it will require
  314. Bob to sign packets.
  315. 9.   a.  Bob will not accept the request and will not sign packets.
  316. b.  Bob cannot compute the hash(X,Rb,c) so will not be able to log in.
  317.  
  318.     Note that steps eight and nine have no bearing on whether or not Alice has
  319. her workstation set up to deny, request, or require packet signatures.  A
  320. few other things are worth noting:  (1)  If Alice uses the same password on
  321. more than one server, Bob can log into any server she uses the same password
  322. on as the server she is attempting to log in to by also replacing the UID in
  323. step three, and (2) Bob logs in to the server without packet signatures
  324. which opens Alice's account up to spoofing attacks.
  325.  
  326. 6.0  Packet signature attacks
  327.  
  328. 6.1  Spoofing the LOGIN.EXE file
  329.  
  330.     A higher level view of the login sequence can be presented as follows:
  331.  
  332. 1.  Alice finds the nearest (or preferred) server and attaches to it.
  333. 2.  Alice downloads the LOGIN.EXE file and executes it.
  334. 3.  The login handshake is carried out and Alice is authenticated.
  335.  
  336.     One problem:  Packet signatures aren't enforced until after the user logs
  337. in.  Thus it is possible to any workstation to spoof the LOGIN.EXE file and
  338. replace it with any program.
  339.     When Alice attempts to download the login.exe file, she first sends a
  340. request to the server to open it.  The server then responds by sending
  341. information about the file back to Alice (such as the file length).  She
  342. will then submit read requests to the server until she has read in the
  343. entire file.
  344.     Bob can obviously use the Man in the Middle Attack configuration to replace
  345. the server's login.exe with his own trojan login.exe.  He would listen for a
  346. response to the open request from the server at point C, and replace a
  347. modified packet on to the network at point B.  He would do the same for each
  348. subsequent READ response.  The trojan login.exe could then log Alice in as
  349. normal and broadcast her password on to the network.  In this case, neither
  350. Alice nor the server can detect that anything has gone wrong.
  351.     Simply enforcing packet signatures while the login.exe file is being
  352. downloaded is not enough to secure against this attack.  When Alice first
  353. connects to the network, she broadcasts a request for the nearest server.
  354. Bob could use the Chessmaster Attack to have Alice attempt to connect to Bob
  355. rather than to Jane (the real server)5 using the following procedure:
  356.  
  357. 1.  Alice sends a request to find the nearest (or preferred) server.
  358. 2.  Bob responds before Jane stating that he is closer to Alice than Jane.
  359. 3.  Alice downloads the login.exe file from Bob.
  360. 4.  Bob's trojan login.exe logs Alice into Jane (and breaches security in
  361. some way).
  362.  
  363.     Any signature keys would have been retrieved from Bob at first and then
  364. renegotiated with Jane during the login sequence.  So Alice will not be able
  365. to detect that anything has gone wrong.  However, any intelligent station on
  366. the network which knows Bob is not a real server can detect what has
  367. happened.  If Bob is confident that he will be gone by the time anyone can
  368. act on the detection, then he can still "safely" use the attack.
  369.  
  370. 6.2 Modifying any File in Transit
  371.  
  372.     Novell added packet signatures with a specific goal in mind:  to prevent
  373. the use of address spoofing to grant privileged access to users.  In order
  374. to accomplish this goal, Novell designed the packet signatures in NetWare to
  375. only sign the first 52 bytes of each packet.
  376.     Bob can use the same method used to spoof the login.exe program, but can
  377. only change data beyond the signed 52 bytes.  Notice that this flaw is not
  378. derived from the zero-knowledge state, but is a general flaw in NetWare
  379. security.
  380.  
  381. 7.0  Predicting SPX Sequence Numbers
  382.  
  383.     To predict SPX sequence numbers, one only needs to know how to count.  The
  384. sequence numbers start at zero when the connection is established, and
  385. increment +1 for each packet.  In fact, the sequence number field is
  386. described as a counter in [CHA94].
  387.     Since Bob can reliably predict the sequence numbers, he does not need two
  388. separate entry points into the network when he only needs to know the
  389. sequence numbers.  The only attack this has any effect on is the spoofing of
  390. the login.exe file.  It allows Bob's entry points B and C to be equal.
  391. Since it is possible that A=B and C=D, it follows that that A=B=C=D as long
  392. as Bob can respond to the requests faster than Jane.
  393.  
  394. 9.0  References
  395.  
  396. [CHA94] "Novell's Guide to NetWare LAN Analysis", Laura A. Chappell and Dan
  397. E. Hakes, Sybex 1994.
  398.  
  399. [JON95] "Simple Active Attack Against TCP", Laurent Jonchery, Proceedings of
  400. the Fifth USENIX UNIX Security Symposium, Salt Lake City, Utah, June 1995.
  401.  
  402. 1 The delay between the time when Jane receives a request and the time she
  403. responds should also be considered in the propagation delay.
  404. 2  It is possible that A=B and C=D for just about any topology.
  405. 3 Here Bob has chosen to make S(a,b) = S(b,j).  This reduces the effort Bob
  406. has to implement to allow Alice and Jane to communicate.  By allowing these
  407. two values to be equal, he does not have to continually encrypt and decrypt
  408. all traffic between Alice and Jane.
  409. 4 Bob can normally ensure Alice will choose him over Jane by responding to
  410. the request first.  If not, Bob can indicate that he can provide this
  411. service better than Jane.  In NetWare, Alice will request the address of the
  412. nearest server, as long as Bob is closer than Jane, he will be chosen over Jane.
  413. 5  The server Alice initially attaches to is independent of the server Alice
  414. wishes to log in to (unless she has configured her workstation to attach to
  415. a preferred server).
  416.  
  417.  
  418.