时间:2020-10-22加入收藏
经过混淆,得到了混淆后的代码function hi() {
console.log("Hello World!");
}
hi();
去除字符转义['sojson.v4']["\x66\x69\x6c\x74\x65\x72"]["\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72"](((['sojson.v4']+[])["\x63\x6f\x6e\x73\x74\x72\x75\x63\x74\x6f\x72"]['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65']['\x61\x70\x70\x6c\x79'](null,"102x117m110e99c116x105I111Q110y32Q104O105a40f41T32D123A10j32A32p99t111I110d115M111S108u101t46k108D111U103O40P34Q72e101G108I108G111n32m87N111q114R108d100g33F34V41t59a10U125M10a104T105M40T41F59"['\x73\x70\x6c\x69\x74'](/[a-zA-Z]{1,}/))))('sojson.v4');
可以看到这是将代码还原后进行eval运行['sojson.v4']["filter"]["constructor"](((['sojson.v4'] + [])["constructor"]['fromCharCode']['apply'](null, "102x117m110e99c116x105I111Q110y32Q104O105a40f41T32D123A10j32A32p99t111I110d115M111S108u101t46k108D111U103O40P34Q72e101G108I108G111n32m87N111q114R108d100g33F34V41t59a10U125M10a104T105M40T41F59" ['split'](/[a-zA-Z]{1,}/))))('sojson.v4');
所以去掉这个eval外壳,在控制台运行,就可以得到源代码了eval => []["filter"]["constructor"]( CODE )()
这样就可以破解sojsonv4了((['sojson.v4'] + [])["constructor"]['fromCharCode']['apply'](null, "102x117m110e99c116x105I111Q110y32Q104O105a40f41T32D123A10j32A32p99t111I110d115M111S108u101t46k108D111U103O40P34Q72e101G108I108G111n32m87N111q114R108d100g33F34V41t59a10U125M10a104T105M40T41F59" ['split'](/[a-zA-Z]{1,}/)))
TGA: 技巧