Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/CheckLDAPStatus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (

func main() {
flag.Usage = func() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "LDAP signing and channel binding enumeration utility.")
fmt.Fprintln(os.Stderr)
Expand Down
2 changes: 1 addition & 1 deletion tools/DumpNTLMInfo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const EPOCH_DIFF = 116444736000000000

func main() {
flag.Usage = func() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Do NTLM authentication and parse information.")
fmt.Fprintln(os.Stderr)
Expand Down
3 changes: 2 additions & 1 deletion tools/describeTicket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/jcmturner/gokrb5/v8/messages"
"github.com/jcmturner/gokrb5/v8/types"

gopflags "github.com/mandiant/gopacket/pkg/flags"
"github.com/mandiant/gopacket/pkg/kerberos"
)

Expand Down Expand Up @@ -966,7 +967,7 @@ func loadCCacheSafe(path string) (ccache *credentials.CCache, err error) {
}

func printUsage() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(gopflags.Banner())
fmt.Println()
fmt.Println("Parses a ccache ticket file and displays credential information.")
fmt.Println("With a decryption key, decrypts the ticket and shows the full PAC.")
Expand Down
3 changes: 2 additions & 1 deletion tools/getArch/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/mandiant/gopacket/pkg/dcerpc"
"github.com/mandiant/gopacket/pkg/dcerpc/epmapper"
"github.com/mandiant/gopacket/pkg/dcerpc/header"
"github.com/mandiant/gopacket/pkg/flags"
"github.com/mandiant/gopacket/pkg/transport"
)

Expand Down Expand Up @@ -123,7 +124,7 @@ func checkArch(machine string, timeoutSec int) {
}

func printUsage() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()
fmt.Println("Gets the target system's OS architecture version")
fmt.Println()
Expand Down
2 changes: 1 addition & 1 deletion tools/karmaSMB/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ var NDR_UUID = []byte{

func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", flags.Banner())
fmt.Fprintf(os.Stderr, "For every file request received, this module will return the pathname\n")
fmt.Fprintf(os.Stderr, "contents based on extension matching.\n\n")
fmt.Fprintf(os.Stderr, "Usage: karmaSMB [options] pathname\n\n")
Expand Down
4 changes: 2 additions & 2 deletions tools/keylistattack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ func main() {
}

func usage() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
Performs the KERB-KEY-LIST-REQ attack to dump secrets from the remote machine
without executing any agent there.

Expand Down
2 changes: 1 addition & 1 deletion tools/lookupsid/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()
fmt.Printf("[*] Brute forcing SIDs at %s\n", target.Host)

Expand Down
2 changes: 1 addition & 1 deletion tools/mssqlclient/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
os.Exit(1)
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Parse target
Expand Down
6 changes: 3 additions & 3 deletions tools/mssqlinstance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var (

func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
SQL Server Browser Protocol discovery tool.

Queries the SQL Server Browser service (UDP 1434) to enumerate SQL Server
Expand Down Expand Up @@ -68,7 +68,7 @@ Note: Requires the SQL Server Browser service to be running on the target.
os.Exit(1)
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

target := flag.Arg(0)
Expand Down
4 changes: 2 additions & 2 deletions tools/net/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Connect via SMB
Expand Down Expand Up @@ -196,7 +196,7 @@ func main() {
}

func printUsage() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Usage: net [auth-flags] target <command> [command-flags]")
fmt.Fprintln(os.Stderr)
Expand Down
3 changes: 2 additions & 1 deletion tools/ntfs-read/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"path/filepath"
"strings"

"github.com/mandiant/gopacket/pkg/flags"
"github.com/mandiant/gopacket/pkg/ntfs"
)

Expand Down Expand Up @@ -400,7 +401,7 @@ func cleanPath(path string) string {
}

func printUsage() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()
fmt.Println("NTFS explorer (read-only)")
fmt.Println()
Expand Down
3 changes: 2 additions & 1 deletion tools/ping/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"os"
"time"

"github.com/mandiant/gopacket/pkg/flags"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv4"
)
Expand All @@ -32,7 +33,7 @@ const (

func main() {
if len(os.Args) < 3 {
fmt.Fprintf(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", flags.Banner())
fmt.Fprintf(os.Stderr, "Simple ICMP ping using raw sockets.\n\n")
fmt.Fprintf(os.Stderr, "Usage: %s <src ip> <dst ip>\n", os.Args[0])
fmt.Fprintf(os.Stderr, "\nNote: Requires root/CAP_NET_RAW privileges.\n")
Expand Down
3 changes: 2 additions & 1 deletion tools/ping6/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"os"
"time"

"github.com/mandiant/gopacket/pkg/flags"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv6"
)
Expand All @@ -30,7 +31,7 @@ const (
)

func main() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

if len(os.Args) < 3 {
Expand Down
4 changes: 2 additions & 2 deletions tools/rbcd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import (
)

func printUsage() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
usage: rbcd [-h] [-delegate-to DELEGATE_TO] [-delegate-from DELEGATE_FROM]
[-action {read,write,remove,flush}] [-use-ldaps] [-debug] [-ts]
[-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key]
Expand Down
4 changes: 2 additions & 2 deletions tools/reg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Connect via SMB
Expand Down Expand Up @@ -192,7 +192,7 @@ func main() {
}

func printUsage() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Usage: reg [auth-flags] target <command> [command-flags]")
fmt.Fprintln(os.Stderr)
Expand Down
2 changes: 1 addition & 1 deletion tools/rpcdump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func main() {
os.Exit(1)
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

target, creds, err := session.ParseTargetString(opts.TargetStr)
Expand Down
6 changes: 3 additions & 3 deletions tools/rpcmap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ type ifaceResult struct {

func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
Scans for listening MSRPC interfaces. Tries the MGMT interface first,
falls back to UUID bruteforce if MGMT is not available.

Expand Down Expand Up @@ -121,7 +121,7 @@ Examples:
os.Exit(1)
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

if *debug {
Expand Down
2 changes: 1 addition & 1 deletion tools/samrdump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()
fmt.Printf("[*] Retrieving endpoint list from %s\n", target.Host)

Expand Down
4 changes: 2 additions & 2 deletions tools/services/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Connect via SMB
Expand Down Expand Up @@ -390,7 +390,7 @@ func errorControlName(t uint32) string {
}

func printUsage() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Usage: services [auth-flags] target <action> [action-flags]")
fmt.Fprintln(os.Stderr)
Expand Down
2 changes: 1 addition & 1 deletion tools/smbserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (s *Server) GetShares() []*Share {

func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", flags.Banner())
fmt.Fprintf(os.Stderr, "usage: smbserver [-h] [-comment COMMENT] [-username USERNAME]\n")
fmt.Fprintf(os.Stderr, " [-password PASSWORD] [-hashes LMHASH:NTHASH] [-ts]\n")
fmt.Fprintf(os.Stderr, " [-debug] [-ip INTERFACE_ADDRESS] [-port PORT]\n")
Expand Down
7 changes: 4 additions & 3 deletions tools/sniff/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/mandiant/gopacket/pkg/flags"
)

// Supported datalink types
Expand All @@ -43,8 +44,8 @@ var (

func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
Simple packet sniffer using pcap.

Usage: %s [options] [BPF filter]
Expand All @@ -65,7 +66,7 @@ Note: Requires root/CAP_NET_RAW privileges.

flag.Parse()

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// List interfaces mode
Expand Down
3 changes: 2 additions & 1 deletion tools/sniffer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/mandiant/gopacket/pkg/flags"
)

// Protocol name to number mapping
Expand All @@ -40,7 +41,7 @@ var protoMap = map[string]int{
}

func main() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Default protocols if none specified
Expand Down
3 changes: 2 additions & 1 deletion tools/split/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/pcapgo"
"github.com/mandiant/gopacket/pkg/flags"
)

// Supported datalink types
Expand Down Expand Up @@ -61,7 +62,7 @@ type ConnectionWriter struct {
}

func main() {
fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()
fmt.Println("[!] This tool is deprecated and may be removed in future versions.")
fmt.Println()
Expand Down
3 changes: 2 additions & 1 deletion tools/ticketer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"strings"

"github.com/mandiant/gopacket/internal/build"
"github.com/mandiant/gopacket/pkg/flags"
"github.com/mandiant/gopacket/pkg/kerberos"
)

Expand Down Expand Up @@ -446,7 +447,7 @@ func parseExtraSIDs() []string {
}

func usage() {
fmt.Fprintf(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC\n\n")
fmt.Fprintf(os.Stderr, "%s\n\n", flags.Banner())
fmt.Fprintf(os.Stderr, "Creates Kerberos golden/silver/sapphire tickets based on user options\n\n")
fmt.Fprintf(os.Stderr, "Usage: ticketer [options] <target>\n\n")
fmt.Fprintf(os.Stderr, "Positional:\n")
Expand Down
4 changes: 2 additions & 2 deletions tools/tstool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func main() {
}
}

fmt.Println("gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Println(flags.Banner())
fmt.Println()

// Connect via SMB
Expand Down Expand Up @@ -809,7 +809,7 @@ func cmdMsg(smbClient *smb.Client, auth *authContext, sessionID int, title, mess
}

func printUsage() {
fmt.Fprintln(os.Stderr, "gopacket v0.1.1-beta - Copyright 2026 Google LLC")
fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintln(os.Stderr)
fmt.Fprintln(os.Stderr, "Usage: tstool [auth-flags] target <action> [action-flags]")
fmt.Fprintln(os.Stderr)
Expand Down
4 changes: 2 additions & 2 deletions tools/wmipersist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ var (
)

func printUsage() {
fmt.Fprintf(os.Stderr, `gopacket v0.1.1-beta - Copyright 2026 Google LLC

fmt.Fprintln(os.Stderr, flags.Banner())
fmt.Fprintf(os.Stderr, `
usage: wmipersist [-h] [-debug] [-ts] [-com-version MAJOR_VERSION:MINOR_VERSION]
[-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey hex key]
[-dc-ip ip address]
Expand Down