2021-03-11 20:57:45 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
2022-09-05 00:48:36 +05:30
|
|
|
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" />
|
2021-03-11 20:57:45 +01:00
|
|
|
<style>
|
|
|
|
.malware {
|
|
|
|
position: fixed;
|
2022-09-05 00:48:36 +05:30
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
2021-03-11 20:57:45 +01:00
|
|
|
height: 150px;
|
|
|
|
background: red;
|
|
|
|
color: black;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
font-family: monospace;
|
|
|
|
font-size: 72px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
2021-12-04 15:28:40 -08:00
|
|
|
function xssAttack() {
|
|
|
|
const div = document.createElement('div');
|
|
|
|
div.id = 'the-malware';
|
|
|
|
div.className = 'malware';
|
|
|
|
div.innerHTML = 'XSS Succeeded';
|
2021-03-11 20:57:45 +01:00
|
|
|
document.getElementsByTagName('body')[0].appendChild(div);
|
2022-06-27 12:29:50 +09:00
|
|
|
throw new Error('XSS Succeeded');
|
2021-03-11 20:57:45 +01:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-09-05 00:48:36 +05:30
|
|
|
<pre class="mermaid">
|
|
|
|
<!-- prettier-ignore -->
|
2021-03-11 20:57:45 +01:00
|
|
|
%%{init: { 'fontFamily': '\"></style><img src=x onerror=xssAttack()>'} }%%
|
|
|
|
graph LR
|
|
|
|
A --> B
|
2022-09-05 00:48:36 +05:30
|
|
|
</pre>
|
2023-02-19 14:03:11 +05:30
|
|
|
<script type="module">
|
|
|
|
import mermaid from './mermaid.esm.mjs';
|
2021-03-11 20:57:45 +01:00
|
|
|
mermaid.initialize({
|
|
|
|
startOnLoad: true,
|
|
|
|
useMaxWidth: true,
|
|
|
|
});
|
2022-10-09 22:08:32 +08:00
|
|
|
let cnt = 0;
|
|
|
|
let a;
|
|
|
|
const handler = setInterval(() => {
|
2021-03-11 20:57:45 +01:00
|
|
|
cnt++;
|
|
|
|
a = {};
|
2021-12-04 15:28:40 -08:00
|
|
|
if (typeof a.polluted !== 'undefined') {
|
2021-03-11 20:57:45 +01:00
|
|
|
clearInterval(handler);
|
|
|
|
xssAttack();
|
|
|
|
}
|
2021-12-04 15:28:40 -08:00
|
|
|
if (cnt > 20) {
|
2021-03-11 20:57:45 +01:00
|
|
|
clearInterval(handler);
|
|
|
|
}
|
|
|
|
}, 100);
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|