记录黑客技术中优秀的内容, 传播黑客文化,分享黑客技术精华

TP-Link后门的详细信息(More information about TP-Link backdoor)

2013-03-14 16:05

During the analysis of this TP-Link backdoor, I found other issues, which can be handy when analyzing other devices. Finally the following path leads to remote root exec (useful for debugging purposes). Let’s see.

The router allows for ftp connections. But the ftp session is somehow chrooted (ie. one can access only ftp root and USB shared directories):

More information about TP-Link backdoor

Standard ftp connection

Let’s try a little trick now. After plugging a USB flash drive into the router we can share a folder from the USB to be available on FTP:

More information about TP-Link backdoor

Folder sharing

By clicking ‘Save’ I issue an HTTP request, which I can intercept in local http proxy, and modify it like this (ie. path traversal):

More information about TP-Link backdoor

path traversal

After this I can traverse all the filesystem – also in write mode:

More information about TP-Link backdoor

Path traversal – ftp

But how can I have interactive root-shell? OK, after searching /tmp directory, there is /tmp/samba/smb.conf which can be overwritten. Brief analysis of samba documentation shows many ways of executing external binary. For example:

root preexec (S)

This is the same as the preexec parameter except that the command is run as root. This is useful for mounting filesystems (such as CDROMs) when a connection is opened.

As you can see, this option (root preexec) apart from CDROM mounting can be used to debug routers After modification the config looks like this:

More information about TP-Link backdoor

Modified smb.conf

/tmp/szel is just a netcat binary (compiled for MIPS architecture) and uploaded by ftp (see the earlier path traversal trick). Now we can try out remote root shell:

More information about TP-Link backdoor

remote root

Interactive root is nice, but how can it help with locating issues like this? OK, let’s search httpd binary for strings (httpd can be downloaded from the router – for example – using ftp):

More information about TP-Link backdoor

Here we can see start_art.html string mentioned in the original disclosure. But how does it work? Let’s check what is going on on the router when start_art.html is launched:

More information about TP-Link backdoor

Now it’s clear – 192.168.0.100 is my IP address and nart.out is 777 chmoded and then executed…

来自:http://sekurak.pl/more-information-about-tp-link-backdoor/

知识来源: lcx.cc/?i=3370

阅读:141391 | 评论:0 | 标签:无

想收藏或者和大家分享这篇好文章→复制链接地址

“TP-Link后门的详细信息(More information about TP-Link backdoor)”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

关注公众号hackdig,学习最新黑客技术

推广

工具

标签云