shadow1ng/fscan · error

max packet count reached

Error message

max packet count reached

What it means

Sentinel error indicating the global packet-count cap (-pn/-max packet limit in Config) has been reached; wrapped in a PacketLimitError with Sentinel=ErrMaxPacketReached so callers can test with errors.Is. Fires when the currentTotal sent across the scan reaches maxPacketCount, causing CanSendPacket to refuse further sends.

Solutions

  1. Raise or disable the packet limit flag (e.g. -pn 0 / larger -num) if the traffic volume is expected
  2. Check the limit/current fields on PacketLimitError to confirm the cap that fired
  3. Split the scan into multiple runs with smaller target sets
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at common/globals.go:91 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/5bffdc7458ba87d9. Report an issue: GitHub.

Appendix: source

Thrown at common/globals.go:91

	commit  = "unknown"
	date    = "unknown"
)

func GetVersion() string { return version }

// 运行时数据已迁移到Config对象中,使用GetGlobalConfig()访问

// Shell状态已迁移到State对象中,使用GetGlobalState()访问

// POC配置、输出控制、发包控制、初始化已迁移到Config/State对象中

// =============================================================================
// 发包限制错误类型
// =============================================================================

// 哨兵错误 - 用于 errors.Is 判断
var (
	ErrMaxPacketReached  = errors.New("max packet count reached")
	ErrPacketRateLimited = errors.New("packet rate limited")
)

// PacketLimitError 发包限制错误(包含详情)
type PacketLimitError struct {
	Sentinel error // ErrMaxPacketReached 或 ErrPacketRateLimited
	Limit    int64
	Current  int64
}

func (e *PacketLimitError) Error() string {
	if e.Sentinel == ErrMaxPacketReached {
		return i18n.Tr("packet_limit_max_reached", e.Limit)
	}
	return i18n.Tr("packet_limit_rate_limited", e.Limit)
}

func (e *PacketLimitError) Unwrap() error {

View on GitHub (pinned to 95cc12e753)