吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 5714|回复: 33
收起左侧

[Web逆向] 从JS加密的HTML文件中提取PDF文件

  [复制链接]
看门猫 发表于 2021-7-19 15:08
本帖最后由 看门猫 于 2021-7-20 14:47 编辑

今天帮别人下载个文件,跟我说是个PDF文件,结果下载完发现是个这样的文件
1.jpg
然后我用微软的新版edge浏览器可以直接打开。发过去后,跟我说打不开,我知道对方电脑知识比较差,所以试着还原出PDF给她看,但是在浏览器里右键没有菜单,Ctrl+P打印也没有内容,直接后缀改为.pdf,不行,直接拖到PDF阅读器和Word里面打开都不行,显示是下面这样不知什么乱七八糟的
2.jpg
然后来论坛搜了一下,发现也有人有类似的问题,是去年的事情了
3.jpg
好像也没有解决,于是还是自己试试吧
用文本编辑器打开这个html文件,发现里面是把Ctrl+s,Ctrl+p,F12都屏蔽了,不过发现了下面的数据
4.png
看了下 PDFData 里这个字符串有41865288个字符,应该就是原始的PDF文件了,别的地方就是类似阅读器一样的东西,控制加密的,将这个字符串存到一个新的文件中,进行Base64解码,Linux下面直接有base64这个命令,然而我是Windows,百度了一下发现也有类似的命令,是CertUtil,在powershell环境下可以用,格式如下
[Shell] 纯文本查看 复制代码
certutil -decode infile outfile

然后得到一个29.9 MB的PDF文件,打开一看,还需要密码。。。PDF也是加密过的,淦
这里我真搞不定了,然后网上搜了一下发现有人碰到同样的问题,上图中那个encode_version那一行就是存的加密信息,然而悲催的是,网上那个大神碰到的是sojson.v5加密,他直接找到个在线js解密网站就解出了密码,我这个是jsjiami.com.v5,解出来的信息还是不行,看不出密码,看来这些加密的人也在进步啊,找到jsjiami这个网站,号称是最牛js加密,我这个小白实在是没法了。抱着最后一丝希望,我把网上那个大神解出来的密码填进去试了一下,竟然是对的,哈哈哈,看来他们只是升级了加密方法,却没有改密码,这是我没想到的。
最后把这段加密过的代码放上来,有厉害的大神能解密的,可以试试
[JavaScript] 纯文本查看 复制代码
var encode_version = 'jsjiami.com.v5', hipig = '__0xac064',  __0xac064=['wpXDuHHCpsOjLQ==','w6fDvMKLJ8O4w4F8HQU=','w53Dv3HCp8Olc8ODWQ==','GG4EesO+OTxAwoglw6wnw4zCicKfwo5Vw7Vgw44cwpfCpCQowpXCi8K4','wpXDqsOywp7Dpw==','wq3DssKpwqXDuQ==','CsOQwrI9YRRY','ejopw4/DtsKfR2LDlRc=','QXR1wp9NMg==','w6lHMsKI','wpTDuGDCuMOhJsKS','FBPDmQ==','w53DuMO/woTDtsKNOkw=','wpPDs3TCscOmLMKZEBU=','dMOIw7I=','54ml5py95Y+s77+0Uynkv67lr63mnoblvY7nqJTvvbvovIPorIbmlJTmjZ/miLnkuLrnmLzltbTkv5U=','5YuW6Zuv54ml5p6B5Y+i7723YxvkvanlrZ/mnY/lv5vnq5M=','VVI7IBI=','w6xSKcKLwqgkasK+WMOqYx/CjsOiFsKBMcORNsKNwpQgWDXClBDDjMKR','G8OcwoDCkm0=','czZlJmM=','wrbCunAnwog=','aicqw47DgcKCSmnDsw==','bsKvwoZJPH8m','Mi5ew7pMw5I=','esONw6RBw5k=','w6HDgGLDmWHCigU=','EGoefMKwMA==','wpQTw6Q=','M8K4wprCsSk=','wqXDtMKwwpvDoi0Bwr3CnynDncKkwrho','WTbDmMKGwrc=','wpgPw7Rrw7h+w4Q=','bCNnKGN/','BXNjwqpYTw==','wr7DvcKSwqjDgA==','wpHDilfDkcOkw7LCv8OIRsKM','SsKZw4N7CQ==','w6XDv3PDjEM=','eMK3wq5Uw7g=','w4DDnsKBEw==','woDDh0XDk8OIw7PCqMOITcKrw58s','CMKgwpE=','SEbCqsKZ','FjHDvMOgwoErwoYs','wqRZw7k=','6L635Zux5L6U5oOh77+/','bClu','5Yqi5L6Q5q+i5pex77+B','5oGZ5Y6O5Lm15q2t5bq46Zi06K2Z77yB','w43Dm8KDCsKhCytk'];(function(_0x189fe7,_0x321225){var _0x1e7814=function(_0x586cec){while(--_0x586cec){_0x189fe7['push'](_0x189fe7['shift']());}};_0x1e7814(++_0x321225);}(__0xac064,0xc1));var _0x4146=function(_0x356db0,_0x19e83c){_0x356db0=_0x356db0-0x0;var _0xfcb912=__0xac064[_0x356db0];if(_0x4146['initialized']===undefined){(function(){var _0x25c818=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x2db4fe='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x25c818['atob']||(_0x25c818['atob']=function(_0x4f007e){var _0x13f62b=String(_0x4f007e)['replace'](/=+$/,'');for(var _0xef15ef=0x0,_0x1d6e04,_0x511588,_0x588e62=0x0,_0x1aceaa='';_0x511588=_0x13f62b['charAt'](_0x588e62++);~_0x511588&&(_0x1d6e04=_0xef15ef%0x4?_0x1d6e04*0x40+_0x511588:_0x511588,_0xef15ef++%0x4)?_0x1aceaa+=String['fromCharCode'](0xff&_0x1d6e04>>(-0x2*_0xef15ef&0x6)):0x0){_0x511588=_0x2db4fe['indexOf'](_0x511588);}return _0x1aceaa;});}());var _0x4d53f6=function(_0x32dee5,_0x36d12b){var _0xa9b695=[],_0x56d6bc=0x0,_0x3dae33,_0x266bd5='',_0x3a3f36='';_0x32dee5=atob(_0x32dee5);for(var _0x557d69=0x0,_0xcd99aa=_0x32dee5['length'];_0x557d69<_0xcd99aa;_0x557d69++){_0x3a3f36+='%'+('00'+_0x32dee5['charCodeAt'](_0x557d69)['toString'](0x10))['slice'](-0x2);}_0x32dee5=decodeURIComponent(_0x3a3f36);for(var _0x25856d=0x0;_0x25856d<0x100;_0x25856d++){_0xa9b695[_0x25856d]=_0x25856d;}for(_0x25856d=0x0;_0x25856d<0x100;_0x25856d++){_0x56d6bc=(_0x56d6bc+_0xa9b695[_0x25856d]+_0x36d12b['charCodeAt'](_0x25856d%_0x36d12b['length']))%0x100;_0x3dae33=_0xa9b695[_0x25856d];_0xa9b695[_0x25856d]=_0xa9b695[_0x56d6bc];_0xa9b695[_0x56d6bc]=_0x3dae33;}_0x25856d=0x0;_0x56d6bc=0x0;for(var _0x41643a=0x0;_0x41643a<_0x32dee5['length'];_0x41643a++){_0x25856d=(_0x25856d+0x1)%0x100;_0x56d6bc=(_0x56d6bc+_0xa9b695[_0x25856d])%0x100;_0x3dae33=_0xa9b695[_0x25856d];_0xa9b695[_0x25856d]=_0xa9b695[_0x56d6bc];_0xa9b695[_0x56d6bc]=_0x3dae33;_0x266bd5+=String['fromCharCode'](_0x32dee5['charCodeAt'](_0x41643a)^_0xa9b695[(_0xa9b695[_0x25856d]+_0xa9b695[_0x56d6bc])%0x100]);}return _0x266bd5;};_0x4146['rc4']=_0x4d53f6;_0x4146['data']={};_0x4146['initialized']=!![];}var _0x16cb50=_0x4146['data'][_0x356db0];if(_0x16cb50===undefined){if(_0x4146['once']===undefined){_0x4146['once']=!![];}_0xfcb912=_0x4146['rc4'](_0xfcb912,_0x19e83c);_0x4146['data'][_0x356db0]=_0xfcb912;}else{_0xfcb912=_0x16cb50;}return _0xfcb912;};var htmlobj=$[_0x4146('0x0','A&!J')]({'url':'http://39.104.67.211:8002/api/retrieve/chinese_read?read_token='+read_token,'async':![]});var data=htmlobj[_0x4146('0x1','!X[!')];var msg=data[_0x4146('0x2','tY[2')];var num=data[_0x4146('0x3',')xSJ')][_0x4146('0x4','eB*$')];console[_0x4146('0x5','MQM4')](_0x4146('0x6','*5dB'),msg);console[_0x4146('0x7','bNv7')](_0x4146('0x8','hL3U'),num);if(msg=='查询成功'){alert(_0x4146('0x9','Zr4M'));var DEFAULT_URL='';var pdfUrl=document[_0x4146('0xa','A&!J')][_0x4146('0xb','qPv5')][_0x4146('0xc','TaFo')](0x1);if(null==pdfUrl||''==pdfUrl){var BASE64_MARKER=_0x4146('0xd','qPv5');var preFileId='';var pdfAsDataUri=_0x4146('0xe','z*sM')+PDFData;var pdfAsArray=convertDataURIToBinary(pdfAsDataUri);DEFAULT_URL=pdfAsArray;function convertDataURIToBinary(_0x199de2){var _0x23ce75={'busWz':function _0x12bb0c(_0x150639,_0x34f7a6){return _0x150639+_0x34f7a6;}};var _0x242bff='0|4|3|2|6|1|5'[_0x4146('0xf','reoE')]('|'),_0x200204=0x0;while(!![]){switch(_0x242bff[_0x200204++]){case'0':var _0x4d8629=_0x23ce75[_0x4146('0x10','*91K')](_0x199de2[_0x4146('0x11','#yjo')](BASE64_MARKER),BASE64_MARKER['length']);continue;case'1':for(i=0x0;i<_0x5bdad4;i++){_0x5314ee[i]=_0x4fbb5d[_0x4146('0x12','^Fp5')](i)&0xff;}continue;case'2':var _0x5bdad4=_0x4fbb5d[_0x4146('0x13','7k%*')];continue;case'3':var _0x4fbb5d=window[_0x4146('0x14','T$TS')](_0x4afd6d);continue;case'4':var _0x4afd6d=_0x199de2['substring'](_0x4d8629)[_0x4146('0x15','qPv5')](/[\n\r]/g,'');continue;case'5':return _0x5314ee;case'6':var _0x5314ee=new Uint8Array(new ArrayBuffer(_0x5bdad4));continue;}break;}}}}else{alert('您阅读的时间已经到期,如果想继续观看,请使用阅读码联系管理员!阅读码&#65533;'+read_token);};(function(_0x37d3e0,_0xeb5847,_0x126c12){var _0x463375={'ftwOU':function _0x44e7ac(_0x4a718e,_0x4667ba){return _0x4a718e!==_0x4667ba;},'oXBiz':_0x4146('0x16','eB*$'),'OTFgr':_0x4146('0x17','reoE'),'TbKrA':function _0x57e90a(_0x1c600b,_0x51858a){return _0x1c600b+_0x51858a;},'KojaT':_0x4146('0x18','qPv5'),'VklwI':function _0x202761(_0x480c74,_0x500c0c){return _0x480c74===_0x500c0c;},'xKisK':_0x4146('0x19','EkKt'),'qzHZC':function _0x34f705(_0x25b99c,_0x174de6){return _0x25b99c<_0x174de6;},'yJUUP':function _0x425d01(_0x1be7fb,_0x48fbdd){return _0x1be7fb&_0x48fbdd;},'UEbaB':function _0x4c7c07(_0x45b648,_0x14be40){return _0x45b648+_0x14be40;},'mQupZ':_0x4146('0x1a','7k%*'),'gtKOZ':_0x4146('0x1b','Llzb')};_0x126c12='al';try{if(_0x463375['ftwOU'](_0x463375[_0x4146('0x1c','PCoI')],_0x463375['oXBiz'])){var _0x866f47=_0x463375['OTFgr'];var _0x28bda5='';var _0x787dab=_0x463375['TbKrA'](_0x4146('0x1d','T$TS'),PDFData);var _0x243553=_0x338e58(_0x787dab);DEFAULT_URL=_0x243553;function _0x338e58(_0x3dd78e){var _0x21dc7c={'vMkBj':'6|4|3|5|2|1|0','dkbDI':function _0xc6e3a6(_0x5608ce,_0x5d5ac1){return _0x5608ce<_0x5d5ac1;},'deOpg':function _0x38164e(_0x300369,_0x3c9c5a){return _0x300369&_0x3c9c5a;},'FFdAZ':function _0x294700(_0xcb0dc2,_0x215eb3){return _0xcb0dc2+_0x215eb3;}};var _0x1a3f6b=_0x21dc7c[_0x4146('0x1e','c)r7')][_0x4146('0x1f','bNv7')]('|'),_0x383437=0x0;while(!![]){switch(_0x1a3f6b[_0x383437++]){case'0':return _0xb0b3aa;case'1':for(i=0x0;_0x21dc7c['dkbDI'](i,_0x2cee80);i++){_0xb0b3aa[i]=_0x21dc7c[_0x4146('0x20','lIX5')](_0x3addb1['charCodeAt'](i),0xff);}continue;case'2':var _0xb0b3aa=new Uint8Array(new ArrayBuffer(_0x2cee80));continue;case'3':var _0x3addb1=window['atob'](_0x4504fc);continue;case'4':var _0x4504fc=_0x3dd78e[_0x4146('0x21','^Fp5')](_0x592b62)[_0x4146('0x22','FBPJ')](/[\n\r]/g,'');continue;case'5':var _0x2cee80=_0x3addb1[_0x4146('0x23','H@&G')];continue;case'6':var _0x592b62=_0x21dc7c[_0x4146('0x24','EkKt')](_0x3dd78e[_0x4146('0x25','f&G@')](_0x866f47),_0x866f47[_0x4146('0x26','z*sM')]);continue;}break;}}}else{_0x126c12+=_0x4146('0x27','Zr4M');_0xeb5847=encode_version;if(!(typeof _0xeb5847!==_0x463375['KojaT']&&_0x463375[_0x4146('0x28','tY[2')](_0xeb5847,_0x4146('0x29','*91K')))){if(_0x463375['VklwI']('lFb',_0x463375[_0x4146('0x2a','Waoq')])){var _0x47f933=dataURI[_0x4146('0x2b','Zr4M')](BASE64_MARKER)+BASE64_MARKER[_0x4146('0x2c','bNv7')];var _0x343c1f=dataURI['substring'](_0x47f933)[_0x4146('0x22','FBPJ')](/[\n\r]/g,'');var _0x13ddf2=window['atob'](_0x343c1f);var _0x534d1f=_0x13ddf2[_0x4146('0x2d','9Sl]')];var _0x2e92d5=new Uint8Array(new ArrayBuffer(_0x534d1f));for(i=0x0;_0x463375[_0x4146('0x2e','*91K')](i,_0x534d1f);i++){_0x2e92d5[i]=_0x463375['yJUUP'](_0x13ddf2[_0x4146('0x2f','!X[!')](i),0xff);}return _0x2e92d5;}else{_0x37d3e0[_0x126c12](_0x463375[_0x4146('0x30','FQ5M')]('删除',_0x463375[_0x4146('0x31','f&G@')]));}}}}catch(_0x2dd699){_0x37d3e0[_0x126c12](_0x463375[_0x4146('0x32','X7qp')]);}}(window));;encode_version = 'jsjiami.com.v5';

上面这段就是附件里的代码
更新文件链接: https://pan.baidu.com/s/1T3ekSFio8w22KBOvRVe04w 提取码: n8c5

免费评分

参与人数 7吾爱币 +8 热心值 +5 收起 理由
Huangyc + 1 + 1 谢谢@Thanks!
金城侠客 + 1 + 1 谢谢@Thanks!非常感谢您的帮助!
暮寒 + 1 + 1 用心讨论,共获提升!
0xLemonade + 1 谢谢@Thanks!
tailor001 + 1 + 1 谢谢@Thanks!
nullable + 1 支持技术分享
千城忆梦 + 2 + 1 谢谢@Thanks!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| 看门猫 发表于 2021-7-22 10:04
nullable 发表于 2021-7-21 08:35
之前有一个论坛里面求解密pdf网页的帖子,那会儿我也没细看,大概记得这种通过js加密的html好像也就是通过 ...

我整个了PDF转码后自己套进去他那个HTML文件中,发现用edge打开后就是正常文字,虽然右键没有菜单,但是文字确实是可以选中Ctrl+C复制出来的,并没有被转成图片
 楼主| 看门猫 发表于 2021-7-22 10:02
wss0823 发表于 2021-7-22 09:22
感觉这个js的主要作用是混淆网页,PDF文件并没有收到复写,还是原来的文件。

正解,我整个了PDF转码后自己套进去他那个HTML文件中,发现用edge打开后就是正常文字,虽然右键没有菜单,但是文字确实是可以选中Ctrl+C复制出来的,并没有被转成图片
lj5366477 发表于 2021-7-19 19:44
 楼主| 看门猫 发表于 2021-7-19 21:30

不好意思,新手第一次发帖,不知道怎么设置附件免费,我又重新编辑了一下,把附件中的代码贴出来了了
魔术使nqy 发表于 2021-7-20 12:41
膜拜大神,好厉害
dayer 发表于 2021-7-20 13:36
为啥不把html的源文件发出来。。。。
Kaiter_Plus 发表于 2021-7-20 14:11
感谢楼主分享!
axy 发表于 2021-7-20 14:23
HTML文件呢?
1sina 发表于 2021-7-20 14:40
强势围观
nullable 发表于 2021-7-21 08:35
之前有一个论坛里面求解密pdf网页的帖子,那会儿我也没细看,大概记得这种通过js加密的html好像也就是通过把每一页pdf转成了图片,然后限制浏览器打开图片之类的办法来控制可否访问和密码访问的
简宇 发表于 2021-7-21 09:39
多谢分享,学习一下~
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-25 01:52

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表