D-Link路由器固件后门,导致内网域名劫持

发表于:2016-09-02 10:40:00 来源:  黑客与极客 阅读数(0人)

0×00  介绍


DI系类产品都是上网行为管理认证路由器,功能比较强大,大多数都是企业在使用,可以根据京东的评论数量来推算销量,受害者至少一万。只有DI系列的系统是使用WAYOS,根据网上的说法是WAYOS的产品和D-Link的产品有很多相似度,可以使用WAYOS系统山寨D-Link产品,DI系统四位数的,国外没有卖,可以肯定受害者都是国内的。


这个后门可以导致某域名被劫持,劫持的域名是可以在远程服务器控制的,有后门的固件:


          DI_7001-15.07.15A1.trx

          DI_7001W-15.07.15A1.trx

          DI_7002-15.07.15A1.trx

          DI_7002W-15.07.15A1.trx

          DI_7008W-14.10.11A1.trx

          DI_7100-15.07.15A1.trx

          DI_7102-14.10.11A1.trx

          DI_7200-15.07.15A1.trx

          DI_8002-14.12.18A1.trx

          DI_8002W-14.12.18A1.trx

          DI_8003-14.12.18A1.trx

          DI_8004W-14.12.18A1.trx

          DI_8005W-15.06.17A1.trx

          DI_8100-15.06.17A1.trx

          DI_8200-15.06.17A1.trx

          DI_8300-15.06.17A1.trx

          DI_8400-15.06.17A1.trx

          DI_8500-15.06.17A1.trx

          DI_8600-15.06.17A1.trx

0×01 发现之旅


以前没有被发现,因为小伙伴大多数都是使用VPN上网,所以这样的劫持起不到作用。


这个是有公司某小伙伴发现的,当打开http://www.ip138.com




查看curl 请求www.ip138.com结果,可以看到整个返回结果都被替换了




使用traceroute, 查看是不是DNS域名解析劫持,www.ip138.com的正确IP是222.245.77.75







看请求www.ip138.com整个流程




异常请求了:


http://diy.szrca.com:7070/adv/202.jsp?uid=DI-8005W_CWMSQ1F5000368&ip=192.168.0.253&mac=6C-0B-XX-XX-25-85&js=0&surl=www.ip138.com/


http://union.iphonediy.com:8282/vv.zz?type=210&uid=DI-8005W_CWMSQ1F5000368&ip=192.168.0.253&mac=6C-0B-XX-XX-25-85




uid : 是路由器固件版本, ip : 是本机IP, mac : 是MAC 地址


surl : 被劫持的域名


http://sh.edhlw.com/img/hkx28i跳转到目的地页面




通过以上可以断定是路由器出来问题,因为连我的路由器版本都知道,一定是固件安装了后门,于是去官方下载固件来分析。


0×02 下载D-Link固件


官方下载DI-8500W固件




右键复制下载地址:http://support.dlink.com.cn/download.ashx?file=509




可以看到file都是数字,很有规律,那样我们就可以分段批量下载所有固件:


wgethttp://support.dlink.com.cn/download.ashx?file={1..700}




下载所有固件是为了找到没有后门的旧版本固件,结果每个系列只有一个版本,令我太失望了。




所有固件度娘:http://pan.baidu.com/s/1i5wLO8H    密码3xpm


0×03 分析DI-8500W固件


使用binwalk 解压固件: binwalk -eM DI_8005W-15.06.17A1.trx




提取字符 : strings * > strings.txt




根据之前提到的,有很多关键字可以用来搜索,比如surl:


http://diy.szrca.com:7070/adv/202.jsp?uid=DI-8005W_CWMSQ1F5000368&ip=192.168.0.253&mac=6C-0B-XX-XX-25-85&js=0&surl=www.ip138.com/




至于要分析劫持原理,有几种劫持,可以下载度娘:http://pan.baidu.com/s/1i5wLO8H 密码3xpm 里的文件D-Link-firmwares/trx/binwalk_extracted_trx_all.tar.gz 把 nvram 拖进 IDA 分析,或者建一个 Qemu MIPS 虚拟机运行试试。


0×04 幕后黑手:承希广告联盟? WAYOS ?D-Link ?


相关域名:


http://diy.szrca.com:7070     ip: 119.97.180.242

       http://union.iphonediy.com:8282    ip: 119.97.180.242

       http://union.51cy.org     ip: 42.96.190.205

       http://union.116wz.com     

http://sh.edhlw.com     ip:119.147.249.218

右键查看源码 http://diy.szrca.com:7070




WAYOS信息




Whois信息 :whois szrca.com


                 DomainName: szrca.com

                 Registry Domain ID:2041192643_DOMAIN_COM-VRSN

                 Registrar WHOIS Server:whois.maff.com

                 Registrar URL:http://www.maff.com

                 Updated Date:2016-07-09T10:42:48Z

                 Creation Date:2016-07-09T02:51:36Z

                 Registrar RegistrationExpiration Date: 2017-07-09T02:51:36Z

                 Registrar: Flappy Domain, Inc

                 Registrar IANA ID: 1872

                 Registrar Abuse Contact Email:abuse@maff.com

                 Registrar Abuse Contact Phone:+86.5925990220

                 Domain Status:clientTransferProhibited https://icann.org/epp#clientTransferProhibited

                 Registry Registrant ID:

                 Registrant Name: wenben zhou

                 Registrant Street: yuehualu11hao

                 Registrant City: xiamen

                 Registrant State/Province:fujian

                 Registrant Postal Code: 366155

                 Registrant Country: China

                 Registrant Phone: +86.13566778899

                 Registrant Phone Ext:

                 Registrant Fax:

                 Registrant Fax Ext:

                 Registrant Email: dt0598@outlook.com

                 Registry Admin ID:

                 Admin Name: wenben zhou

                 Admin Street: yuehualu11hao

                 Admin City: xiamen

                 Admin State/Province: fujian

                 Admin Postal Code: 366155

                 Admin Country: China

                 Admin Phone: +86.13566778899

                 Admin Phone Ext:

                 Admin Fax:

                 Admin Fax Ext:

                 Admin Email: dt0598@outlook.com

                 Registry Tech ID:

                 Tech Name: wenben zhou

                 Tech Street: yuehualu11hao

                 Tech City: xiamen

                 Tech State/Province: fujian

                 Tech Postal Code: 366155

                 Tech Country: China

                 Tech Phone: +86.13566778899

                 Tech Phone Ext:

                 Tech Fax:

                 Tech Fax Ext:

                 Tech Email: dt0598@outlook.com

                 Name Server: F1G1NS1.DNSPOD.NET

                 Name Server: F1G1NS2.DNSPOD.NET

                 DNSSEC: Unsigned

                 URL of the ICANN WHOIS Data ProblemReporting System: http://wdprs.internic.net/

                 >>> Last update ofWHOIS database: 2016-08-25T16:25:48Z <<<

Whois信息 : whois iphonediy.com


                 DomainName: iphonediy.com

                 Registry Domain ID: 76254

                 Registrar WHOIS Server:whois.oray.com

                 Registrar URL:http://www.oray.com

                 Updated Date:2015-11-27T00:16:37Z

                 Creation Date:2014-03-31T17:21:57Z

                 Registrar RegistrationExpiration Date: 2017-03-31T17:21:57Z

                 Registrar: SHANGHAI BEST ORAYINFORMATION S&T CO., LTD.

                 Registrar IANA ID: 1518

                 Registrar Abuse Contact Email:ken@oray.com

                 Registrar Abuse Contact Phone:+86.2062219000

                 Reseller: www.oray.com

                 Domain Status:clientTransferProhibited,clientDeleteProhibited

                 Registry Registrant ID:shbr-7dg4g676722

                 Registrant Name: tony fu

                 Registrant Organization: tony

                 Registrant Street:xiongchudadao

                 Registrant City: wuhan

                 Registrant State/Province:hubei

                 Registrant Postal Code: 430079

                 Registrant Country: CN

                 Registrant Phone:+86.15819829012

                 Registrant Phone Ext:

                 Registrant Fax: +86.27878671020

                 Registrant Fax Ext:

                 Registrant Email:87829128@qq.com

                 Registry Admin ID:shbr-7dg4g674146

                 Admin Name: tony fu

                 Admin Organization: tony

                 Admin Street: xiongchudadao

                 Admin City: wuhan

                 Admin State/Province: hubei

                 Admin Postal Code: 430079

                 Admin Country: CN

                 Admin Phone: +86.15819829012

                 Admin Phone Ext:

                 Admin Fax: +86.27878671020

                 Admin Fax Ext:

                 Admin Email: 87829128@qq.com

                 Registry Tech ID: shbr-7dg4g674146

                 Tech Name: tony

                 Tech Organization: tony

                 Tech Street: xiongchudadao

                 Tech City: wuhan

                 Tech State/Province: hubei

                 Tech Postal Code: 430079

                 Tech Country: CN

                 Tech Phone: +86.15819829012

                 Tech Phone Ext:

                 Tech Fax: +86.27878671020

                 Tech Fax Ext:

                 Tech Email: 87829128@qq.com

                 Name Server:ns1.oray.net,ns2.oray.net

                 DNSSEC: unsigned

类似作者信息:







我就不妄下评论了


0×05 威胁评估


导致DNS 劫持,挂马,钓鱼,钱包空空,敏感信息泄露,账号和密码泄露……


0×06 解决方法


有条件的可以换一个设备,或者使用防火墙禁止diy.szrca.com ,*.szrca.com , *.wayos.net , union.51cy.org, *.51cy.org, *.wayos.cn,*.wayos.net , *.wayos[1-10].cn , union.iphonediy.com ,*.iphonediy.com,*.wayos.com ,sh.edhlw.com,*.edhlw.com


0×07 总结


毕竟时间有限,还有别的事情要做,哪里没有不专业的地方,请多多包涵,我已经提交某漏洞平台,有疑问的或有建议的可以发我邮件:


现在社会风气不太好,某某厂商,都无底线的做黑灰厂……开玩笑,哈哈


相关新闻

大家都在学

课程详情

网络攻击与对抗

课程详情

网络攻防工具

课程详情

信息安全基础