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

Commit 96a9051

Browse files
committed
优化:指纹识别模块中处理请求数据包的正则表达式
1 parent 4482596 commit 96a9051

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

extender/src/main/java/burp/vaycore/onescan/bean/FpHttpDS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public abstract class FpHttpDS extends FpDataSource {
1818
/**
1919
* 检测请求行格式正则表达式
2020
*/
21-
private static final Pattern REGEX_REQ_LINE = Pattern.compile("^([a-zA-Z]+)\\s+\\S+\\s+HTTP/\\d+\\.\\d+",
21+
private static final Pattern REGEX_REQ_LINE = Pattern.compile("^[A-Z]+\\s+.*?\\s+HTTP/\\d+(?:\\.\\d+)?",
2222
Pattern.CASE_INSENSITIVE);
2323

2424
/**

extender/src/main/java/burp/vaycore/onescan/bean/FpHttpReqDS.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ public class FpHttpReqDS extends FpHttpDS {
1515
/**
1616
* 获取请求方法正则表达式
1717
*/
18-
private static final Pattern REGEX_REQ_METHOD = Pattern.compile("^([a-zA-Z]+)\\s+\\S+\\s+HTTP/\\d+\\.\\d+",
18+
private static final Pattern REGEX_REQ_METHOD = Pattern.compile("^([A-Z]+)\\s+.*?\\s+HTTP/\\d+(?:\\.\\d+)?",
1919
Pattern.CASE_INSENSITIVE);
2020

2121
/**
2222
* 获取请求 URL 正则表达式
2323
*/
24-
private static final Pattern REGEX_REQ_URL = Pattern.compile("[a-zA-Z]+\\s(.*?)\\sHTTP/",
24+
private static final Pattern REGEX_REQ_URL = Pattern.compile("[A-Z]+\\s+(.*?)\\s+HTTP/",
2525
Pattern.CASE_INSENSITIVE);
2626

2727
private final String method;
@@ -30,7 +30,7 @@ public class FpHttpReqDS extends FpHttpDS {
3030
public FpHttpReqDS(byte[] data, Charset charset) {
3131
super(data, charset);
3232
this.method = fetchRegexResult(REGEX_REQ_METHOD, getFirstLine());
33-
this.url = fetchRegexResult(REGEX_REQ_URL, getHeader());
33+
this.url = fetchRegexResult(REGEX_REQ_URL, getFirstLine());
3434
}
3535

3636
@Override

0 commit comments

Comments
 (0)