当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
One of the basic learning of function
【单体】流辰信息I-BPSv3服务器推荐配置
EMC-电路保护器件-防浪涌及冲击电流用
焱融看 | 混合云时代下,如何制定多云策略
BlocProvider 为什么感觉和 Provider 很相似?
Manually implement function isinstanceof (child, parent)
中通笔试题:翻转字符串,例如abcd打印出dcba
从MLPerf谈起:如何引领AI加速器的下一波浪潮
Classify boost libraries by function
BC35&BC95 ONENET MQTT(旧)
上半年暂停考试要补考?包含监理工程师、建筑师等十项考试
PMP与NPDP之间的区别是什么?
matlab遍历图像、字符串数组等基本操作
PWN攻防世界cgpwn2
PCB plug hole technology~
leetcode刷题:栈与队列05(逆波兰表达式求值)
人才近悦远来,望城区夯实“强省会”智力底座
【深度学习】利用深度学习监控女朋友的微信聊天?
工控设备安全加密的意义和措施
Pytest collection (2) - pytest operation mode









