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

📄 1498.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 2 页
字号:
                              border=0>
                                <TBODY>
                                <TR>
                                      <TD vAlign=top> 
<p><FONT class=normalfont><B><font color=blue>在linux下配置socks5代理</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br>    简介: <br>
<br>
    在linux下有各种各样的代理程序可用,象最常用的Squid,是http/https代理,也能代理ftp请求,但它实际上 是个HTTP代理程序,不是ftp代理,但它能处理ftp代理请求,就象浏览器处理ftp请求一样的方法工作,有些 程序只能设置成使用socks代理,象CuteFTP;还有象Wu-FTP只能设置成使用ftp代理(这里的ftp代理是标准的 ftp代理,不是Squid所支持的那种方式);ICQ 2000能同时接受https代理和Socks代理;NetVampire能接受标准 的HTTP(GET/POST)代理(被Squid支持),和HTTP(CONNECT)代理(也被Squid支持)。 <br>
<br>
    为了使用Cute-FTP,除了IP伪装的方法外,就要使用Socks代理,现在让我们来看看配置Socks5的过程:<br>
<br>
    1. 下载文件<br>
<br>
    从www.socks.nec.com下载最新版的socks5源文件到/tmp目录下。<br>
    socks5-v1.0r11.tgz <br>
<br>
    2. 在防火墙上编译并安装(该防火墙应直接连至internet,是安装了两块网卡的双宿主机,假设内部网段为 192.168.0.0/24)<br>
<br>
    cd /tmp <br>
    tar -xvfz socks5-v1.0r11.tgz <br>
<br>
    cd /tmp/socks5-v1.0r11 <br>
    ./configure --with-threads <br>
    make <br>
    make install <br>
<br>
    3. 配置文件<br>
<br>
    /etc/socks5.conf <br>
    # /etc/socks5.conf <br>
    set SOCKS5_MAXCHILD 3 <br>
    set SOCKS5_NOIDENT <br>
    set SOCKS5_TIMEOUT 5<br>
<br>
    interface 192.168.0. - eth1 <br>
    auth 192.168.0. - u <br>
    permit u - 192.168.0. - - - jephe <br>
    permit u - 192.168.0. - - - jack <br>
    deny - - - - - - - <br>
<br>
    4. 配置文件/etc/socks5.passwd<br>
<br>
    # /etc/socks5.passwd <br>
    jephe password_of_jephe_is_here <br>
    jack password_of_jephe_is_here <br>
<br>
    5.开始测试<br>
<br>
    /usr/local/bin/socks5 -f -s <br>
    如果出现下面的信息表示测试成功。 <br>
    18210: Socks5 starting at Mon Dec 14 18:23:45 1998 in normal mode <br>
<br>
    然后退出socks5,开始正式运行它在背景模式: <br>
<br>
    6. 正式运行 <br>
<br>
    /usr/local/bin/socks5 -t -s 2&gt; /var/log/socks5 <br>
<br>
    7. 最后,加到/etc/rc.d/rc.local <br>
<br>
    echo "/usr/local/bin/socks5 -t -s 2&gt; /var/log/socks5" &gt;&gt; /etc/rc.d/rc.local <br>
<br>
    END.  <br>
<br>
<br>
<br>
<br>
<br>
<br>
通过SOCKS5上OICQ隐藏真实IP<br>
<br>
<br>
by Sinbad<br>
Jun 4, 2001<br>
http://sinbad.dhs.org<br>
<br>
<br>
1. 为什么要隐藏IP<br>
<br>
众所周知,现在有很多工具或者补丁都可以查到OICQ在线用户的IP地址,再结合追捕还能知<br>
道该IP所在的地理位置、主机信息等等。我们主要关心的是自己真实IP地址一旦暴露,他人<br>
就可以利用系统的漏洞,来攻击我们的机器。<br>
<br>
1.1 公司专线<br>
<br>
公司里面的专线用户,本机一般都是用的内部IP地址,以192.168开头,通过网关/代理服务<br>
器上网。这种情况下,阻止外部攻击的任务就交给网关了,个人机器相对比较安全。<br>
<br>
1.2 家庭拨号<br>
<br>
家庭用户一旦通过PPP接入Internet,登上OICQ,如果本机设置的不够安全,就很容易受到恶<br>
意用户的攻击。如果能够隐藏真实IP,就可以在上OICQ的同时,保证本机的安全。<br>
<br>
<br>
2. 如何隐藏IP<br>
<br>
本文所讲的办法是通过socks5代理来隐藏IP地址。socks5支持UDP协议的proxy,这点正是OI<br>
CQ所需要的(目前最新版本的OICQ支持HTTP代理,好像仅对付费员开放)。关于socks5协议<br>
与应用层代理、NAT的区别,请参考其他文章,本文主要给出实践的内容。<br>
<br>
<br>
2.1 安装socks5<br>
<br>
我们用一台Red Hat linux机器来作为socks5 server,它具有Internet IP,为A.B.C.D。<br>
<br>
下载:<br>
http://matrix.tesi.dsi.unimi.it/pub/securitytools/socks5-v1.0r11.tar.gz<br>
<br>
解压后进入目录:<br>
./configure --with-threads<br>
make<br>
make install<br>
<br>
启动和停止的命令:<br>
/usr/local/bin/socks5<br>
/usr/local/bin/stopsocks<br>
<br>
如果要开机启动,请修改/etc/rc.d/rc.local。<br>
<br>
<br>
2.2 配置socks5<br>
<br>
策略:<br>
* 允许Internet上任何机器的访问<br>
* 通过user/password来验证<br>
<br>
# vi /etc/socks5.conf<br>
auth    -       -       u<br>
permit  u       -       -       -       -       -       sinbad<br>
interface       -       -       A.B.C.D<br>
<br>
第一行auth,u表示采用/user/password方式认证;<br>
第二行permit,表示允许sinbad用户使用本代理;<br>
第三行interface,A.B.C.D是服务器的外部IP,用实际的取代之。<br>
<br>
<br>
# vi /etc/socks5.passwd<br>
sinbad sinbad<br>
<br>
这是密码文件,每行一个用户,用户名和密码用空格隔开。<br>
本例中用户sinbad的密码是sinbad。<br>
<br>
关于各个配置项的解释请man socks5.conf。<br>
<br>
<br>
2.3 客户端配置<br>
<br>
客户端是你安装了OICQ的机器,要能够直接访问到socks5服务器。<br>
<br>
启动OICQ,主菜单-〉系统参数-〉网络设置,选中“使用PROXY SOCKET5防火墙”,输入服务<br>
器的IP(A.B.C.D)、端口(默认1080端口)、用户名(sinbad)和密码(sinbad),测试成<br>
功后重新启动OICQ,请别人帮你看一下,IP应该为为A.B.C.D,这样就达到隐藏自己真实IP的<br>
目的了!<br>
<br>
<br>
3. 安全问题<br>
<br>
假设我们的服务器以前做过安全配置、打过补丁,是比较安全的。现在增加了一个socks5 p<br>
roxy服务,就要注意了。<br>
<br>
3.1 采用最新的版本<br>
<br>
本文中提到的是v1.0r11版本,我也不确定是否为最新,在http://www.socks.nec.com上没找<br>
到最新的版本号。有个远程溢出exploit(http://www.securiteam.com/exploits/6Q00R0A0<br>
AQ.html),对此版本不起作用。而且我们配置的user/password方式认证,这个exploit在不<br>
知道用户名和密码的情况下是无法成功的。<br>
<br>
<br>
3.2 制定访问控制策略<br>
<br>
如果只有很少人使用这个代理,那么可以加上IP限制。比如我在家通过95963上网,就修改/<br>
etc/socks5.conf中的permit行,加上211.100.这个网段的访问权。<br>
<br>
<br>
4. 参考资料<br>
<br>
http://www.socks.nec.com/<br>
http://www.securiteam.com/exploits/6Q00R0A0AQ.html<br>
http://www.linuxaid.com.cn/engineer/bye2000/doc/socks.htm<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 + -