php curl with csrf-token verification simulated submission method

不言
Release: 2023-03-24 10:38:01
Original
3254 people have browsed it

This article mainly introduces the detailed explanation of the simulated submission method of php curl with csrf-token verification. Now I share it with you and give you a reference. Let’s follow the editor and take a look.

Usually for security reasons, a random token value is added to the form to prevent CSRF attacks.

It is actually not difficult to simulate submitting a website with token verification.

1. Obtain the token through regular expressions
2. Bring the obtained token to simulate submission

The following is a successful example

Table of Contents Structure

│ form.php –需要模拟的表单 │ getForm.php – 模拟提交程序 │ post.php –表单验证程序 │ └─cookie – cookie存放目录
Copy after login

getForm.php

getMessage(), "\n"; } unlink($cookie_file); }
Copy after login

form.php

     new document      

Copy after login

post.php


        
Copy after login

Related recommendations:

Detailed explanation of using CURL in PHP

The above is the detailed content of php curl with csrf-token verification simulated submission method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!