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

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

Jun 13, 2016 am 11:01 AM
curl php

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

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

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

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

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

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

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

【相关教程推荐】

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

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles