当前位置:网站首页>PHP reflective XSS, reflective XSS test and repair
PHP reflective XSS, reflective XSS test and repair
2022-07-01 21:57:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
reflective XSS General location , Such as GET Parameters in
test Search function
F12 View source code , Look for... That appears 1111 The location of
The first position is title It's about
Try closing title label , Then test JS Code , Successful pop-up
View source code ,XSS perform
The second position is in the search box , here XSS Unable to execute , Because located value Within the properties , It needs to be closed
Be careful to close the extra double quotation marks when testing ”
And then to XSS Bug source code repair
First of all XSS stay title Location , Search parameters entered ks direct echo Output , There is no escape and other operations
<?php echo input(‘ks’);?>|{
Add filter code strip_tags() operation
The test found that
The second place XSS In the search box , be located index_menu.html in
The same vulnerability , For the input ks There is no filtering operation directly echo Output
Add filter function strip_tags()
<?php echo strip_tags(input(‘ks’));?>
The test found that
However, this repair is not perfect , Bypass exists , take value After the value is closed , Adding an event attribute can still be effective XSS
The best way to filter is to use htmlsepcial Function to filter
<?php echo htmlspecialchars(input(‘ks’));?>
The test again , Double quotation marks are escaped into ”
Unable to trigger XSS, The repair was successful .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/130466.html Link to the original text :https://javaforall.cn
边栏推荐
猜你喜欢

Do you want to make up for the suspended examination in the first half of the year? Including ten examinations for supervision engineers, architects, etc

业务可视化-让你的流程图'Run'起来

Pytest collection (2) - pytest operation mode

基于YOLOv5的口罩佩戴检测方法

函数基本学习之一

杰理之烧录上层版物料需要【篇】

Significance and measures of security encryption of industrial control equipment

latex如何打空格

芭比Q了!新上架的游戏APP,咋分析?

杰理之蓝牙耳机品控和生产技巧【篇】
随机推荐
东哥套现,大佬隐退?
vscode的使用
【Opencv450】HOG+SVM 与Hog+cascade进行行人检测
[noip2013] building block competition [noip2018] road laying greed / difference
最近公共祖先(LCA)在线做法
Pytest Collection (2) - mode de fonctionnement pytest
An operation tool used by we media professionals who earn 1w+ a month
新版图解网络PDF即将发布
Icml2022 | interventional contrastive learning based on meta semantic regularization
NIO与传统IO的区别
【深度学习】利用深度学习监控女朋友的微信聊天?
List announced | outstanding intellectual property service team in China in 2021
leetcode刷题:栈与队列02(用队列实现栈)
微信小程序,连续播放多段视频。合成一个视频的样子,自定义视频进度条
杰理之烧录都使用 VBAT 供电,供电电压 4.2V【篇】
Spark面试题
leetcode刷题:二叉树02(二叉树的中序遍历)
【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
pytest合集(2)— pytest運行方式
测试撤销1