JavaScript

Code not in human syntax (technically) that dictates function necessary to run the website. As opposed to CSS which dictates design, JavaScript is used to perform functions, but in both cases they can be defined internally within the html or externally as separate file that is then referenced by the html.

Signifiers for files:

The complexity of the JavaScript lends itself to “code obfuscation” - making intent not entirely clear to decipher.

Code Obfuscation

Obfuscation is a technique used to make a script more difficult to read by humans but allows it to function the same from a technical point of view, though performance may be slower. This is usually achieved automatically by using an obfuscation tool, which takes code as an input, and attempts to re-write the code in a way that is much more difficult to read, depending on its design.

Code can be without being compiled like Python and Perl and JavaScript. But on one hand Python and PHP usually are on the server-side of things while JavaScript can reside on the client-side. Having the code accessible and in clear text on client-side demonstrates why obfuscation is used especially in the case of JavaScript.

While code obfuscation can be used by developers to “protect” their code and prevent unauthorized usage and or reverser engineering, the more common use is within the malicious actor sectors. Often utilized as a way to hide the malicious scripts intent and circumvent IPS/IPD systems from preventing to scripts insertion/activation.

<aside> 💡

Note: Having authentication or encryption of the client-side is not recommended. It opens the code up to more opportunity for attacks.

</aside>

Basic Obfuscation

Code obfuscation is usually not done manually. There are many tools for various languages that automate the code obfuscation, whether they are legitimate tools for developers and online access protocols or developed for and by malicious actors.

Run JavaScript

JavaScript console tool. Useful for testing JavaScript

https://jsconsole.com/

Minify JavaScript

A common practice of reducing the legibility of JavaScript snippets by human eyes while maintaining functionality in minification. Minification tends to be more useful in long code to which it will compress the code into a single, often very long line of code, it can be used on shorter code as well with benefits of minification lessened due to the reduced content of code.