Wikipedia:Reference desk/Archives/Computing/2019 October 20

Computing desk
< October 19 << Sep | October | Nov >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


October 20

edit

Mysterious code

edit

Why does this long line of code:

blanked potentially dangerous code

just print "Hello, world" to the console? What is this code actually doing behind the scenes? 69.5.123.5 (talk) 05:25, 20 October 2019 (UTC)[reply]

To start with, it's all in ASCII code. Start by decoding that, using our chart (the cyan column), here: ASCII#Printable_characters. Then maybe we can figure out what that's doing. SinisterLefty (talk) 05:32, 20 October 2019 (UTC)[reply]
It decodes to
Still confused. 69.5.123.5 (talk) 05:38, 20 October 2019 (UTC)[reply]
From what I decoded, it looks like more instructions, like "concat" and "eval", so apparently we have code within code within code. They must have been trying to obfuscate the meaning. Keep decoding all the levels. SinisterLefty (talk) 05:49, 20 October 2019 (UTC)[reply]
Code within code within code?
Apparently goes down 1 more level. 69.5.123.5 (talk) 05:53, 20 October 2019 (UTC)[reply]
And then decodes to console.log("Hello, world!") Wow! 69.5.123.5 (talk) 05:55, 20 October 2019 (UTC)[reply]
At least they didn't do this

That is 7 layers. 69.5.123.5 (talk) 05:57, 20 October 2019 (UTC)[reply]
Somebody had a lot of time to kill making that. SinisterLefty (talk) 05:59, 20 October 2019 (UTC)[reply]
Or a script to do the job for them. 69.5.123.5 (talk) 06:00, 20 October 2019 (UTC)[reply]
I once wrote a noughts and crosses game entirely in AmigaGuide. Since AmigaGuide is a static mark-up language like HTML or LaTeX and does not support state manipulation, the only way I could do it was to write out every single possible state in the same document. It was too much of an effort to do by hand, so I wrote a program to do it for me. JIP | Talk 21:21, 22 October 2019 (UTC)[reply]
@69.5.123.5, JIP, and SinisterLefty: this is a common set of techniques to obfuscate the code of JS based attacks. Where is this code coming from ? Where is it running ? Please NEVER run anything like this that you do not understand in your personal browser and report any existence of code like this to the owner of the website where you encounter it. —TheDJ (talkcontribs) 12:17, 28 October 2019 (UTC)[reply]
Even if it is just console.log Usually that means it is in preparation of a later attack. —TheDJ (talkcontribs) 12:18, 28 October 2019 (UTC)[reply]
I didn't run it. I manually translated some of the ASCII code. SinisterLefty (talk) 15:41, 28 October 2019 (UTC)[reply]