Advertisement
TCB13

STKeys Strategy and Research (2008)

Jul 11th, 2012
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.74 KB | None | 0 0
  1. Yes, we're back with more embedded devices vulnerability research! And
  2. yes, we're also back with more security attacks against the BT Home
  3. Hub (most popular DSL router in the UK)!
  4.  
  5. As you know, we encourage folks in the community to team up with
  6. GNUCITIZEN in different projects as we've had very successful
  7. experiences doing so. This time it was Kevin Devine's turn. Kevin, who
  8. is an independent senior security researcher, did an awesome job at
  9. reverse engineering the *default WEP/WPA key algorithm* used by some
  10. Thomson Speedtouch routers including the BT Home Hub. Kevin noticed
  11. that all the public vulnerability research conducted in the past for
  12. the BT Home Hub had been released [1] by GNUCITIZEN, so he decided to
  13. share his findings and work with us in this fascinating project. As
  14. you might already know, at GNUCITIZEN we're committed members of the
  15. white-hat community who feel that it's our responsibility to inform
  16. the public when a security issue exists.
  17.  
  18. * Confirmed suspicions *
  19.  
  20. Many of us involved researching the security of wireless home routers
  21. have always suspected that routers that come with default WEP/WPA keys
  22. follow predictable algorithms for practical reasons. Yes, I'm talking
  23. about routers that come with those stickers [2] that include info such
  24. as S/N, default SSID, and default WEP/WPA key. Chances are that if you
  25. own a wireless router which uses a default WEP or WPA key, such key
  26. can be predicted based on publicly-available information such as the
  27. router's MAC address or SSID. In other words: it's quite likely that
  28. the bad guys can break into your network if you're using the default
  29. encryption key. Thanks to Kevin, our suspicion that such issue exists
  30. on the BT Home Hub has been confirmed (keep reading for more
  31. details!). Our advice is: *use WPA rather than WEP and change the
  32. default encryption key now!*
  33.  
  34.  
  35. * Brief history of default WEP/WPA key algorithms research *
  36.  
  37. As far as I know, Kevin and james67 were the first researchers to
  38. publicly crack a default encryption key algorithm of a Wi-FI home
  39. router. Kevin cracked [3] the algorithm used by Netopia routers which
  40. are shipped Eircom in Ireland and AT&T in the US (the second ISP was
  41. never reported, 0day!). On the other hand james67 [4] targeted [5] the
  42. Netgear DG834GT router shipped by SKY in the UK. Unfortunately,
  43. james67 did not [6] publish the details of the algorithm he cracked
  44. which is a shame as it means that we cannot learn from his research.
  45.  
  46. * The Thomson Speedtouch default WEP/WPA algorithm *
  47.  
  48. Unlike james67, Kevin's strategy to crack default WEP/WPA algorithms
  49. involve debugging setup wizards shipped by some ISPs, as opposed to
  50. debugging the router which uses the default key algorithm. Kevin
  51. obtained a copy of such wizard ("stInstall.exe") provided by Orange in
  52. Spain - which can be found on broadband customers' installation CDs.
  53. Such setup utility allowed him to figure out the default key
  54. algorithm.
  55.  
  56. In short we have:
  57.  
  58. S/N -> hash -> default SSID and encryption key
  59.  
  60. which can be read as: *a hashed version of the router's serial number
  61. is generated which is then used to derive both, the default SSID and
  62. the default encryption key.* This is just a high-level overview of the
  63. algorithm. More specifically we have (quoted from Kevin's stkeys tool
  64. source code comments):
  65.  
  66. Take as example: "CP0615JT109 (53)"
  67.  
  68. Remove the CC and PP values: CP0615109
  69.  
  70. Convert the "XXX" values to hexadecimal: CP0615313039
  71.  
  72. Process with SHA-1: 742da831d2b657fa53d347301ec610e1ebf8a3d0
  73.  
  74. The last 3 bytes are converted to 6 byte string, and appended to
  75. the word "SpeedTouch" which becomes the default SSID: SpeedTouchF8A3D0
  76.  
  77. The first 5 bytes are converted to a 10 byte string which becomes
  78. the default WEP/WPA key: 742DA831D2
  79.  
  80. In the case of the BT Home Hub, the only difference that is we only
  81. take the last two bytes (rather than 3 bytes) from the SHA1 hash to
  82. derive the SSID:
  83.  
  84. S/N: CP0647EH6DM(BF)
  85.  
  86. Remove CC and PP values: CP06476DM
  87.  
  88. "XXX" values hex-encoded: CP064736444D
  89.  
  90. SHA1-ed: 06f48a28eba1ab896a396077d772fd65503b8df3
  91.  
  92. Default SSID: BTHomeHub-8DF3
  93.  
  94. Default encryption key: 06f48a28eb
  95.  
  96. By brute-forcing possible serial numbers and deriving the default SSID
  97. and encryption key, we can find possible keys for a given default
  98. SSID, which is exactly what Kevin's stkeys [7] tool does.
  99.  
  100. The bigger the number of hexadecimal digits the target SSID has, the
  101. smaller the number of generated possible keys is. For instance, if the
  102. target SSID is "SpeedTouchF8A3D0″, we can narrow down the number of
  103. possible keys to only two. On the other side, a target SSID with only
  104. 4 hex digits (2 bytes) such as "BTHomeHub-20E3″ would give us 80
  105. possible keys on average.
  106.  
  107. We've tested ST585v6 which is shipped by Orange in Spain. Thomson
  108. Speedtouch routers provided by Orange in Spain come with WPA enabled
  109. by default. Being able to *narrow down the number of possible default
  110. WPA keys to only two* using Kevin's tool is quite remarkable.
  111.  
  112. _Spanish translation of previous paragraph:_
  113.  
  114. _Hemos probado el ataque contra el ST585v6 que viene con las
  115. conexiones de banda ancha de Orange en España. Los routers Thomson
  116. Speedtouch que son proveidos por Orange en España vienen con llave WPA
  117. activada por defecto. El poder reducir el numero de posibles llaves
  118. WPA que vienen por defecto a solo dos usando la herramienta de Kevin
  119. es formidable!_
  120.  
  121. In the case of the BT Home Hub in the UK (which only comes with 40
  122. bits WEP encryption by default by the way), we can narrow down the
  123. number of possible keys to about 80. In order to avoid the
  124. brute-forcing computation time required by the "stkeys" tool, I
  125. created "BTHHkeygen" which looks up the possible keys for a given SSID
  126. from a pre-generated "SSID->keys" table. Think of it as a rainbow
  127. table for cracking the BT Home Hub's default WEP encryption key. Once
  128. the list of around 80 keys is obtained, the second step in the attack
  129. is to try each of them automatically, until the valid key is
  130. identified. For this purpose I created "BTHHkeybf" which is a fancy
  131. wrapper around the "iwconfig" Linux tool. We tested three different
  132. BT Home Hubs, and the the attack seems to work fine.
  133.  
  134. _The BT Home Hub v1.5 model uses a different algorithm which we have
  135. not attempted to crack yet._
  136.  
  137. There is one thing that I want to mention regarding this attack when
  138. launched against a BT Home Hub: breaking into a BT Home Hub Wi-Fi
  139. network which uses default settings (40 bits WEP) has always been
  140. possible in a matter of minutes (if packet injection attacks are used)
  141. since the Home Hub was released into the market. Therefore, this
  142. predictable-default-key attack doesn't change the current state of the
  143. BT Home Hub's Wi-Fi insecurity. It's always been known that BT Home
  144. Hub Wi-Fi networks can be easily broken into by cracking the WEP key!
  145. [8]
  146.  
  147. * PoC *
  148.  
  149. BTHHkeygen (including rainbow tables) and BTHHkeybf can be found here:
  150. http://conference.hitb.org/hitbsecconf2008dubai/materials/D2T1%20-%20Adrian%20Pastor%20-%20Cracking%20Into%20Embeded%20Devices%20and%20Beyond.zip
  151. (located on the "\BT Home Hub\demo_exploits\Default WEP key cracking\" folder)
  152.  
  153. * References *
  154.  
  155. [1] http://www.google.co.uk/search?q=site:gnucitizen.org+bt+home+hub&num=100&hl=en&filter=0
  156. [2] http://www.belkin.com/support/dl/assets/uk-labels/bthomehub2.jpg
  157. [3] http://h1.ripway.com/kevindevine/wep_key.html
  158. [4] http://www.skyuser.co.uk/forum/blogs/james67/
  159. [5]
  160. http://www.skyuser.co.uk/forum/sky-broadband-help/20295-breaking-terms-conditions-your-views-welcome-2.html#post128738
  161. [6] http://www.theregister.co.uk/2008/02/21/sky_broadband_wi_fi_keys_unpicked/
  162. [7] http://weiss.u40.hosting.digiweb.ie/stech/stkeys.zip
  163. [8] http://www.hackernotcracker.com/2007-06/using-aircrack-ngaireplay-ng-under-injection-monitor-mode-in-windows.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement