曲径通幽论坛

标题: curl for phpwind8.x login and reply [打印本页]

作者: beyes    时间: 2011-4-21 10:09
标题: curl for phpwind8.x login and reply
Use curl to login phpwind8.x



Step-1,Get the cookies
[beyes@SLinux phpwind]$ curl -A "Mozilla/4.0" -D bbscookie.txt -o login.html "http://www.xxxxx.cn/login.php?action=login"


Step-2,Save the new cookies (the website may redirect to index.php and it will use the new cookies)
[beyes@SLinux phpwind]$ curl -A "Mozilla/4.0" -d "forward=&jumpurl=http://www.xxxxxx.cn/index.php&step=2&lgt=0&pwuser=beyes&pwpwd=xxxxxx&question=0&customquest=&answer=&hideid=0&cktime=31536000&sumbit=登录" -b bbscookie.txt -o login2.htm -D bbscookie2.txt "http://www.xxxxxx.cn/login.php?action=login"


Step-3,use the cookies saved in Step-4 to visit website :
[beyes@SLinux phpwind]$ curl -A "Mozilla/4.0" -b bbscookie2.txt -o view.html http://www.xxxxxx.cn/read.php?tid=4651



OK, if you want to login phpwind8.x gbk edition, you should change the "登录" to gb2312 code "%B5%C7%C2%BC" .

Now,we can reply to a "post" 。See below:
[beyes@SLinux phpwind]$ curl -A "Mozilla/4.0" -d "atc_usesign=1&replytouser=&atc_convert=1&atc_autourl=1&step=2&type=ajax_addfloor&fid=41&cyid=&tid=3419&stylepath=wind&ajax=1&verity=c1804cdf&_hexie=cn0zz&iscontinue=0&atc_title=Re:Test_Post&atc_content=replay_from_curl&action=reply" -b bbscookie2.txt -o posted.htm "http://www.xxxx.net/bbs/post.php?fid=41&nowtime=`date +%s`&verify=c1804cdf"

Note, the post url's format is
http://www.xxxx.com/post?fid=[fid_number]&nowtime=[your machine time]&verify=[value of verify]
use "date +%s" for getting your machine time and you can download the the "post" html first and pickup a unique "verify" value .

Engilsh is difficult to learn and write , poor...!




欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2