Csdn simulated Login

Source: Internet
Author: User

Copyright statement: original works can be reproduced. During reprinting, you must mark the original publication, author information, and this statement in hyperlink form. Otherwise, legal liability will be held. Http://blog.csdn.net/mayongzhan-ma yongzhan, myz, mayongzhan

First, it is declared that the simulation is unstable, and sometimes login fails.
For more information about the simulation, see section blog.csdn.net/mayongzhan. For more information, see blog.csdn.net/mayongzhan.
It turns out that csdn metaweblog cannot publish categories, so we use simulated login and then publish. Of course, we also found many csdn secrets, such as hidden ones used to send spam.
The field, there are many other functions that csdn only hides but not deletes. If you are interested, try to see if it is blocked.
I have returned to XMLRPC. I have published this article for your appreciation by myz.

Some other hidden fields

Publish To webpage
& Ctl00 % 24 cphcontent % 24entryeditor1% 24 ckbpublished = on

Allow display on the blog homepage
& Ctl00 % 24 cphcontent % 24entryeditor1% 24 chkisaggregated = on

Copy the body content to the clipboard (valid only for IE)
& Ctl00 % 24 cphcontent % 24entryeditor1% 24 chkcopytoclipboard = on

Displayed on my homepage
& Ctl00 % 24 cphcontent % 24entryeditor1% 24 chkdisplayhomepage = on

Addfriend. aspx

Send emails to friends outside the site
Ctl00 $ cphcontent $ entryeditor1 $ ckbmailto
Send short messages to friends on the site
Ctl00 $ cphcontent $ entryeditor1 $ ckbmessageto
Recommended edits
Ctl00 $ cphcontent $ entryeditor1 $ ckbrecommendto

See it. There is also the mail function, which is the la carte mail that appeared some time ago. If it is to be promoted,... you can try it.

Body. Code on

Bytes --------------------------------------------------------------------------------------------

Test. php

<? PHP
/**
* @ Name test. php
* @ Date Sun Jul 20 12:31:20 CST 2008
* @ Copyright Ma yongzhan (myz)
* @ Author ma yongzhan (myz)
* @ Link http://blog.csdn.net/mayongzhan/
*/

// Header ("Content-Type: text/html; charset = UTF-8 ");
Header ("Content-Type: image/JPEG ");
Session_start ();

$ Url = 'HTTP: // hi.csdn.net/indexlogin.aspx ';
$ Url2 = 'HTTP: // hi.csdn.net/indexloginimage.aspx ';

$ Post = 1;
$ Returntransfer = 1;
$ Port = 80;
$ Header = 0;
$ Nobody = 0;
$ Followlocation = 1;

$ Cookie_jar = tempnam ('./tmp', 'cookie.txt ');
$ _ Session ['cookie _ jar'] = $ cookie_jar;

$ CH = curl_init ();
$ Options = array (curlopt_url => $ URL,
Curlopt_header => $ header,
Curlopt_nobody => $ nobody,
Curlopt_port => $ port,
Curlopt_returntransfer => $ returntransfer,
Curlopt_followlocation => $ followlocation,
Curlopt_cookiejar => $ cookie_jar
);
Curl_setopt_array ($ ch, $ options );
$ Temp = curl_exec ($ ch );
Curl_close ($ ch );

// Echo $ temp;

Preg_match_all ('/id =/"_ viewstate/" value =/"(// [0-9a-z] +)" //>/I', $ temp, $ temparr );
Preg_match_all ('/id =/"_ eventvalidation/" value =/"(// [0-9a-z +] +)" //>/I', $ temp, $ temparr2 );

$ _ Session ['_ viewstate'] = $ temparr [1] [0];
$ _ Session ['_ eventvalidation'] = $ temparr2 [1] [0];

$ CH2 = curl_init ();
$ Options2 = array (curlopt_url => $ url2,
Curlopt_header => $ header,
Curlopt_nobody => $ nobody,
Curlopt_port => $ port,
Curlopt_returntransfer => $ returntransfer,
Curlopt_followlocation => $ followlocation,
Curlopt_cookiefile => $ cookie_jar,
Curlopt_referer => $ URL
);
Curl_setopt_array ($ CH2, $ options2 );
$ Temp = curl_exec ($ CH2 );
Curl_close ($ CH2 );

Echo $ temp;

// $ TEM = file_get_contents ($ cookie_jar); print_r ($ TEM );

// Curlopt_url is the address of the content to be obtained
// Curlopt_header is the header to be obtained
// Curlopt_nobody is the expected content
// Curlopt_port is the port
// Curlopt_returntransfer puts the output content in the buffer, which can be ECHO or assigned to a variable
// Curlopt_post is a standard submission
// Curlopt_postfields is the submitted content
// Curlopt_cookiejar is the cookie to save
// Curlopt_cookiefile reads the cookie from the file and submits the cookie.
// When curlopt_followlocation is enabled, the "Location:" returned by the server is put in the header and recursively returned to the server.
// Curlopt_maxredirs limit the number of recursive returns
// Curlopt_httpheader sets an array of content transmitted in the header
// Curlopt_referer sets the value of "Referer:" in the header
// Curlopt_useragent contains a "User-Agent" header string in the HTTP request.
// Curlopt_encoding sets the content of "Accept-encoding:" in the header. The supported encoding formats are: "Identity", "deflate", and "gzip ". If it is set to an empty string, all encoding formats are supported.
// Curlopt_cookie: Set the set-cookie part of the HTTP request
?>

Bytes --------------------------------------------------------------------------------------------

Test2.php

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta name = "author" content = "Ma yongzhan (myz)"/>
<Meta name = "Copyright" content = "Ma yongzhan (myz)"/>
<Meta http-equiv = "content-language" content = "UTF-8"/>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> </title>
</Head>
<Body>
<IFRAME src = "test. php" scrolling = "no" frameborder = "0" width = "400px" Height = "100px"> </iframe>
<Form action = "test3.php" method = "Post">
Verifycode: <input type = "text" name = "verifycode"/> <br/>
<Input type = "Submit" value = "login"/>
</Body>
</Html>

Bytes --------------------------------------------------------------------------------------------

Test3.php

<? PHP
/**
* @ Name test3.php
* @ Date Sun Jul 20 12:31:30 CST 2008
* @ Copyright Ma yongzhan (myz)
* @ Author ma yongzhan (myz)
* @ Link http://blog.csdn.net/mayongzhan/
*/

Header ("Content-Type: text/html; charset = UTF-8 ");
Session_start ();

$ Url = 'HTTP: // hi.csdn.net/indexlogin.aspx ';

$ Post = 1;
$ Returntransfer = 1;
$ Port = 80;
$ Header = 0;
$ Nobody = 0;
$ Followlocation = 1;

$ Request = '_ viewstate = '. urlencode ($ _ session ['_ viewstate']). '& __ eventvalidation = '. urlencode ($ _ session ['_ eventvalidation']). '& username = testman110 & userpwd = testman111111 & verifycode = '. $ _ post ['verifycode']. '& buttonlogin = '. urlencode ('login ');

$ Cookie_jar = $ _ session ['cookie _ jar'];

$ CH = curl_init ();

$ Options = array (curlopt_url => $ URL,
Curlopt_header => $ header,
Curlopt_nobody => $ nobody,
Curlopt_port => $ port,
Curlopt_post => $ post,
Curlopt_postfields => $ request,
Curlopt_returntransfer => $ returntransfer,
Curlopt_followlocation => $ followlocation,
Curlopt_cookiejar => $ cookie_jar,
Curlopt_cookiefile => $ cookie_jar,
Curlopt_referer => $ URL
);
Curl_setopt_array ($ ch, $ options );
$ Temp = curl_exec ($ ch );
Curl_close ($ ch );

Echo $ temp;
?>

Bytes --------------------------------------------------------------------------------------------

The end

PHP is no worse than anything. It includes Python C # that has been written into csdn #.

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.