⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1430.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
int unhide_process(pid_t pid)<br>
int strip_invisible() //使process不被get_pid_list()发现(从proc里移除process么?我也没弄明白,对这个不熟)<br>
int unstrip_invisible()<br>
int n_getdents(unsigned int fd, struct dirent *dirp, unsigned int count) //隐藏文件<br>
int n_fork(struct pt_regs regs) //完成递归隐藏文件<br>
int n_clone(struct pt_regs regs)<br>
int n_kill(pid_t pid, int sig) //接收signal,和外部的接口<br>
int n_write(unsigned int fd, char *buf, size_t count) //对netstat隐藏相关服务<br>
int n_setuid(uid_t uid) //提升用户权限<br>
<br>
ava是adore的外部接口:<br>
...<br>
printf("Usage: %s {h,u,r,R,i,v,U} [file, PID or dummy (for U)]"<br>
" h hide file"<br>
" u unhide file"<br>
" r execute as root"<br>
" R remove PID forever"<br>
" U uninstall adore"<br>
" i make PID invisible"<br>
" v make PID visible", argv[0]);<br>
...<br>
<br>
很明显,不用解释了。<br>
<br>
modhide完成隐藏adore的工作。<br>
<br>
下边是/bin/kload:<br>
--------------start-------------------<br>
#!/bin/sh<br>
# Kkit by r41n (c) 2000<br>
PATH=...<br>
RKPATH=/usr/lib/.rain<br>
<br>
# c0r3 load<br>
¥RKPATH/bot/c0r3/c0r3<br>
<br>
# sshd start<br>
cd ¥RKPATH/ssh<br>
./sshdx -q &&gt;/dev/null<br>
<br>
# psybnc start<br>
#cd ¥RKPATH/proxy/psybnc<br>
#./psybncx &&gt;/dev/null<br>
<br>
# emech start<br>
cd ¥RKPATH/bot/emech<br>
./mechx &&gt;/dev/null<br>
#killall -31 mechx &&gt;/dev/null<br>
<br>
cd /<br>
<br>
# hide`em<br>
#killall -31 sshdx &&gt;/dev/null<br>
#killall -31 c0r3 &&gt;/dev/null<br>
----------end---------------------<br>
<br>
从中可见,cracker起了一个sshd后门(就是这个dameon把前边所说的113端口占用了),并起了一个irc的客户端mechx(干什么?不懂),然后隐藏相应的进程。这些苦于没有源码,只能靠猜测了。<br>
<br>
三. 清理(略)<br>
四. 总结<br>
一次典型的llkm攻击。<br>
1. 给我等被害人的:<br>
(1) 系统一定要及时打补丁,这次遇上的是一个用llkm的cracker,如果运气不好,遇上一个替换系统函数库的(这个俺也不懂,谁有问题问lg_wu去,*_^),那就惨死了。<br>
(2) 装完系统最好先对关键文件做个备份并做md5sum,以后怀疑出问题时拿这些对照,可以很容易找到入侵点。例如写这么一个简单的shell脚本,完了把那些文件放到安全的地方:<br>
<br>
----------start-----------------<br>
#!/bin/bash<br>
echo "###########################################################"<br>
echo "## This is only an idea,you can do whatever you want! ##"<br>
echo "## by liz ##"<br>
echo "## 08/18/2001 ##"<br>
echo "###########################################################"<br>
<br>
FILE=/tmp/back/md5.txt<br>
<br>
cd /tmp<br>
rm -rf back<br>
mkdir back<br>
<br>
cd back<br>
<br>
find / -type f ( -perm -04000 -o -perm -02000 ) -print &gt;& syssuid1<br>
cat syssuid1 │ grep -v "find:" &gt; syssuid<br>
<br>
cp /etc/inetd.conf .<br>
cp /etc/services .<br>
cp /bin/login .<br>
cp /etc/passwd .<br>
cp /etc/shadow .<br>
<br>
strings /bin/login &gt; strlogin<br>
<br>
#md5 myself<br>
/usr/bin/md5sum /usr/bin/md5sum &gt; ¥FILE<br>
/usr/bin/md5sum /usr/bin/find &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /usr/bin/pwd &gt;&gt; ¥FILE<br>
<br>
#md5 files when sys init need<br>
/usr/bin/md5sum /etc/lilo.conf &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /etc/inittab &gt;&gt; ¥FILE<br>
cd /etc/rc.d<br>
/usr/bin/md5sum `find `pwd` -type f` &gt;&gt; ¥FILE<br>
cd -<br>
<br>
#md5 files which seem important<br>
/usr/bin/md5sum /bin/login &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /bin/ps &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /bin/netstat &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /bin/ls &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /bin/su &gt;&gt; ¥FILE<br>
<br>
#md5 some conf files<br>
/usr/bin/md5sum /etc/resolv.conf &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /etc/passwd &gt;&gt; ¥FILE<br>
/usr/bin/md5sum /etc/services &gt;&gt; ¥FILE<br>
<br>
#/usr/bin/md5sum /etc/inetd.conf &gt;&gt; ¥FILE<br>
<br>
cd ..<br>
tar zcvf back.tar.gz back/<br>
rm -rf back<br>
----------end-------------------<br>
<br>
将来直接做对照就可以啦(愿意的话你再写个对照的脚本)。<br>
<br>
2.给cracker的:<br>
(1) 不要随便改对方机器的配置,会很容易被抓到!<br>
(2) log一定要清理干净,不要相信那些所谓的工具,还是把工具源码找来自己改合适最好<br>
<br>
3.疑问<br>
(1) 在分析cracker程序的过程中发现一个问题:<br>
adore.c中:<br>
只看到了系统调用的定义(仅仅是定义而已,没有内容):<br>
<br>
int (*o_getdents)(unsigned int, struct dirent *, unsigned int);<br>
int (*o_kill)(int, int);<br>
int (*o_write)(unsigned int, char *, size_t);<br>
int (*o_fork)(struct pt_regs);<br>
int (*o_clone)(struct pt_regs);<br>
int (*o_setuid)(uid_t);<br>
int (*o_symlink)(const char *, const char*);<br>
<br>
和使用:<br>
<br>
REPLACE(write);<br>
REPLACE(getdents);<br>
REPLACE(kill);<br>
REPLACE(fork);<br>
REPLACE(clone);<br>
REPLACE(setuid);<br>
<br>
它们具体是怎么实现的,程序里却没有,adore.c也没有自定义的include,难道说...系统函数库已经被替换掉了?<br>
(2)cracker为什么要起一个irc?这个好像在很多情况下都存在,是cracker的惯例,还是一种隐秘的通信方式?<br>
(3)kload里起的那几个程序<br>
¥RKPATH/bot/c0r3/c0r3<br>
./sshdx -q<br>
./mechx<br>
之间的关系还没有弄明白,似乎不是sshdx是sshd后台进程、mechx是irc客户端那么简单。<br>
<br>
关于《一次入侵检查》<br>
原创:liz0(liz)<br>
<br>
由于时间仓促,再加上水平有限,文中出现了几个大的纰漏,因为只是贴在论坛上,也没再管,忽然发现这篇报告被转载了,顿觉有些问题如不纠正,实在是贻害朋友们,所以写了封信给转载的inburst&lt;inburst@263.net&gt;,主要是以下内容,不知什么原因没有回复,所以赶快post来,希望xfocus的朋友们能把这篇补在原文后边,不至于误导读者和被大虾们骂,:)<br>
<br>
一个是对所发现的rootkit的猜测。我看到源码中有几个knark字样,便想当然的想它是knark,后来经朋友提醒知道这个并不是knark,而是adore,后经我对照源码,果然是adore,我的猜想是错误的。<br>
adore主页见:http://www.team-teso.net/<br>
<br>
另一个问题是我在文章最后的疑问,关于几个系统调用实现的问题,则纯属我一时昏了头,没有分析好源码所致:<br>
程序中定义了一个宏REPLACE:<br>
#define REPLACE(x) o_##x = sys_call_table[SYS_##x];<br>
sys_call_table[SYS_##x] = n_##x<br>
它显然是把o_##x(原系统调用)替换为n_##x,即我在原文中上边分析的几个函数,可惜我只看了函数实现,没有注意这个宏,实在是个低级的错误。<br>
<br>
关于程序源码,由于惯例我没有贴出来,不过源码实际上可以去adore网站down,免得看文章时一头雾水。<br>
<br>
还有几个我的命令写法,有几个地方太过麻烦,有些已经有网友纠正,有些是我后来发现:<br>
/usr/bin/md5sum `find `pwd` -type f` &gt;&gt; ¥FILE<br>
可以写成:<br>
find ./ -type f -exec /usr/bin/md5sum {} &gt;&gt; ¥FILE ;<br>
似乎更容易理解一些。<br>
<br>
find / -type f ( -perm -04000 -o -perm -02000 ) -print &gt;& syssuid1<br>
cat syssuid1 │ grep -v "find:" &gt; syssuid<br>
可以写成<br>
find / -type f ( -perm -04000 -o -perm -02000 ) -print 1&gt;syssuid 3&gt;/dev/null<br>
<br>
另有strings wtmp我是习惯了用strings,不必老用这个东西的,last就可以了(实在是常识的东西,又是该死)<br>
<br>
还有一个我在文章中怀疑入侵者是那个拨号用户,后来经我跟踪发现,似乎也不太象,我后来跟踪的结果入侵者一直来自于台湾,而那个拨号用户似乎不是台湾的(没有太详细IP地址分配数据库,没法作结论),当然那人是不是台湾的,也不能肯定(后来没什么时间,就没再跟踪下去了) <br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -