流量加密怎么办?主流webshell管理工具流量解密分析( 四 )

 
3.4.3 AspEvalBase64
请求为明文转送一部分代码,并将执行数据作为代码中一个变量传输,响应为base64首尾填充6位
public byte[] E(byte[] cs) {return (this.pass + "=" + this.chopperRequest + "&" + this.shell.getSecretKey() + "=" + URLEncoder.encode(functions.base64EncodeToString(cs))).getBytes();}public byte[] D(String data) {byte[] cs = functions.base64Decode(data);return cs;} 
3.4.4 AspXorBae64
加密方式为base64+xor
响应首尾填充6位
public byte[] encode(byte[] data) {try {return this.E(data);} catch (Exception var3) {Log.error(var3);return null;}}public byte[] decode(byte[] data) {if (data != null && data.length > 0) {try {return this.D(this.findStr(data));} catch (Exception var3) {Log.error(var3);return null;}} else {return data;}}protected void decryption(byte[] data, byte[] key) {int len = data.length;int keyLen = key.length;int index = false;for(int i = 1; i <= len; ++i) {int index = i - 1;data[index] ^= key[i % keyLen];}}public byte[] E(byte[] cs) {this.decryption(cs, this.key);return (this.pass + "=" + URLEncoder.encode(functions.base64EncodeToString(cs))).getBytes();}public byte[] D(String data) {byte[] cs = functions.base64Decode(data);this.decryption(cs, this.key);return cs;} 
3.4.5 AspXorRaw
加密方式为xor
其中,super.decryption即为xor函数
public byte[] encode(byte[] data) {try {super.decryption(data, this.key);return data;} catch (Exception var3) {Log.error(var3);return null;}}public byte[] decode(byte[] data) {if (data != null && data.length > 0) {try {super.decryption(data, this.key);return data;} catch (Exception var3) {Log.error(var3);return null;}} else {return data;}} 
四、解密脚本
公众号回复“webshell”获取解密脚本链接
使用方法:
按照加密类型、key和pass,初始化类 。然后输入字节流形式的请求/响应体,调用相应的加/解密函数即可 。
如下例子:
```Python/ target=_blank class=infotextkey>Pythondecrypter = PHP_XOR_BASE64(pass_='pass', key='3c6e0b8a9c15224a')data = https://www.isolves.com/it/wl/js/2022-07-20/decrypter.decrypt_req_payload(b'pass=DlMRWA1cL1gOVDc2MjRhRwZFEQ==')print(data)data = decrypter.decrypt_res_payload(b'72a9c691ccdaab98fL1tMGI4YTljO/79NDQm7r9PZzBiOA==b4c4e1f6ddd2a488')print(data)```



推荐阅读