(IContextMenuInvocation iContextMenuInvocation, String selectString)
| 37 | } |
| 38 | |
| 39 | public static void Encode(IContextMenuInvocation iContextMenuInvocation, String selectString) throws Exception { |
| 40 | //获取原请求信息 |
| 41 | IHttpRequestResponse currentRequest = iContextMenuInvocation.getSelectedMessages()[0]; |
| 42 | IRequestInfo requestInfo = BurpExtender.helpers.analyzeRequest(currentRequest); |
| 43 | List<String> headers = requestInfo.getHeaders(); |
| 44 | String[] respDecodeParams = IndexautoDecoder.getRespDecodeParams(); // 获取解密数组 |
| 45 | |
| 46 | if (IndexautoDecoder.getRadioButton1State()) { // 自带加解密 |
| 47 | //更新header |
| 48 | String decode_text = encryptKeyivmode(selectString, respDecodeParams[5], respDecodeParams[6], respDecodeParams[0], respDecodeParams[1], respDecodeParams[2], respDecodeParams[3], respDecodeParams[4]); |
| 49 | byte[] newMessage = BurpExtender.helpers.buildHttpMessage(headers, getHttpRequestBody(currentRequest,selectString, decode_text)); |
| 50 | |
| 51 | currentRequest.setRequest(newMessage); |
| 52 | }else if(IndexautoDecoder.getRadioButton2State()){ // 接口加解密 |
| 53 | //更新header |
| 54 | String decodeTotal = sendPostnew(IndexautoDecoder.getEncodeApi(), selectString); |
| 55 | byte[] newMessage = BurpExtender.helpers.buildHttpMessage(headers, getHttpRequestBody(currentRequest, selectString ,decodeTotal)); |
| 56 | currentRequest.setRequest(newMessage); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | private static byte[] getHttpRequestBody(IHttpRequestResponse httpRequestResponse, String codeString , String selectString) { |
| 61 | byte[] request = httpRequestResponse.getRequest(); |
no test coverage detected