2019年4月15号时候华为还能通过这种方法查询应聘状态https://www.cnblogs.com/Mufasa/p/10291251.html
结果4月17日突然将状态加密了(后面估计还会换)
那该怎么办呢?细心的人会浏览对应网页所包含的js文件(毕竟前端内容可以得到)
用chrome打开会发现带了以下js文件,其中绿红键头的最为关键
、
绿色是获取的密文json
红色则有个很有趣的东西
竟然有私钥!,仔细观察,这是用了一个JSEncrypt的库使用RSA,服务端公钥加密,浏览器私钥解密。
也就是说,因为私钥直接写死在本地js里了,所以把密文拿到手后就可以直接用私钥解密。
它用到了encryptLong2 decryptLong2方法,它是旧包没有的做长串的加密,https://blog.csdn.net/KokJuis/article/details/80406042
https://blog.csdn.net/xfyc002/article/details/85235491
这里引用一篇对应的jsencrypt使用的文章:https://blog.csdn.net/xfyc002/article/details/85235491
方便起见偶就直接改这个就下面得到了这个程序:
jsdecrypt 包:https://download.csdn.net/download/kokjuis/10429753
http://code.jquery.com/jquery-1.8.3.min.js
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<script src="jquery-1.8.3.min.js"></script>
<script src="jsencrypt.min.js"></script>
<script type="text/javascript">
$(function() {
$('#testme').click(function() {
// 进行RSA加密
var encrypt = new JSEncrypt();
//获取公钥
encrypt.setPublicKey($('#pubkey').val());
//公钥加密
var encrypted = $('#jiami').val();
// 加密后的密文
$('#jiami').val(encrypted);
//解密
var decrypt = new JSEncrypt();
//获取私钥
decrypt.setPrivateKey($('#privkey').val());
//解药
var uncrypted = decrypt.decryptLong2(encrypted);
var uncry = decodeURIComponent(uncrypted);
$('#jiemi').val(uncry);
});
});
</script>
</head>
<body>
<div>
<label for="privkey">私钥</label>
<br/>
<textarea id="privkey" rows="15" cols="65">MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK0UVX5n7zgk7KXtBT4oCgTo/rMwzxnhNi1/I0gakyUtF28WHOYPUCespbF1IUong67usS43d0FlBCM8pe/gaZI0LNvIj+29gDfZpXGhtrjVrN+aP8gx0NHZI9kHaf38bbqqO+r7dXPckKY8twfVPYZIsdoL0gvxYIPTVm+A/QMfAgMBAAECgYA4shx/V9SI86+Beu7ouXzuttQYJrjwpVF1/du01t+0ody3SusUgZekJ23vf4r0G5WLTC1GEm1CQrDkSg2hUkXCT+pUETZEKD0svnFHG4JTpeLcxV/igbqGICrf+NhBwzb7JltraY92x5Ku+OBh606OPMAax+9S78mFh/t5yqGuYQJBAO0e4xLs1aclhn7++iK9R3gEHZMI3ZkOYABiReeSWZqygujlJNMpw9s/Oolibubm9411aV3N8LFDo8FiqkCwOKMCQQC63CBaUEXAxD0dz1+7iO5h06e+RmuB8nqvxVdcas9RK8JN+O3g/8tlU0AoGuVlY4+ZJrHubqGtMdjZgy4Rd0dVAkATsnEibVICJHfbrMqSgC6jpZPfVukxgaQv4/nylpGi7Bk7x20brWh7mfD+4JJd0+nUcmBiTm0kDH5Z3hxOa1UJAkEAsPabpSx0gtTWVI76SO6rY/ZA3FBwrEZprmEkFSAKawMYJyPilL1rcPBgyBqAuX6Kli4xQG+BqjaU+ZnkXSIraQJAaZKaXjoq4Ip7zGvHzLySNDAtdZyi868xakSf/B8C9fvDqboS48oRWTdV9RJmsWwd1oaPPo0E8DhO5Ix1kbEMew==</textarea>
<br/>
<br/>
<input id="testme" type="button" value="decrypt" />
<br/>
<label for="jiami">加密后的密文:</label>
<br/>
<textarea id="jiami" name="jiami" type="text" rows='15' cols='70'></textarea>
<br/>
<label for="pubkey">解密后的密文</label>
<br/>
<textarea id="jiemi" name="jiemi" type="text" rows='15' cols='70'></textarea>
</div>
</body>
</html>
然后填入自己的加密文本就可以得到正确信息。
结果网上也有大佬先发布了更简单的方法:
进入到职位进展页面,打开 Chrome 控制台,复制下面代码,回车:
fetch(
"http://career.huawei.com/reccampportal/services/portal/portaluser/queryMyJobInterviewEvolve?reqTim=" +
new Date().getTime()
)
.then(res => res.json())
.then(data => {
var n = null;
var i = new JSEncrypt();
i.setPrivateKey(
"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK0UVX5n7zgk7KXtBT4oCgTo/rMwzxnhNi1/I0gakyUtF28WHOYPUCespbF1IUong67usS43d0FlBCM8pe/gaZI0LNvIj+29gDfZpXGhtrjVrN+aP8gx0NHZI9kHaf38bbqqO+r7dXPckKY8twfVPYZIsdoL0gvxYIPTVm+A/QMfAgMBAAECgYA4shx/V9SI86+Beu7ouXzuttQYJrjwpVF1/du01t+0ody3SusUgZekJ23vf4r0G5WLTC1GEm1CQrDkSg2hUkXCT+pUETZEKD0svnFHG4JTpeLcxV/igbqGICrf+NhBwzb7JltraY92x5Ku+OBh606OPMAax+9S78mFh/t5yqGuYQJBAO0e4xLs1aclhn7++iK9R3gEHZMI3ZkOYABiReeSWZqygujlJNMpw9s/Oolibubm9411aV3N8LFDo8FiqkCwOKMCQQC63CBaUEXAxD0dz1+7iO5h06e+RmuB8nqvxVdcas9RK8JN+O3g/8tlU0AoGuVlY4+ZJrHubqGtMdjZgy4Rd0dVAkATsnEibVICJHfbrMqSgC6jpZPfVukxgaQv4/nylpGi7Bk7x20brWh7mfD+4JJd0+nUcmBiTm0kDH5Z3hxOa1UJAkEAsPabpSx0gtTWVI76SO6rY/ZA3FBwrEZprmEkFSAKawMYJyPilL1rcPBgyBqAuX6Kli4xQG+BqjaU+ZnkXSIraQJAaZKaXjoq4Ip7zGvHzLySNDAtdZyi868xakSf/B8C9fvDqboS48oRWTdV9RJmsWwd1oaPPo0E8DhO5Ix1kbEMew=="
),
(n = i.decryptLong2(data.cipherText)) &&
(n = JSON.parse(decodeURIComponent(n)));
console.log(JSON.stringify(n, 0, 4));
});
不过原理都是类似的。