TL;DR straight to the ridiculously easy hack
Recently we upgraded our phone system, BT supplied us with some shiny Yealink T48G phones.
These support 16 SIP accounts and I wanted to add my own personal account as I was going to be using my phone for working from home and it made sense to use just one phone and to get rid of my Obi device.
The first thing I did when getting the phone was to go to the webpage and try logging in, I tried the normal admin username password combination but it didn’t work, a quick search told me that once the phones had been ‘auto-provisioned’ for BT, the ‘user’ username and password was user/password. This allowed me to log in, but ideally I wanted the admin password, even without that though I was able to gather enough detail to perform a factory reset on the phone and manually configure the BT Voice settings.. However somethings didn’t work quite as before, for example the Busy Light List didn’t display and I didn’t know what URI I should set.
So i set the network port to span mode and fired up Wireshark and started a phone up, I thought as they contacted BT for configuration, maybe they would transmit the admin password in cleartext or at the very least a config file.. no such luck, but I did get the auto-provision url, this meant that I could now reset a phone to factory settings and I would be able to set it to automatically configure itself again.. (I suppose I could have asked BT for this information but oh well). Thinking by doing this there was more chance the admin password or config file would be transmitted and I’d be able to listen, again no luck, the traffic was encrypted.
The next thing I did was to set the log level to 6 (Maximum) on the webpage and then and then exported the log after a boot, this gave me some details for example the Busy Light URI but I wanted more.. I tried to ‘provision’ the phone while changing the admin password..Nope, ‘provisioning’ while exporting the log file every few seconds.. Nope.. Running out of ideas I right clicked the phones webpage and selected ‘View source’ maybe I’d see something like a secret link to enable telnet.. Nope…
Viweing the source, I did however notice the following lines
if(identity == “admin”)
level = 2;
else if(identity == “var”)
level = 1;
level = 0;
This seemed very strange, like the webpage was just saying, what is your username? if it’s ‘admin’ I’ll give you access to everything.. so I started the Chrome console, [Shift] [CTRL] + ‘J’, clicked ‘Sources’ selected the ‘Serverlet’ and added a breakpoint at line 313, refreshing the page this then let me change ‘identity’ variable from ‘user’ to ‘admin’ and boom, full access, even allows me to change the settings.. I said it was a ridiculously easy..
Having tried a few complicated ways to get details of the phone settings (nothing too bad), I was thinking of other ways to get in, maybe spoofing a certificate and performing a MitM attack, maybe downloading the firmware and looking for exploits or backdoors, even social engineering and phoning BT saying I was a new engineer and had forgotten the ‘Admin’ password 🙂
I thought I’d try the obvious and view the source.. Anyway, long story short… my conclusion is that I should always try the easy ways first.. (And Yealink should be embarrassed how easy it is to get admin privileges on their phone)
The latest firmware appears to address this security issue, in as such that they’ve not made it so obvious, however the webpage still restricts items depending on what user/level you are, so you can get it to display,change and save all items even if you are logged in as a normal user.
The following shows an example with the latest firmare that BT are currently using (18.104.22.168).
First if I log in with the stand user/password account I see the following when I go to settings.
not a lot to choose there, I then bring up the “Developer Tools” in Chrome and go to ‘Sources’ and then double click ‘Severlet’ and search for level
You can see above that they are still restricting things by what level you are, so I set a breakpoint on line 431 (Newer firmware works the same just the line numbers change). I then refresh the page and have to keep pressing ‘F8’ till I get to the settings I want. The first few breaks show in the local variable, a level and a node, so the following
means the Dial Plan page will be hidden, unless I change the 2 to a 0 and continue. anyway after pressing ‘f8’ a few more times I then get to the setting for the page I’m on.
This one says that the option to export the config is hidden, so I change the level from 2 to 0 and as I no longer want to change any other settings i remove the break point and press ‘F8’ again, this then give me the following webpage.
You can see both the Dial Plan and the option to export the config are now available to me.
A side note, Yealink have now made it so the Service Provider can link the MAC address of your phone to their configuration, so if you upgrade your firmware or change some settings they don’t want you to, the next time the phone restarts it will downgrade the firmware to the version the service provider wants to use. To get round this I just created a static route on my router for 22.214.171.124 and set the gateway to 10.0.0.1 (Just a random local address I’m not using), this prevents the phone contacting the Yealink service.