Skip to content

Commit

Permalink
adding tcpsequencer borrowed from project naabu
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberRoute committed Jan 29, 2024
1 parent 8aa81f4 commit 1f8c2e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scanme/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Scanner struct {
handle *pcap.Handle
opts gopacket.SerializeOptions
buf gopacket.SerializeBuffer
tcpsequencer *TCPSequencer

Check failure on line 29 in scanme/scanner.go

View workflow job for this annotation

GitHub Actions / lint

undefined: TCPSequencer
}

// newScanner creates a new scanner for a given destination IP address, using
Expand All @@ -37,7 +38,8 @@ func NewScanner(ip net.IP, router routing.Router) (*Scanner, error) {
FixLengths: true,
ComputeChecksums: true,
},
buf: gopacket.NewSerializeBuffer(),
buf: gopacket.NewSerializeBuffer(),
tcpsequencer: NewTCPSequencer(),

Check failure on line 42 in scanme/scanner.go

View workflow job for this annotation

GitHub Actions / lint

undefined: NewTCPSequencer (typecheck)
}

iface, gw, src, err := router.Route(ip)
Expand Down Expand Up @@ -423,7 +425,7 @@ func (s *Scanner) SendSynTCP4(ip string, p layers.TCPPort) {
DstPort: p,
Window: 1024,
Options: []layers.TCPOption{tcpOption},
Seq: 1105024978,
Seq: s.tcpsequencer.Next(),
SYN: true,
}

Expand Down Expand Up @@ -502,7 +504,7 @@ func (s *Scanner) SendSynTCP6(ip string, p layers.TCPPort) {
DstPort: p,
Window: 1024,
Options: []layers.TCPOption{tcpOption},
Seq: 1105024978,
Seq: s.tcpsequencer.Next(),
SYN: true,
}

Expand Down

0 comments on commit 1f8c2e0

Please sign in to comment.