Skip to content

Commit f53d0a1

Browse files
author
githubnull
committed
feat(burp): 添加会话Header和持久化Header规则提交功能 - 新增提交会话Header菜单(仅单条请求时显示) - 新增提交Header规则菜单(仅单条请求时显示) - 支持配置作用域、替换策略、优先级等 - 自动识别常见会话Header并默认勾选 - 两端插件(montoya-api/legacy-api)同步实现
1 parent 36a1c12 commit f53d0a1

5 files changed

Lines changed: 1375 additions & 0 deletions

File tree

src/burpEx/legacy-api/src/main/java/com/sqlmapwebui/burp/ApiClient.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,48 @@ public String resetTempDirConfig() throws IOException {
207207
return response.body() != null ? response.body().string() : "";
208208
}
209209
}
210+
211+
/**
212+
* 提交会话Header到后端
213+
* @param jsonPayload JSON格式的会话Header数据
214+
* @return 响应字符串
215+
*/
216+
public String sendSessionHeaders(String jsonPayload) throws IOException {
217+
RequestBody body = RequestBody.create(jsonPayload, JSON);
218+
219+
Request request = new Request.Builder()
220+
.url(baseUrl + "/api/commonApi/header/session-headers")
221+
.post(body)
222+
.addHeader("Content-Type", "application/json")
223+
.build();
224+
225+
try (Response response = httpClient.newCall(request).execute()) {
226+
if (!response.isSuccessful()) {
227+
throw new IOException("Failed to send session headers: " + response.code());
228+
}
229+
return response.body() != null ? response.body().string() : "";
230+
}
231+
}
232+
233+
/**
234+
* 提交持久化Header规则到后端
235+
* @param jsonPayload JSON格式的Header规则数据
236+
* @return 响应字符串
237+
*/
238+
public String sendHeaderRule(String jsonPayload) throws IOException {
239+
RequestBody body = RequestBody.create(jsonPayload, JSON);
240+
241+
Request request = new Request.Builder()
242+
.url(baseUrl + "/api/commonApi/header/persistent-header-rules")
243+
.post(body)
244+
.addHeader("Content-Type", "application/json")
245+
.build();
246+
247+
try (Response response = httpClient.newCall(request).execute()) {
248+
if (!response.isSuccessful()) {
249+
throw new IOException("Failed to send header rule: " + response.code());
250+
}
251+
return response.body() != null ? response.body().string() : "";
252+
}
253+
}
210254
}

0 commit comments

Comments
 (0)