当前位置:网站首页>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
pytest合集(2)— pytest運行方式
Pytest collection (2) - pytest operation mode
【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程
Aidl basic use
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
杰理之蓝牙耳机品控和生产技巧【篇】
Go - exe corresponding to related dependency
上半年暂停考试要补考?包含监理工程师、建筑师等十项考试
【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
随机推荐
Kuberntes云原生实战一 高可用部署架构
K-means based user portrait clustering model
杰理之烧录都使用 VBAT 供电,供电电压 4.2V【篇】
ngnix基础知识
九章云极DataCanvas公司蝉联中国机器学习平台市场TOP 3
mysql 学习笔记-优化之SQL优化
分离字符串中的字母和数字并使得字母在前数组在后
【深度学习】利用深度学习监控女朋友的微信聊天?
物联网rfid等
Difference and use between require and import
Basic operation of binary tree
Manually implement function isinstanceof (child, parent)
东哥套现,大佬隐退?
News classification based on LSTM model
选择在同花顺上炒股开户可以吗?安全吗?
十三届蓝桥杯B组国赛
Microsoft, Columbia University | Godel: large scale pre training of goal oriented dialogue
Slf4j打印异常的堆栈信息
面试题:MySQL的union all和union有什么区别、MySQL有哪几种join方式(阿里面试题)[通俗易懂]
leetcode刷题:二叉树03(二叉树的后序遍历)