2

Possible Duplicate:
How can I obfuscate JavaScript?

I was browsing some sites and found really interesting thing. I am just starter in this coding and never seen such a thing, so I was wondering is it encrypted or encoded or packed or is there anything else?

Script sample:

V10861992380165541086199238016554108619923801655410861992380165541086199238016554108619923801655410861992380165541086199238016554='13047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395130473894741439513047389474143951304738947414395'

or here is screenshot of one really long thing, couldnt even snap it all over my screen. http://snpr.cm/8KznHp.png http://snpr.cm/xOLfRE.png

Can anyone tell me what are these, and how can I do the same? Do I need to pay for an program or something? Thank you for understanding.

Community
  • 1
  • 1
dvlden
  • 2,402
  • 8
  • 38
  • 61

1 Answers1

1

All the line or code does is create a variable starting with V and put the number in it. Without seeing the rest of the code I cant tell if it is just encoded or encrypted as well, but if you notice the string is just repeating the number 1304738947414395. You can definitely do a simple encoding by your self. A simple encoding is to put all the javascript code in a string like aaa="document.write('blah')" and then say aaa="atob(aaa) which converts the original string to base64. Save the base64 string and then place it in an eval statement like eval(btoa(aaa)) that converts it back to text, and then the eval executes the text. When it's finished you have some encoded mildly obfuscated code.

  • 1
    Well it would honestly take me too long to take it all apart, but I can tell you I see a lot of different encoding schemes in there including base64 and urlencoding. That mixed with the context of the site I can guess that it is attempting to exploit either your browser or attempting a cross site scripting attack. With how massive that block of code is I assume it does many bad things. – Timothy Swartz May 05 '12 at 16:59
  • 1
    Ha, and they've also disabled right-clicks to prevent an easy 'view-source.' I think the classic lesson to be learned here is that excess efforts to hide things might ultimately attract more attention from the sorts of people who are interested in and capable of discovering things that are hidden than you would want. – Erik Reppen May 05 '12 at 17:04
  • Okay thank you for your info :) ! I can mark it as answered now... – dvlden May 05 '12 at 17:04
  • Can you also remove the link in the first comment, wouldn't want something bad to happen to someone. – Timothy Swartz May 05 '12 at 17:07