一招搞定js反混淆,混淆代码还原

handsomeqin5年前技术8776

首先,本地新建一个html网页

然后,加入一个div

再给div赋值如下代码:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. </head>
  7. <body>
  8. <div id="divTest"></div>
  9. </body>
  10. </html>



  1. <script>
  2. // 将内容直接提取到页面中
  3. document.getElementById('divTest').innerText = 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;}('1("0-6");2 4(){1("0-5")}8 3=2(){1("0-7")};4();3()',9,9,'忧郁的匹格|alert|function|b|a|反混淆测试2|反混淆测试1|反混淆测试3|var'.split('|'),0,{})






  1. // 直接在控制台中打印出来
  2. console.log(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;}('1("0-6");2 4(){1("0-5")}8 3=2(){1("0-7")};4();3()',9,9,'忧郁的匹格|alert|function|b|a|反混淆测试2|反混淆测试1|反混淆测试3|var'.split('|'),0,{}))





</script>


执行网页,查看反混淆结果。


相关文章

CentOS 8: No URLs in mirrorlist error

问题:在CentOS 8中,使用yum时出现错误,镜像列表中没有url,类似如下:Error: Failed to download metadata for repo 'appstream&...

php根据浏览器访问不同页面

<?phpfunction isMobile(){      $useragent=isset($_SERVER['HTTP_USER_AGEN...

voyager Laravel 配置和使用

地址: https://github.com/the-control-group/voyagerInstallation Steps1. Require the PackageAfter c...

解决引用的图片403不显示问题

因为源做了https判断。在head文件中加入 :<meta name="referrer" content="no-referrer" />zbl...

python自动给数字前面补0的方法

python中有一个zfill方法用来给字符串前面补0,非常有用n = "123"s = n.zfill(5)assert s&n...

JavaScript 逆向爬取实战(下)

JavaScript 逆向爬取实战(下)

这一篇是 JavaScript 逆向爬取的第二篇。那么接下来我为大家缕顺一下学习顺序。系列文章的第一篇启于总结一些网站加密和混淆技术,这篇文章我们介绍了网页防护技术,包括接口加密和 JavaScrip...