Trustwave SpiderLabs Security Advisory TWSL2017-007: Undocumented Backdoor Account in DBLTek GoIP Published: 03/02/2017 Version: 1.0 Product: GSM over IP Gateway (GoIP-8) Version affected: All Product description: The DBLTek GoIP provides an interface between VoIP and GSM based telephony. It is possible to route inbound GSM lines to a VoIP system, and to place outbound calls via the built in GSM modems within the GoIP gateway. The GoIP gateway uses the standard SIP protocol to communicate over IP with a variety of different telephony systems. The GoIP device itself runs an embedded Linux operating system, and provides a web based interface for device management and a Telnet based CLI for status monitoring. Finding 1: Manufacturer backdoor account with flawed challenge-response authentication scheme Credit: John Anderson & Neil Kettle of Trustwave The Telnet interface of the GoIP is documented as providing information for users of the device through the use of logins "ctlcmd" and "limitsh". Both of these logins provide limited information about the device, and are accessed using the user-configured administrator password. An additional undocumented user "dbladm" is present which provides root level shell access on the device. Instead of a traditional password, this account is protected by a proprietary challenge-response authentication scheme. Upon attempting to authenticate as "dbladm" via Telnet, the user will be issued a challenge of the form: "N", and the correct response is required in order for authentication to succeed. This authentication scheme works by challenging the user with a randomly generated number, and authentication is performed by expecting the user to perform a fixed transformation on the supplied number and supply the result: 1, A fixed value of 20139 is added to the previously generated random number. 2, A value of the original number binary left shifted by 3 is added to the above. The resulting code would be: x = challenge + 20139 + (challenge >> 3); 3, The resulting integer value is formatted as text and written into a 64 byte buffer. The remainder of the 64 bytes are padded with null. 4, An MD5 operation is performed against the 64 byte buffer, producing a 16 byte MD5 hash. 5, The first 6 bytes of the MD5 hash are printed in hex to a new buffer, but are not padded to 2 chars each as is normally performed when displaying an MD5sum. As such, values of 0xF or lower occupy only one character in the output instead of 2. 6, The resulting string is the challenge response which is then compared to whatever input is supplied by the user attempting to authenticate. If the comparison succeeds then a root shell is executed. It is possible to authenticate to the device by computing the response in the same way based on the challenge given via Telnet. The device also includes code to automatically accept challenge responses from a dedicated server, either configured using the "CHAP_SERVER" variable, or defaulting to the address 192.168.2.1 if not explicitly configured. In this mode, the device sends a UDP packet containing the challenge to port 11000 of the CHAP_SERVER and expects the challenge to be immediately sent back. If the correct challenge is received the user connecting via telnet is immediately given a root shell without being prompted. Remediation Steps: There is no offical fix to fully address this vulnerability. To limit exposure, network access to these devices should be limited to authorized personnel through the use of Access Control Lists and proper network segmentation. Revision History: 10/13/2016 - Attempt to contact vendor 11/01/2016 - Attempt to contact vendor 11/14/2016 - Attempt to contact vendor 12/02/2016 - Attempt to contact vendor 12/05/2016 - Finding disclosed to vendor 12/21/2016 - Vendor releases firmware update (GST1610-1.01-58.pkg) 12/28/2016 - Vendor contacted about firmware not fully addressing vulnerability 01/12/2017 - Attempt to recieve update from vendor 01/24/2017 - Attempt to recieve update from vendor 01/27/2017 - Vendor non-responsive for 30 days 03/02/2017 - Advisory published References 1. DBLTek GoIP-8 product page: http://www.dbltek.com/products/goip-8.html About Trustwave: Trustwave is the leading provider of on-demand and subscription-based information security and payment card industry compliance management solutions to businesses and government entities throughout the world. For organizations faced with today's challenging data security and compliance environment, Trustwave provides a unique approach with comprehensive solutions that include its flagship TrustKeeper compliance management software and other proprietary security solutions. Trustwave has helped thousands of organizations--ranging from Fortune 500 businesses and large financial institutions to small and medium-sized retailers--manage compliance and secure their network infrastructure, data communications and critical information assets. Trustwave is headquartered in Chicago with offices throughout North America, South America, Europe, Africa, China and Australia. For more information, visit https://www.trustwave.com About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.