Capture QQ mail contacts

Source: Internet
Author: User

Today is:, to commemorate the last night!

Digress:I used httpclient4.0 to simulate the login request page. By the way, I learned that the usage of 4.0 is quite different from that of previous versions. Google will know the specific situation, I personally think it is enough to know the principle.As long as the development kit can achieve the purpose, use that version to decide on its own.

 

Back to the truth:

Step 1,Capture the login page:Http://mail.qq.com/cgi-bin/loginpage 

Objective: To obtain the Action submitted by the form and the TS value used to encrypt the password

Note: The obtained action has two purposes:

1. Of course, the form is submitted.

2. Extract the domain to assemble the Verification Code request URL. Because the verification code is distributed across multiple machines, one machine can only verify the verification code of this machine (so some oldArticleThe URL obtained by the Verification Code cannot be used)

Supplement: there is also an RSA public key publickey on the home page. I copy it directly and use it. For others, use the regular expression.

Step 2,Request Verification Code :"Http: // "+ domain +"/cgi-bin/getverifyimage? Aid = 23000101 & "+ math. Random()

Note: The returned Verification Code contains the cookie authimgs_id and verifyimagesession (previously called verifysession ).They(Do not miss authimgs_id)Save it becauseLand request

Time.

Setp3,Fill form:

SID = 0, 2, zh_cn (default)

Firstlogin = false (default)

Starttime = (request time: JS: (new date (). valueof (); Java: Long. tostring (system. currenttimemillis ()))

Redirecturl = (null by default)

F = HTML (default)

P = (encrypted secret: If jdk6.0 can call the JS file that stores the RSA encryption function (it seems like this is safeauth9206l. JS, I am in the jdk5.0 environment, so I have not tried this method) to encrypt)

Delegate_url = (null by default)

S = (null by default)

TS = (obtained when the homepage is crawled above)

From = (null by default)

PPP = (null by default)

Chg = 1 (ignore, just fill in 1)

Checkisweblogin = (the day of the week where the current date is located multiplied by 3. For example, if today is Sunday, it is 0*3 = 0, and yesterday is 6*3 = 18)

Uin = (QQ number)

Pp = (replace each character of the original password with 0, that is, the password length is a string consisting of 0)

Verifycode = Verification Code (setp2 obtained)

Aliastype = @ QQ.com(Others have not been tried)

After filling out the form, you can go to the next step. Here we recommend a software: Charles, which can be used to view the details of the HTTP request on the page. It is very convenient to analyze the request and response.

Setp4,Login

Before submitting the form, remember to put the Cookie obtained by setp2 into the request header. You do not need to set other values for the header. the individual level is limited. I don't know ~~!,It should be true that everything I see on Charles is actually correct.

If the submission fails, an error page is returned (errtype = 1: Password error, 2: verification code error, 17: Too Many logins). Otherwise, a jump page is returned, which will jump to the urlheader on the page, sid and r values are taken down and re-assembled into the home page url

For example:Http://m87.mail.qq.com/cgi-bin/frame_html? SID = 0 tmsqphqjlbkwusa & R = 0f5b1e1f4898062431d5c1d21cbd244d

Remember to save the urlheader (containing the Domain Name Information used on the home page) and the SID for getting the contact.

Setp5,Get contact

URL: urlheader + "addr_listall? SID = "+ _ SID +" & sorttype = NULL & category = Common"

For example:Http://m87.mail.qq.com/cgi-bin/addr_listall? SID = 0 tmsqphqjlbkwusa & sorttype = NULL & category = Common

After entering the group page, you will get the URL for entering each group. Just go in and get it!

 

#My personal understanding is as follows:The above process must always use the same httpclient object, and the httpclient implicitly completes session maintenance for us!

(If you have an incorrect understanding, please point it out so that it can be corrected. I am not good at it, but I am eager to learn it ~~)

#Source code is not provided here, because the QQ mailbox is slightly changed,ProgramIt may not work. The key is the idea! To be retained ~~

References:

Http://www.cnblogs.com/huangcheng/archive/2009/09/14/1566198.html

Http://blog.csdn.net/gtuu0123/archive/2009/11/14/4809431.aspx

@ Qq mail switched to HTTPS protocol, and the page of the mailbox contact is in this version, but the program is still available)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.