当前位置:网站首页>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
边栏推荐
猜你喜欢

上半年暂停考试要补考?包含监理工程师、建筑师等十项考试

MySQL series transaction log redo log learning notes

Flume面试题

Aidl basic use

最近公共祖先离线做法(tarjan)

ngnix基础知识

leetcode刷题:二叉树01(二叉树的前序遍历)

I received a letter from CTO inviting me to interview machine learning engineer

考虑关系的图卷积神经网络R-GCN的一些理解以及DGL官方代码的一些讲解

Significance and measures of security encryption of industrial control equipment
随机推荐
微软、哥伦比亚大学|GODEL:目标导向对话的大规模预训练
旁路由设置的正确方式
面试题:MySQL的union all和union有什么区别、MySQL有哪几种join方式(阿里面试题)[通俗易懂]
能升职加薪?PMP证书含金量浅析
杰理之关于长按开机检测抬起问题【篇】
十三届蓝桥杯B组国赛
Simple interactive operation of electron learning (III)
burpsuite简单抓包教程[通俗易懂]
PCB线路板塞孔工艺的那些事儿~
基于LSTM模型实现新闻分类
功利点没啥!
News classification based on LSTM model
leetcode刷题:栈与队列06(前 K 个高频元素)
薛定谔的日语学习小程序源码
最近公共祖先离线做法(tarjan)
[noip2013] building block competition [noip2018] road laying greed / difference
BPR(贝叶斯个性化排序)
Go - exe corresponding to related dependency
【Leetcode】最大连续1的个数
C中main函数的几种写法