Skip to content

Commit 834d027

Browse files
committed
Add low MSS TCP option identifier
1 parent 453e672 commit 834d027

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

badcapt.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var defaultMarkers = []Marker{
2828
MiraiIdentifier,
2929
ZmapIdentifier,
3030
MasscanIdentifier,
31+
LowMSSIdentifier,
3132
}
3233

3334
// Badcapt defines badcapt configuration

low_mss.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package badcapt
2+
3+
import (
4+
"encoding/binary"
5+
6+
"github.com/google/gopacket"
7+
"github.com/google/gopacket/layers"
8+
)
9+
10+
// LowMSSIdentifier adds low-mss tag for a packet which TCP Maximum Segment
11+
// Size is less than 500. This fact indicates potential SACK Panic attack
12+
// (CVE-2019-11477).
13+
// Details: https://github.com/Netflix/security-bulletins/blob/master/advisories/third-party/2019-001.md#1-cve-2019-11477-sack-panic-linux--2629
14+
func LowMSSIdentifier(p gopacket.Packet) []string {
15+
tcp := unpackTCP(p)
16+
if tcp == nil {
17+
return nil
18+
}
19+
20+
if tcp.SYN == false {
21+
return nil
22+
}
23+
24+
for _, o := range tcp.Options {
25+
if o.OptionType == layers.TCPOptionKindMSS && binary.BigEndian.Uint16(o.OptionData) < 500 {
26+
return []string{"low-mss"}
27+
}
28+
}
29+
30+
return nil
31+
}

0 commit comments

Comments
 (0)