Skip to content

Commit

Permalink
Merge pull request #82 from apernet/update-fet
Browse files Browse the repository at this point in the history
feat: update FET analyzer to better reflect what's described in the paper
  • Loading branch information
tobyxdd authored Feb 26, 2024
2 parents 420286a + 797dce3 commit 5d2d874
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions analyzer/tcp/fet.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ func isTLSorHTTP(bytes []byte) bool {
if len(bytes) < 3 {
return false
}
if bytes[0] == 0x16 && bytes[1] == 0x03 && bytes[2] <= 0x03 {
// TLS handshake for TLS 1.0-1.3
// "We observe that the GFW exempts any connection whose first
// three bytes match the following regular expression:
// [\x16-\x17]\x03[\x00-\x09]" - from the paper in Section 4.3
if bytes[0] >= 0x16 && bytes[0] <= 0x17 &&
bytes[1] == 0x03 && bytes[2] <= 0x09 {
return true
}
// HTTP request
Expand Down

0 comments on commit 5d2d874

Please sign in to comment.