MCPcopy Index your code
hub / github.com/f0ng/autoDecoder / Encode

Method Encode

src/Utils/ClickEncodeDecode.java:39–58  ·  view source on GitHub ↗
(IContextMenuInvocation iContextMenuInvocation, String selectString)

Source from the content-addressed store, hash-verified

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();

Callers 1

createMenuItemsMethod · 0.95

Calls 8

getRespDecodeParamsMethod · 0.95
getRadioButton1StateMethod · 0.95
getHttpRequestBodyMethod · 0.95
getRadioButton2StateMethod · 0.95
getEncodeApiMethod · 0.95
getHeadersMethod · 0.80
encryptKeyivmodeMethod · 0.80
sendPostnewMethod · 0.80

Tested by

no test coverage detected