Now use PHP to do imitation user login we will use the PHP curl function, because only it can be implemented like users to visit other sites, the following to introduce you to the Curl Sina Weibo microblogging application examples.
The day before yesterday received a demand need to simulate landing micro-blog and then carry out Weibo, have done a lot of analog login Ali mother, micro-letter, and some other internal system, has not been able to log in, Haha, so there is no time to do things, but when the analysis of Sina's landing process to feel the pressure
Encountered SHA1 (SHA1 (SHA1 (PWD)), once.servertime), must not be used, mainly to make this encryption algorithm can not be allowed to do not talk about login, and then on the Internet to find the code, one hours without the obtained.
is not I use Weibo account password can also login to Sina Mail or other Sina products to go, feel the hope is very large, it is true that Micro Bo account can directly login to all Sina products, and then visit the microblogging I have been in the state of the log, to prove this god-horse use it?
Actually very useful, a big company in a project investment technology and the project profitability and prospects have a lot of relationship, Micro Bo he can spend a lot of mind to do, but the other is not necessarily, in the case of finding that place the password is not encrypted that is not very much to say. (PS: More interested in network security, this way for hackers is called a side note, side note is that when hackers attack a website, this site security to do very well, no known loopholes, more difficult to break, so hackers will look for the site under the server under the other sites, and then find a more easily breached, Through this website hangs the horse, the shell, to raise the right, then the target website also falls, thought in the same server, therefore .... The goal is to get to the target station, either way, just take it off, it's a dirty idea.
Https://login.sina.com.cn/sso/login.php?client=ssologin.js (v1.4.15) &_=1403138799543 simple grab bag found that the password is not encrypted, Can't we simulate a login? Well, actually, it's a little early for fun.
First login to Sina's bar, the code minutes will be done. Returns a JSON array
Thecode is as follows: $password = $p;
Returns an array of JSON data
Thecode is as follows: Array (size=4)
This time that we login successfully, but in fact, the address of our microblog home is not weibo,com, but http://weibo.com/bipeng0405/home?wvr=5 such address, how we get this address, very simple, Direct crawl Weibo. COM then he will automatically give you jump back, you just need to take the address of the jump to record it
Thecode is as follows: $ch = Curl_init ();
Here's another question, this time you may find that did not jump to their microblog home page, this is why, you can look at the landing when there are two connection addresses, which have a Weibo domain under an address, guessing should be made cookies set so first get one side of him.
Thecode is as follows: Get ($login [' crossdomainurllist ']);
This code will have a problem before weibo.com get it just now.