|
-
January 26th, 2008, 02:41 AM
#1
How to login a website?post!
Hi,
I want to login a website eg aaa.com
so I do this,
I use SendRequest send my username an password
pFile->AddRequestHeaders("Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*");
pFile->AddRequestHeaders("Referer: http://www.boofdollars.com/index.php?view=login&");
pFile->AddRequestHeaders("Accept-Language: zh-cn");
pFile->AddRequestHeaders("Content-Type: application/x-www-form-urlencoded");
pFile->AddRequestHeaders("Accept-Encoding: gzip, deflate");
pFile->AddRequestHeaders("User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon; .NET CLR 2.0.50727)");
pFile->AddRequestHeaders("Host: www.boofdollars.com");
pFile->AddRequestHeaders("Content-Length: 80");
pFile->AddRequestHeaders("Connection: Keep-Alive");
pFile->AddRequestHeaders("Cache-Control: no-cache");
pFile->AddRequestHeaders("Cookie: "+cookie_);
pFile->AddRequestHeaders("returnTo=&id=&ac=stats&step=&ptype=&form_user=goodhere&form_pwd=goodhere");
pFile->SendRequest(NULL,0,lpOptional,strlen(lpOptional));//80 bytes skipped. Reason: The content type is not captured.
Why?
I must creat a cookie?
Thank you
-
January 26th, 2008, 09:37 PM
#2
Re: How to login a website?post!
you can login the website using IE,and sniff the packet,and then check your code.
Best,
Kevin Jo
http://www.upredsun.com
**Easily and automatically build tcp-based or udp-based network protocol source code**
-
February 3rd, 2008, 01:07 PM
#3
Re: How to login a website?post!
listen..what i know is that its all about sessions..there r 2 ways I've seen to handle sessions
*Cookies
*Posted variables
Cookies, some variables with data sent to u in the response header (Set-Cookie)
Posted variables, when u "GET" a page with the form ur gonna fill, some hidden fields holds some values for example a variable "s" (ie session) may hold "ksudfn983pm3cc9p3" or whatever, it may look like a cookie variable
ny way..u can let wininet handle cookies for u by NOT adding ny "Cookie" headers in ur request AND "INTERNET_FLAG_FORMS_SUBMIT" header in the CHttpConnetion::OpenRequest function
good luck
-
February 3rd, 2008, 01:08 PM
#4
Re: How to login a website?post!
and upredsun's suggestion is extremely helpful, u SHOULD do that and find a way to automate the process and utilize wininet functions
-
February 4th, 2008, 09:35 PM
#5
Re: How to login a website?post!
To sniff the conversation between a browser and the target site, install a debugging proxy like Fiddler: www.fiddlertool.com
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|