search
Homephp教程php手册php如何通过curl 登陆百度贴吧

php如何通过curl 登陆百度贴吧

Jun 13, 2016 am 11:01 AM
curlphp

这两天,因为公司需要,所以研究了一下百度文库的登陆方案。因为账号是购买的,只有一部分cookie值,所以不能通过正常的渠道登陆,所以只有通过curl模拟直接进行后台登陆。那么,问题来了。按照人家说的,把这部分值写入浏览器缓存中就可以直接进行操作了,这部分工作可以通过软件操作。好吧,几万个账号通过软件进行操作,这个想法也是蛮好的。为了减轻工作量,所以开发一款后台,来进行系统操作。话不多说,下面直接进入正题。

首先,拿着这部分cookie登陆百度贴吧首页,看看是否在页面显示自己的登录状态。结果是早就注定的,没有任何显示,只有一个空荡荡的首页。接下来就是要考虑的,为什么???

根据自己直接拿下来的完整的cookie来看,整体之中,只有两个值是重要的,bduss和stoken这两个值。那么,接下来就有目的了,我们的任务就是获取这两个值。

经过各种抓包,发现了一个问题,给我们的那一部分cookie中含有上述的两个值,但是就是登陆不上去。所以开始怀疑是不是有浏览器限制。给我们的这一部分是不是需要某个特殊的浏览器来进行操作。所以嘞,就把火狐登陆获得的cookie在360和谷歌上分别进行登陆实验,经过验证,对浏览器没有什么限制。这特么就是搞事情了。

然后呢就开始不停地换着方式来登录,把cookie写到header头里,或者保存到文件中等等。。。。。。

刷新了有大概十几分钟,我们发现有一种方法,可以让浏览器产生十几次跳转,所以对这方面仔细看了一下,分别把十几个跳转的包抓下来,然后分别把不同的cookie放到我们的header头部中进行模拟登陆。嘿,成了。

总的来说,这次的经历还算是比较尴尬的,有时候还是多试试比较好。具体的详细步骤攒下就不多赘述了,以免被和谐了,行了,这次的记录就到这里了,感谢各位看官欣赏。

【相关教程推荐】

1. php编程从入门到精通全套视频教程
2. php从入门到精通 
3. bootstrap教程

Statement
This article is reproduced at:CSDN博客. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.