Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 70eb425

Browse files
committed
修复:优先从 IHttpService 获取的 Host 值与实际请求不一致,导致指纹识别结果无法显示的问题
1 parent 7c3aa01 commit 70eb425

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

extender/src/main/java/burp/vaycore/onescan/info/OneScanInfoTab.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,27 @@ private String getRespBody(IResponseInfo info, byte[] content) {
208208
return new String(content, bodyOffset, bodySize, StandardCharsets.UTF_8);
209209
}
210210

211+
/**
212+
* 通过 IRequestInfo 实例,获取请求头中的 Host 值(示例格式:x.x.x.x、x.x.x.x:8080)
213+
*
214+
* @return 失败返回null
215+
*/
211216
private String getRequestHost(IRequestInfo info) {
212-
// 优先使用从 IHttpService 获取的 Host 值
213-
String host = getRequestHost();
214-
if (StringUtils.isNotEmpty(host)) {
215-
return host;
216-
}
217217
if (info == null) {
218218
return null;
219219
}
220-
// HTTP 请求头中获取 Host 值
220+
// 优先使用从 HTTP 请求头中获取的 Host 值
221221
List<String> headers = info.getHeaders();
222222
for (String header : headers) {
223223
if (header.startsWith("Host: ")) {
224224
return header.replace("Host: ", "");
225225
}
226226
}
227+
// 从 IHttpService 获取的 Host 值
228+
String host = getRequestHost();
229+
if (StringUtils.isNotEmpty(host)) {
230+
return host;
231+
}
227232
return null;
228233
}
229234

0 commit comments

Comments
 (0)