首页
论坛
图书
开发资料
在线文档
网址
下载
联系我们
 新闻│Java│JavaScript│Eclipse│Eclipse 英文│J2EE│J2ME│J2SE│JSP│Netbeans│Hibernate│JBuilder│Spring│Struts
站内搜索: 请输入搜索关键词

当前页面: 开发资料首页 → Java 专题 → 网页表单密码破解程序

网页表单密码破解程序

摘要: 网页表单密码破解程序

</td> </tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="265" height="83" align="center" valign="top"> </td> <td width="57%" valign="top">
利用字典探嗅网页表单密码的源程序。程序只能用来学习研究。</td> </tr> <tr> <td height="44" colspan="2"><table width="720" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td>

Form Password Sniffer


使用说明

1、Target:填写表单将要的路径,该路径可以通过查看网页的源文件得到,如
<form NAME="form1" METHOD="post " ACTION="http://www.163.com/CheckUser.jsp>

2、Referer:有些网页的验证表单处要检测表单由何处提交,这里可以填写该表单的URL,如
www.163.com

3、CorrectFlag:此处填写表单验证后正确的关键字,如何得知该关键字呢?如果你有一个帐号能够通过该表单验证,可以使用GetFlag按钮来获得该关键字。

4、WrongFlag:同上,这里是获得验证失败的关键字,也是通过GetFlag得到的。

5、Keep Session:是保持页面在传递中的Session(目前没有实现)

6、Var1Name:指表单中第一个文本框的名字,一般是用户名:),也可以通过查看源程序得到,如
<input name=""size=12 class=log>
其中的usrname就是名字

Var1Value:指该处应该填写的内容,如果要猜jack的密码,就填写jack

UseDict:指是否使用字典文件,如果该标记被选中,会让你选择字典文件。

Var2Name、Var2Value、UseDict同上。

注意:如果想检测某个用户名是否已存在(一般网站都会提供该功能),可以将Var1使用字典,Var2留白。如果只是猜某一指定用户的密码,则将Var2使用字典。目前不支持用户名和密码同时使用字典文件。

7、Delay如果某些ISP限制了访问页面的时间间隔,请设定该间隔时间,单位为毫秒。

8、OtherParameters:如果表单中还有其它需要提交的元素,可以自己拼写提交,如
submit="登录"&style="1"

9、此处是反馈的结果

Load/Save:打开/保存配置文件

下面是示例:

我在自己的机器上准备了4个文件:default.html(登录页面),check.jsp(身份验证),error.jsp(用户名或密码错误页面),ok.jsp(登录成功的页面)

<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF">

default.htm的内容

<form name="form1" method="post" action="check.jsp">
用户名:<input name="username" type="text" size="12">

密 码:<input name="password" type="password" value="" size="12">
<input name="submit" type="submit" value="提交">
</form>


check.jsp

<%
String username = request.getParameter("username");
String password = request.getParameter("password");

if (!username.equals("zhang")) {
response.sendRedirect("error.jsp?msg=用户不存在");
return ;
}

if (!password.equals("test")) {
response.sendRedirect("error.jsp?msg=密码不正确");
return ;
}

response.sendRedirect("ok.jsp");
%>


error.jsp

<%
out.println(request.getParameter("msg"));
%>


ok.jsp

<%
out.println("Login Success");
%>

</td> </tr> </table>

由default.htm中可以看出,Target应该是check.jsp,Var1Name是username,Var2Name是password,因此,Target处应该填写http://localhost:8080/server/check.jsp,Var1Name处填写username,Var2Name处填写password,上面的程序中我已经知道了用户zhang使用密码test时能够正确登录,因此我将Var1Value填写zhang,Var2Value填写test,然后GetFlag,返回的结果如下:

<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF">HTTP/1.1 302 Moved Temporarily
Set-Cookie: JSESSIONID=D774019940B30BC65709C15197A13B0A; Path=/server
Location: http://127.0.0.1:8080/server/ok.jsp
Content-Type: text/html
Content-Length: 0
Date: Sat, 10 Apr 2004 14:57:27 GMT
Server: Apache-Coyote/1.1
Connection: close</td> </tr> </table>

在我们再将Var1Value和Var2Value留空,再看看登录失败时的返回数据

<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF">HTTP/1.1 302 Moved Temporarily
Set-Cookie: JSESSIONID=21E3ECB8815AC7876A78D1479B30EB7D; Path=/server
Location: http://127.0.0.1:8080/server/error.jsp?msg=ó??§2?′??ú
Content-Type: text/html
Content-Length: 0
Date: Sat, 10 Apr 2004 15:00:22 GMT
Server: Apache-Coyote/1.1
Connection: close
</td> </tr> </table>

从上面返回的两组数据中可以看到,当登录成功时,返回的数据包含Location: http://127.0.0.1:8080/server/ok.jsp,失败则包含Location: http://127.0.0.1:8080/server/error.jsp?msg=ó??§2?′??ú(这里没有处理中文编码,所以显示乱码),因此,我们在CorrectFlag中填写http://127.0.0.1:8080/server/ok.jsp,WrongFlag中填写Location: http://127.0.0.1:8080/server/error.jsp?msg=ó??§2?′??ú,现在再假设我要猜测用户zhang的密码,这时可以将Var1Value中填写zhang,Var2Value使用字典文件。我准备的字典文件内容如下:

<table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#000000"> <tr> <td bgcolor="#FFFFFF">iloveyou
loveyou
love
ILOVEYOU
LOVEYOU
LOVE
loveme
LOVEME
test
778852177885217788521
77885217788521
7788521
521521521
521521
521
520520520
520520
520
zhang
772587725877258
7725877258
77258
258258258
258258
258
sina
sohu
163
263
(最后一行要留空)
</td> </tr> </table>

此时界面应该如下:

然后Start,结果如下

注意:

1、选择关键字最好是尽量靠前,这样会使网络传输的数据量比较小

2、能务必填写CorrectFlag,也就是说你必须知道登录正确的关键字(这也是提高速度的一个方面,同时,如果仅通过错误的关键字来猜测密码是否正确比较困难,这是由于关键字比较难找,最重要的是,如果不填写CorrectFlag,目前不能正常工作:))

</td> </tr> </table>


</td> </tr> </table>


function TempSave(ElementID) { CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value); CommentsPersistDiv.save("CommentXMLStore"); } function Restore(ElementID) { CommentsPersistDiv.load("CommentXMLStore"); document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent"); } </td> </tr> <tr>


↑返回目录
前一篇: 我也用字典探表单密码
后一篇: 一个简单的web浏览器源码

首页 | 全站 Sitemap | 联系我们 | 设为首页 | 收藏本站
版权所有 Copyright © 2006-2007, Java 编程资料牛鼻站, All rights reserved