Default Key Algorithm In Thomson And BT Home Hub Routers
Yes, we're back with more embedded devices vulnerability research! And yes, we're also back with more security attacks against the BT Home Hub (most popular DSL router in the UK)!
As you know, we encourage folks in the community to team up with us in different projects as we've had very successful experiences doing so. This time it was Kevin Devine's turn. Kevin, who is an independent senior security researcher, did an awesome job at reverse engineering the default WEP/WPA key algorithm used by some Thomson Speedtouch routers including the BT Home Hub. Kevin noticed that all the public vulnerability research conducted in the past for the BT Home Hub had been released by GNUCITIZEN, so he decided to share his findings and work with us in this fascinating project.
Confirmed suspicions
Many of us involved researching the security of wireless home routers have always suspected that routers that come with default WEP/WPA keys follow predictable algorithms for practical reasons. Yes, I'm talking about routers that come with those stickers that include info such as S/N, default SSID, and default WEP/WPA key. Chances are that if you own a wireless router which uses a default WEP or WPA key, such key can be predicted based on publicly-available information such as the router's MAC address or SSID. In other words: it's quite likely that the bad guys can break into your network if you're using the default encryption key. Thanks to Kevin, our suspicion that such issue exists on the BT Home Hub has been confirmed (keep reading for more details!). Our advice is: use WPA rather than WEP and change the default encryption key now!
Brief history of default WEP/WPA key algorithms research
As far as I know, Kevin and james67 were the first researchers to publicly crack a default encryption key algorithm of a Wi-FI home router. Kevin cracked the algorithm used by Netopia routers which are shipped Eircom in Ireland and AT&T in the US (the second ISP was never reported, 0day!). On the other hand james67 targeted the Netgear DG834GT router shipped by SKY in the UK. Unfortunately, james67 did not publish the details of the algorithm he cracked which is a shame as it means that we cannot learn from his research.
The Thomson Speedtouch default WEP/WPA algorithm
Unlike james67, Kevin's strategy to crack default WEP/WPA algorithms involve debugging setup wizards shipped by some ISPs, as opposed to debugging the router which uses the default key algorithm. Kevin obtained a copy of such wizard ("stInstall.exe") provided by Orange in Spain - which can be found on broadband customers' installation CDs. Such setup utility allowed him to figure out the default key algorithm.
In short we have: S/N -> hash -> default SSID and encryption key
which can be read as: a hashed version of the router's serial number is generated which is then used to derive both, the default SSID and the default encryption key. This is just a high-level overview of the algorithm. More specifically we have (quoted from Kevin's stkeys tool source code comments):
Take as example: "CP0615JT109 (53)"
Remove the CC and PP values: CP0615109
Convert the "XXX" values to hexadecimal: CP0615313039
Process with SHA-1: 742da831d2b657fa53d347301ec610e1ebf8a3d0
The last 3 bytes are converted to 6 byte string, and appended to the word "SpeedTouch" which becomes the default SSID: SpeedTouchF8A3D0
The first 5 bytes are converted to a 10 byte string which becomes the default WEP/WPA key: 742DA831D2
In the case of the BT Home Hub, the only difference that is we only take the last two bytes (rather than 3 bytes) from the SHA1 hash to derive the SSID:
S/N: CP0647EH6DM(BF) Remove CC and PP values: CP06476DM "XXX" values hex-encoded: CP064736444D SHA1-ed: 06f48a28eba1ab896a396077d772fd65503b8df3 Default SSID: BTHomeHub-8DF3 Default encryption key: 06f48a28eb`
By brute-forcing possible serial numbers and deriving the default SSID and encryption key, we can find possible keys for a given default SSID, which is exactly what Kevin's stkeys tool does.
The bigger the number of hexadecimal digits the target SSID has, the smaller the number of generated possible keys is. For instance, if the target SSID is "SpeedTouchF8A3D0", we can narrow down the number of possible keys to only two. On the other side, a target SSID with only 4 hex digits (2 bytes) such as "BTHomeHub-20E3" would give us 80 possible keys on average.
We've tested ST585v6 which is shipped by Orange in Spain. Thomson Speedtouch routers provided by Orange in Spain come with WPA enabled by default. Being able to narrow down the number of possible default WPA keys to only two using Kevin's tool is quite remarkable.
In the case of the BT Home Hub in the UK (which only comes with 40 bits WEP encryption by default by the way), we can narrow down the number of possible keys to about 80. In order to avoid the brute-forcing computation time required by the stkeys tool, I created "BTHHkeygen" which looks up the possible keys for a given SSID from a pre-generated SSID->keys
table. Think of it as a rainbow table for cracking the BT Home Hub's default WEP encryption key. Once the list of around 80 keys is obtained, the second step in the attack is to try each of them automatically, until the valid key is identified. For this purpose I created "BTHHkeybf" which is a fancy wrapper around the "iwconfig" Linux tool. Unfortunately, in order to prevent abuse, we're not publishing such tools. We tested three different BT Home Hubs, and the the attack seems to work fine.
There is one thing that I want to mention regarding this attack when launched against a BT Home Hub: breaking into a BT Home Hub Wi-Fi network which uses default settings (40 bits WEP) has always been possible in a matter of minutes (if packet injection attacks are used) since the Home Hub was released into the market. Therefore, this predictable-default-key attack doesn't change the current state of the BT Home Hub's Wi-Fi insecurity. It's always been known that BT Home Hub Wi-Fi networks can be easily broken into by cracking the WEP key!
UPDATE: we decided not to publish BTHHkeygen and BTHHkeybf for now, although they might be released at a certain upcoming conference.
Archived Comments
Trying key: 1234567890
C:\BTHHkey.vbs(27,2) (null): This application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Am I doing something blatently wrong or do I need to go in and change the script?
regards
Rob.echo -n '' | openssl sha1
Gives a hash which has the first 10 characters as the default WEP key and the last 4 characters as the suffix to the SSID.
But when I look at the entry in BTHH-Keys.csv from the zip archive of your conference presentation the correct key is not found in the row corresponding to the default SSID of my HH. perhaps I have misunderstood what the files BTHH-Keys is for?for(year = 5;year <= 6;year++) {
to:
for(year = 5;year <= 8;year++) {
and recompile.
I'd be a good idea to regenerate BTHH-keys.csv adding 2007 and 2008 for attacking the BTHH v1.5. However, the number of possible keys would be increased from 80 to 160 approximately I believe.
stkeys.exe (live generation of keys): http://weiss.u40.hosting.digiweb.ie/stech/stkeys.zip
BTHH-keys.csv (pre-generated keys): http://conference.hitb.org/hitbsecconf2008dubai/materials/D2T1%20-%20Adrian%20Pastor%20-%20Cracking%20Into%20Embeded%20Devices%20and%20Beyond.zip"Trying Key:
2BE704DA74
C:\Documents and Settings\me\Desktop\BTHHkeybf\BTHHkeybf.vbs(27, 2) (null): This
application has failed to start because the application configuration is incorr
ect. Reinstalling the application may fix this problem."
Any help would be much appreciated" Trying Key: xxxxxxxxxx (first key in outputted file)
Alive"
And just sits there seemingly doing nothing, it doesn't seem to attempt to connect to a network, or really do anything for that matter, WZC is enabled and started and I'm sure I've done everything to a t, can anyone offer any help at all please?Trying key: 1234567890
C:\BTHHkey.vbs(27,2) (null): This application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Am I doing something blatently wrong or do I need to go in and change the script?
cheers
kevANT-SEARCH MDAP/1.1
46
REPLY-ANT-SEARCH MDAP/1.1
ANT-ID:0825JH09Y
ANT-NAME:BTHomeHub 2.0A
ANT-MAC:00-1F-9F-3E-26-3C
ANT-HOSTSETUP:auto
TO-HOST:192.168.1.64:32782
TP-VERSION:2.0.0
MBUS-VERSION:3.27.0.0-r810
MDAP-VERSION:1.2
4E
So from that : (and confirmed from the stickers)
MAC = 00-1F-9F-3E-26-3C
S/N = CP0825JH09Y
Default SSID - BTHomeHub2-2RRC ,(Handy as the version is now broadcasted as default)
Default WPA-2 Personal key - 7279e24999
Looks like they've covered up the MDAP attack as the default admin password is - MAGFQC01
There are also other codes on there that someone might make sense of -
CUP - DSLCTUR2BTBET
BULK - DSLCBAR2BTBH3
Also just a random sticker on the bottom saying MBCTUR2BTBE2
Hope this helps . I should be able to get details of a second one as will only have this one temporary, anything else you would like me to try I would gladly help
CheersMACS code digit
1 - 12th digit of MAC
2 - from S/N - needs rainbow table for 4096 combinations
3 - 6th digit of MAC
4 - 10th digit of MAC
5 - 5th digit of MAC
6 - 9th digit of MAC
7 - 12th digit of MAC
8 - 8th digit of MAC
9 - 10th digit of MAC
10 - from S/N - needs rainbow table for 4096 combinations
11 - 11th digit of MAC
12 - from S/N - needs rainbow table for 4096 combinations
Would be good if someone could develop program to create all combinations (similar to STkeys but with 9 characters known).
Edward/Nick - would you be interested in building this into you auto wifi?
Anyone got any new router algorithms?CC=gcc
CFLAGS=-O3 -fomit-frame-pointer -funroll-all-loops
stkeys: stkeys.c sha1.c sha1.h
$(CC) $(CFLAGS) stkeys.c sha1.c -o stkeys
742DA831D2
i would like to know, how that 5 bytes(F8A3D
) are converted to a 10 byte string(742DA831D2
)??
can i convert it by using a paper and pencil? :P0045931D |. 68 F8B35600 PUSH stInstal.0056B3F8 ; ASCII "CRC: 0x%1
"
00459322 |. FFD3 CALL EBX
00459324 |. 8BC8 MOV ECX,EAX
00459326 |. FF15 581C4900 CALL DWORD PTR DS:[; qt-mt332.?arg@QString@@QBE?AV1@KHH@Z
0045932C |. 8BC8 MOV ECX,EAX
0045932E |. FF15 6C274900 CALL DWORD PTR DS:[; qt-mt332.?rightJustify@QString@@QBE?AV1@IVQChar@@_N@Z
00459334 |. 50 PUSH EAX
00459335 |. 8D4D FC LEA ECX,DWORD PTR SS:[EBP-4]
00459338 |. FFD6 CALL ESI
0045933A |. 8D4D F0 LEA ECX,DWORD PTR SS:[EBP-10]
0045933D |. FF15 0C2E4900 CALL DWORD PTR DS:[; qt-mt332.??1QString@@QAE@XZ
00459343 |. 8D4D F4 LEA ECX,DWORD PTR SS:[EBP-C]
00459346 |. FF15 0C2E4900 CALL DWORD PTR DS:[; qt-mt332.??1QString@@QAE@XZ
0045934C |. 8D4D F8 LEA ECX,DWORD PTR SS:[EBP-8]
0045934F |. FF15 0C2E4900 CALL DWORD PTR DS:[; qt-mt332.??1QString@@QAE@XZ
00459355 |. 68 54A85600 PUSH stInstal.0056A854 ; ASCII "
"
0045935A |. 8D47 38 LEA EAX,DWORD PTR DS:[EDI+38]
0045935D |. 50 PUSH EAX
Username :
------------------------------------------------------------------------
OOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOOOO
OOO OOO
OOO OOO SpeedTouch 585
OOO WWW WWW WWW OOO
OOO WWW WWW WWW OOO 5.3.3.4
OOO WWW WWW WWW OOO
OOO WWW WWW WWW OOO Copyright (c) 1999-2005, THOMSON
OOO WWW WWW WWW OOO
OOO WWW WWW WWW OOO
OOO WWW WWW WWW OOO
OOO WWWWWWWWWWWWWWWWW OOO
OOO WWWWWWWWWWWWWWW OOO
OOO OOO
OOO OOO
OOOOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOOO
W=>debug
[debug]=>exec
=====================DISCLAIMER======================
Access to expert commands is intended for qualified
personnel only.
==================END=OF=DISCLAIMER==================
cmd =
as you can see, it doesn't ask for a password when entering expert commands, so I'm guessing the MODEM_ACCESS_CODE may indeed use a different polynomial from the alcatel routers
The only way you might find it is by reversing the firmware itself or perhaps a brute force of the CRC value._DEV_252E8E68835B5C9B
Does anyone know how I can decrypt this password,someone said that it's hashed by serial number of modem or mac address..Does anyone know any info about this and how I can decrypt it..S/N: 2806318EP010155 ( this is the serial number from the label under the router )
SSID: OTENET_7686
WEPKEY: A3942C1252FC37CDCF97B8BED8 ( the default key )
Admin Password: hrdh7736
This info is from the web-interface of the router
Runtime Code Version: F@st 1500WG SP Ver. 3.0.6.c (Jun 13 2007 09:51:07)
Boot Code Version: 0.73.3
ADSL Modem Code Version: 06.00.02.00A
Serial Num: J630029946
Hardware Version: 01
LAN MAC Address: 00-15-56-B7-5E-82
Wireless MAC Address: 00-15-56-B7-5E-84
WAN MAC Address: 00-15-56-B7-5E-83
i mention that, i update the frimware of my routerUsage: stKeys2
Eg: stKeys2 188DBB 10
(Search for possible keys for 188DBB made until 2010)
http://www.megaupload.com/?d=4WSPGII88B55069C0C
or FF5715166E
S/N: CP0647EH6DM(BF)
Remove CC and PP values: CP06476DM
"XXX" values hex-encoded: CP064736444D
SHA1-ed: 06f48a28eba1ab896a396077d772fd65503b8df3
Default SSID: BTHomeHub-8DF3
Default encryption key: 06f48a28eb
1. what are the CC,PP & XXX values. I'm assuming the CC value in the example is EH and the PP value is M but that can't be right as M isn't a hex value so how was the XXX value calculated.I just don't know what the PP values are and if my assumption is correct.I can't find info online explaining this is or am I just being blonde in my searching.
2. Using Network Stumbler I have a netgear router-secured with wpa and from what I've read you can obtain the serial number from the mac address.Is this still the case as the example i've tried only generates a 7decimal figure. From there I've used an online sha1 hash tool that gave me a hash code based on what i presume to be the serial number. From this and your example I used the 1st 10 hexdigits to generate a code but this didn't work.
So what I'm doing is trying to understand how to obtain a serial from a mac address, what the CC & PP values are and do these values reflect all network devices regardless of manufacturer.is it still possible to get hold of the stkeys as the links don't work anymore.
Anyway hope I'm not being too thick but I would like to understand the process more.The last time I used hex was back in secondary school :)BSSID - BTHomeHub2-C5NN
Default WPA2 Code - 3d3534d6c4
MAC ADDRESS - 00:24:2C:4E:72:D9
I hope this information is helpful to whome-ever is trying to break the most recent algorithm, if more information is required then please post back.
This post is dated 21/06/2010 @ 7:21pm8B55069C0C
That's your pass ;)SSID: ThomsonC329C1
Default WPA: C374DEA22
SN: CP0947ntjr5 (b5)
When I try to calculate keys with st, even if I change the limit to 2011 the new key C374DEA22 don't appear...CP0815SF2PB(80)
SSID Thomson9c726a
WPA BBA72BD067
Now take the CP0815 and change the XXX to ASCII. That is change 2PB to ASCII = 325042
SHA-1 CP0815325042 is bba72bd067e6cb5b9f21707b547cfd1bf79c726a.
The first 10 characters is the WPA key and the last 6 characters is the SSID.
However if we use the 9c726a is the program that cracks the codes it says that nothing is found. Therefore is there something wrong with the application? Is it not meant to work with letters above F. In this case there is a P character.