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

📄 95.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br>
&lt;form id="mainform" name="mainform" method="post"<br>
action="http://61.61.61.61:80/secu/webLogin.jsp"&gt; &lt;input<br>
type="hidden" name="connectname" value=""&gt; &lt;input value="-1"<br>
name="connecttype" type="hidden"&gt; &lt;input value="0" name="consumeright"<br>
type="hidden"&gt; &lt;input value="0" name="separatecard" type="hidden"&gt; &lt;input<br>
value="192.168.000.000" name="localip" type="hidden"&gt; &lt;input value="0"<br>
name="IsIndex" type="hidden"&gt; 用户名:&lt;input name="username"&gt; 密 码:&lt;input<br>
name="password" type="password"&gt; &lt;input name="lianjiewangluo"<br>
type="submit"&gt; &lt;/form&gt;<br>
<br>
<br>
* 用 curl 写的一个脚本:<br>
<br>
#!/bin/bash<br>
/etc/init.d/myiptables start<br>
dhcpcd eth1<br>
<br>
MYIP=`ifconfig eth1|grep inet|sed 's/^ *//'|sed 's/ /:/g'|cut -f3 -d:`<br>
echo $MYIP<br>
UN=88888888<br>
SERVER=61.61.61.61<br>
<br>
curl --trace trace.txt -A 'Mozilla' -d "username=$UN&password=8888&localip=$MYIP&connectname=&connecttype=-1" http://$SERVER/secu/webLogin.jsp<br>
<br>
<br>
说明:curl 是一个用 url 语法传输文件的命令行程序,支持 http,ftp 等协议,类似 wget。<br>
上例中,curl 的命令行参数 -A 指明客户端的类型,这是服务器为了安全,需要指明。Mozilla 或 IE 都可以,我更愿意用 Mozilla。 -d 是必需的,表示用 POST 方法。-d 后的内容就是用户名、密码 IP 地址等信息,根据你的认证页面中 form 的 input 项目填写,内容与其保持一致,参数间用 & 分开。后面是认证页面的地址。执行这个脚本后,返回 200 OK,表示认证成功,否则,仔细检查 -d 后的参数是否正常,地址是否正确。<br>
<br>
* 用 python 写的认证程序:<br>
<br>
#!/usr/bin/env python<br>
import httplib, urllib<br>
<br>
params = urllib.urlencode({'connectname': '',<br>
'connecttype': -1,<br>
'consumeright': 0,<br>
'separatecard': 0,<br>
'localip': '192.168.000.000',<br>
'IsIndex': 0,<br>
'username': 88888888,<br>
'password': 8888})<br>
<br>
headers = {'Accept': 'text/html', 'User-Agent': 'Mozilla',<br>
'Content-Type': 'application/x-www-form-urlencoded'}<br>
<br>
server = '61.61.61.61'<br>
path = '/secu/webLogin.jsp'<br>
<br>
conn = httplib.HTTPConnection(server)<br>
conn.request("POST", path, params, headers)<br>
r1 = conn.getresponse()<br>
print r1.status, r1.reason<br>
data1 = r1.read()<br>
print data1<br>
conn.close()<br>
<br>
产生 keep-alive 包的程序<br>
<br>
#!/usr/bin/env python<br>
import httplib<br>
<br>
def testHttplib(server, path):<br>
req = httplib.HTTP(server)<br>
req.putrequest('GET', path)<br>
req.putheader('Accept', 'text/html')<br>
req.putheader('User-Agent', 'Mozilla')<br>
req.endheaders()<br>
ec, em, h = req.getreply()<br>
fd = req.getfile()<br>
return fd.read(), (ec, em)<br>
<br>
myip = '192.168.000.000'<br>
server = '61.61.61.61'<br>
path = '/ClientProcess.jsp?MsgType=1&ISNNO=1001&LocalIP=' + myip<br>
<br>
# print 'testing "%s%s"' % (server, path)<br>
dataHttplib, result = testHttplib(server, path)<br>
# print "data length (httplib):", len(dataHttplib), result<br>
# print dataHttplib<br>
<br>
说明:<br>
python 是一个功能强大的脚本语言,与 Perl 类似。正如你看到的,它和 curl 完成同样的工作,但更优雅。这里要注意别漏掉'User-Agent' 和 'Content-Type' 内容,我在这个上面浪费了不少时间。其它与 curl 的说明一样。<br>
<br>
最后,将下面内容加到 crontab 中,保证每 5 分钟向 ISP 发送一个 keep-alive 包,模拟计时窗功能。<br>
*/5 * * * * /home/zest/keepalive.py<br>
<br>
方法 5 的总结:<br>
* 方法简单,思路清晰<br>
* 适应性广<br>
* 脚本实现,脱离浏览器和图形环境,更适于需要自动登录的环境(例如,自建的服务器)<br>
<br>
<br>
一些成功的例子:<br>
* whz81 朋友<br>
南京电信<br>
http://linuxsir.com/bbs/showthread.php?s=&threadid=39727<br>
* zest 就是我<br>
西安铁通<br>
http://linuxsir.com/bbs/showthread.php?s=&threadid=36142<br>
* 你的位置<br>
欢迎你与大家共同分享你的成功经验<br>
<br>
相关的链接:<br>
* 从特有的 DOMs 和 Markup 转移到 W3C 标准。http://www.stopbadtherapy.com/standards.shtml<br>
<br>
后记<br>
这篇小文是我在解决 Linux 下 Web 认证方式上网问题时的一些文字总结。由于本人的能力有限以及环境的限制,文中的内容肯定相当粗浅,会存在一些错误,希望各位能够批评指正,共同完善这篇文字。这里,我希望尽量说明解决问题的思路和方法,而不是只给出结果。授人以鱼,不如授人以渔。另外,这篇文字是两个时期完成的,方法 3 是在四月完成的。最近,七月,我的 ISP 改变了 Web 认证页面,所以产生了方法 5。为了保持延续性,没有删除方法 3,所以比较罗嗦。<br>
最后,欢迎大家分享自己的成功经验。<br>
<br>
email: zhousun at 163 dot net<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 + -