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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)