Power by DMForum.NET!
RSS | ATOM | WAP
DMForum.NET 官方支持讨论区 > 技术区 > 应用程序开发

浏览主题:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb

主题:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb
devms
管理员
8级
等级:黄金骑士
发帖:3934
金钱:4064
经验:25679
积分:2
性别:帅哥
状态:离线
注册:2006-7-29 23:37:00
向leadbbs发送数据包实现注册用户的几个过程  
[ 2007-3-19 19:47:46 ]

引用 devms 发表的内容


function TRegister.getCookieStr( RawText: TidHeaderList ) : string;
var
i : integer;
str : string;
begin
if RawText = nil then begin
result := '';
end;
str := '';
for i := 0 to RawText.Count - 1 do begin
if RawText.Names[i] = 'Set-Cookie' then begin
str := str + StringReplace(StringReplace(RawText.Strings[i],'Set-Cookie: ','',[rfReplaceALL]),' path=/','',[rfReplaceALL]);
end;
end;
result := str + ' path=/';
end;

function TRegister.sendRegister:boolean;
var

temp:TstringStream;
tSend:TStringList;
b:string;
idhttp1:tidhttp;
c1:TClientSocket;
image:timage;
send:TStringStream;
myrndNumber:string;
t:tstringlist;
gif1:TGifAnimator;
vcode:string;
c:TDateTime;
begin
image := timage.Create(nil);
gif1 := TGifAnimator.Create(nil);
c1 := TClientSocket.Create(nil);
idhttp1 := Tidhttp.Create(nil);
idhttp1.ProtocolVersion := pv1_1;
idhttp1.HandleRedirects := true;

t := tstringlist.Create;

//t.Append('====================');
//t.Append('-> 开始初始化控件');
//t.Append('====================');

idhttp1.Get(my_parent.siteURL + '/Search/Search.asp');

//t.Append('====================');
//t.Append('-> 首次获取的头信息:');
//t.Append(idhttp1.Response.RawHeaders.Text);
//t.Append('-> 真实COOKIE信息:');
//t.Append(getCookieStr(idhttp1.Response.RawHeaders));
//t.Append('====================');

my_cookie := getCookieStr(idhttp1.Response.RawHeaders);

c := Now;
c := IncDay(c,my_loop);
b := DateTimeToStr(c) ;
b := StringReplace(b,'-','%2D',[rfReplaceALL]);
b := StringReplace(b,':','%3A',[rfReplaceALL]);
b := StringReplace(b,' ','+',[rfReplaceALL]);

my_cookie := StringReplace(my_cookie,'[TIME]',b,[rfReplaceALL]);
//t.Append('====================');
//t.Append('-> 取得COOKIE: ' + my_cookie);
//t.Append('====================');

send := tstringstream.Create('JoinFlag=dkls');

b := StringReplace(my_parent.PubPostHeader,'[DATALENGTH]',IntToStr(send.Size),[rfReplaceALL]);
b := StringReplace(b,'[FILE]',my_parent.DirName + 'User/Register.asp',[rfReplaceALL]);
b := StringReplace(b,'[HOST]',my_parent.HostName,[rfReplaceALL]);
b := StringReplace(b,'[PORT]',INTTostr(my_parent.targetPORT),[rfReplaceALL]);
b := StringReplace(b,'[REFERSH]',my_parent.siteURL + '/User/Register.asp',[rfReplaceALL]);
b := StringReplace(b,'[COOKIE]',my_cookie,[rfReplaceALL]);

b := b + send.DataString;
send.Free;
c1.ClientType := ctBlocking;
c1.Host := my_parent.HostName;
c1.Port := my_parent.targetPORT;
c1.Active := true;
c1.Open;
c1.Socket.SendText(b);

//t.Append('====================');
//t.Append('-> 模拟协议页面请求');
//t.Append('-> 请求数据: ' + b);
//t.Append('====================');

with idhttp1.Request do begin
UserAgent := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Maxthon; .NET CLR 1.1.4322)';
AcceptEncoding := 'gzip, deflate';
CacheControl := 'no-cache';
Connection := 'Keep-Alive';
AcceptLanguage := 'zh-cn';
idhttp1.Request.CustomHeaders.Add('Cookie: ' + my_cookie);
end;

b := idhttp1.Get(my_parent.siteURL + '/User/number.asp');
temp := tstringstream.Create(b);
gif1.Image.LoadFromStream(temp);
image.Picture.Bitmap := gif1.Image.Frames[0].Bitmap;

vcode := my_parent.getNumber(image);
image.Free;
gif1.Free;

//t.Append('====================');
//t.Append('-> 获取验证码');
//t.Append('-> 分析值为: ' + vcode);
//t.Append('====================');

b := 'Form_username=' + my_account + '&SubmitFlag=29d98Sasphouseasp8asphnet&JoinFlag=3kkdk&Form_password1=' + my_password + '&Form_password2=' + my_password;
b := b + '&Form_mail=' + my_email + '&Form_Question=我是谁&Form_Answer=我当然是上帝了&Form_homepage=&Form_address=&Form_icq=&Form_oicq=&Form_sex=男';
b := b + '&Form_userphoto=0191&Form_byear=19&Form_bmonth=&Form_bday=&Form_Underwrite=' + StringReplace(StringReplace(my_sign,#13,'%0D',[rfReplaceALL]),#10,'%0A',[rfReplaceALL]) + '&ForumNumber=' + vcode + '&submit=+%C9%EA+%C7%EB+';
send := tstringstream.Create(b);

b := StringReplace(my_parent.PubPostHeader,'[DATALENGTH]',IntToStr(send.Size),[rfReplaceALL]);
b := StringReplace(b,'[FILE]',my_parent.DirName + 'User/Register.asp',[rfReplaceALL]);
b := StringReplace(b,'[HOST]',my_parent.HostName,[rfReplaceALL]);
b := StringReplace(b,'[PORT]',INTTostr(my_parent.targetPORT),[rfReplaceALL]);
b := StringReplace(b,'[REFERSH]',my_parent.siteURL + '/User/Register.asp',[rfReplaceALL]);
b := StringReplace(b,'[COOKIE]',my_cookie,[rfReplaceALL]);
b := b + send.DataString;
send.Free;
c1.ClientType := ctBlocking;
c1.Host := my_parent.HostName;
c1.Port := my_parent.targetPORT;
c1.Active := true;
c1.Open;
c1.Socket.SendText(b);

//t.Append('====================');
// t.Append('-> 发送最后请求');
//t.Append('-> 请求数据: ' + b);
//t.Append('====================');
//t.SaveToFile('c:\log.txt');
end;

编辑标志
本帖最后由[devms]在 2007-3-19 19:49:39 编辑
人民英雄
普通会员
3级
荣誉:老会员
等级:讨逆将军
发帖:106
金钱:830
经验:3560
性别:帅哥
状态:离线
注册:2004-4-30 0:00:00
RE:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb  
[ 2007-3-19 20:47:36 ]

又是Delphi ?

猪的右手
(JoyMix'CEO)
论坛版主
3级
等级:论坛游侠
发帖:138
金钱:1700
经验:3078
性别:帅哥
状态:离线
注册:2006-11-8 21:02:00
RE:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb  
[ 2007-3-22 22:46:16 ]

我是谁&Form_Answer=我当然是上帝了

这个我最稀饭

大大IT
(DaCMS)
普通会员
7级
等级:侍中
发帖:324
金钱:2180
经验:12816
积分:10
性别:帅哥
状态:离线
注册:2006-8-4 11:07:00
RE:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb  
[ 2007-4-3 9:15:51 ]
不懂戴尔非.
猪的右手
(JoyMix'CEO)
论坛版主
3级
等级:论坛游侠
发帖:138
金钱:1700
经验:3078
性别:帅哥
状态:离线
注册:2006-11-8 21:02:00
RE:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb  
[ 2007-4-3 20:17:51 ]
谁能将这段编出来.我玩玩
我叫菜鸟
普通会员
2级
等级:司马
发帖:26
金钱:285
经验:1873
性别:保密
状态:离线
注册:2007-5-19 15:19:00
RE:jxs网??????????gc?京京?网招?网招??jxs网网招??,/???????????京京?bb  
[ 2007-5-19 22:59:51 ]
可以造成CC?

回到顶部
Powered by DMForum.NET  1.4 Beta . URIMAP enabled. DEBUG enabled.
Copyright © 2003-2006 Devms.Com. All rights reserved.