Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gopacket

> 编程语言
Open source

A complete Go port of Impacket - 63 CLI tools and 24 libraries for Windows & Active Directory protocol attacks, compiled to a single dependency-free binary.

701 stars0 likes1 views
WebsiteGitHub

About

A complete Go port of Impacket - 63 CLI tools and 24 libraries for Windows & Active Directory protocol attacks, compiled to a single dependency-free binary.

gopacket

By Jacob Paullus (@psycep_)

A complete Go implementation of Impacket - 63 tools and 24 library packages for Windows network protocol interaction, Active Directory enumeration, and attack execution. Built as a native Go framework so you can compile once and run anywhere without Python dependencies.

Beta Release - Highly Experimental. gopacket is under active development. Core tools have been tested against Active Directory lab environments, but edge cases and protocol quirks are expected. If something isn't working, please test the same operation with Impacket side-by-side and include both outputs in your bug report. This helps us quickly identify whether it's a gopacket-specific issue or a shared protocol limitation.

Installation

bash
git clone https://github.com/mandiant/gopacket
cd gopacket

# Default: Linux/macOS build + install to /usr/local/bin
./install.sh

# Run with no flags and it prompts you through the choices interactively.
# Or pick a target directly:
./install.sh --target portable   # static Linux binaries in ./dist/portable/
./install.sh --target windows    # Windows .exe cross-compiles in ./dist/windows/
./install.sh --target all        # build every target in one run

# Build without installing (native only)
./install.sh --build-only

# Or build with make
make build

The default (--target native) build needs Go 1.24.13+, GCC, and libpcap development headers (apt install build-essential libpcap-dev on Debian/Ubuntu/Kali, yum install gcc libpcap-devel on RHEL/CentOS, or brew install libpcap on macOS). The portable and windows targets only need the Go toolchain; sniff and split become stubs in those builds because they require libpcap. See Platform Support for the full matrix.

Platform Support

gopacket builds on Linux, macOS, and Windows. The set of working tools and available proxying paths depends on the build flags:

Build Tools available Proxying
Linux / macOS with cgo (default) All 63 proxychains (LD_PRELOAD) and/or -proxy SOCKS5
Linux with CGO_ENABLED=0 61 (sniff, split become stubs) -proxy only (proxychains needs the libc hook)
Windows (GOOS=windows CGO_ENABLED=0) 60 (sniff, split, sniffer stubs) -proxy only (no LD_PRELOAD on Windows)

sniff and split depend on libpcap via cgo; sniffer depends on Unix raw sockets. When a tool can't be built for the target, gopacket substitutes a stub that prints a clear message and exits 1, so go build ./... always succeeds and the install layout is consistent across platforms.

To uninstall:

bash
./install.sh --uninstall

Proxy Support

gopacket supports two independent proxying paths. They can also be chained.

proxychains (LD_PRELOAD)

All gopacket tools work through proxychains. Go binaries normally bypass proxychains because Go's runtime handles DNS and networking internally, skipping the LD_PRELOAD hooks that proxychains relies on. gopacket works around this by linking against the system C library for network operations, allowing proxychains to intercept connections normally.

bash
proxychains gopacket-secretsdump 'domain/user:password@target'
proxychains gopacket-smbclient -k -no-pass 'domain/[email protected]'

Internal SOCKS5 proxy (-proxy)

Every tool accepts -proxy to route outbound TCP through a SOCKS5 server without relying on LD_PRELOAD. Accepted schemes: socks5 and socks5h. When -proxy is unset, the ALL_PROXY / all_proxy environment variables are consulted as a fallback.

bash
gopacket-secretsdump -proxy socks5h://127.0.0.1:1080 'domain/user:password@target'
ALL_PROXY=socks5h://127.0.0.1:1080 gopacket-smbclient 'domain/user:password@target'

UDP-dependent features are disabled under -proxy rather than silently leaking packets (SOCKS5 UDP ASSOCIATE is rarely supported by proxies, and bypassing the proxy for UDP would reveal the operator's real source IP). Affected features and their workarounds are documented in KNOWN_ISSUES.md.

Chaining: -proxy is compatible with proxychains. The TCP connection to the SOCKS5 proxy itself still goes through libc connect(), so proxychains → gopacket → -proxy → target works for nested routing scenarios.

Documentation

See the Library Developer Guide for full API documentation, code examples, and architecture overview for building custom tools on top of gopacket's 24 protocol packages.

Tools (63)

Remote Execution

Tool Description
psexec Remote command execution via SMB service creation
smbexec Remote command execution via SMB (stealthier than psexec)
wmiexec Remote command execution via WMI
dcomexec Remote command execution via DCOM
atexec Remote command execution via Task Scheduler

Credential Dumping & DPAPI

Tool Description
secretsdump SAM/LSA/NTDS.dit extraction and DCSync (remote + offline)
dpapi DPAPI backup key extraction
esentutl Offline ESE database parser (NTDS.dit)
registry-read Offline Windows registry hive parser

Kerberos

Tool Description
getTGT Request a TGT with password, hash, or AES key
getST Request a service ticket with S4U2Self/S4U2Proxy
GetUserSPNs Kerberoasting - find and request SPNs
GetNPUsers AS-REP roasting - find accounts without pre-auth
ticketer Golden/silver ticket forging
ticketConverter Convert between ccache and kirbi formats
describeTicket Parse and decrypt Kerberos tickets
getPac Request and parse PAC information
keylistattack KERB-KEY-LIST-REQ attack (RODC)
raiseChild Child-to-parent domain escalation via golden ticket

Active Directory Enumeration

Tool Description
GetADUsers Enumerate domain users via LDAP
GetADComputers Enumerate domain computers via LDAP
GetLAPSPassword Read LAPS passwords via LDAP
findDelegation Find delegation configurations
lookupsid SID brute-forcing via LSARPC
samrdump Enumerate users via SAMR
rpcdump Dump RPC endpoints via epmapper
rpcmap Scan for accessible RPC interfaces
net net user/group/computer enumeration via SAMR/LSARPC
netview Enumerate sessions, shares, and logged-on users
CheckLDAPStatus Check LDAP signing and channel binding requirements
DumpNTLMInfo Dump NTLM authentication info from SMB negotiation
getArch Detect remote OS architecture via RPC
machine_role Detect machine role (DC, server, workstation)

Active Directory Attacks

Tool Description
addcomputer Create/modify/delete machine accounts (SAMR + LDAP)
rbcd Resource-Based Constrained Delegation manipulation
dacledit Read/write DACLs on AD objects
owneredit Read/modify object ownership
samedit SAM account name spoofing (CVE-2021-42278/42287)
badsuccessor BadSuccessor / backup operator escalation
changepasswd Change/reset passwords via SAMR and LDAP

SMB Tools

Tool Description
smbclient Interactive SMB client (shares, ls, get, put, etc.)
smbserver SMB server for file sharing
attrib Query/modify file attributes via SMB
filetime Query/modify file timestamps via SMB
services Remote service management via SVCCTL
reg Remote registry operations via WINREG
Get-GPPPassword Extract Group Policy Preferences passwords from SYSVOL
karmaSMB Rogue SMB server for hash capture

NTLM Relay

Tool Description
ntlmrelayx Full NTLM relay framework with multi-protocol support

ntlmrelayx supports:

  • Capture servers: SMB, HTTP/HTTPS, WCF (ADWS), RAW, RPC, WinRM
  • Relay clients: SMB, LDAP/LDAPS, HTTP/HTTPS, MSSQL, WinRM, RPC
  • Attacks: secretsdump, smbexec, ldapdump, RBCD delegation, ACL abuse, shadow credentials, ADCS ESC8, addcomputer, DNS manipulation, and more
  • Infrastructure: SOCKS5 proxy with protocol-aware plugins, interactive console, REST API, multi-target round-robin, WPAD serving

SQL Server

Tool Description
mssqlclient Interactive MSSQL client with SQL/Windows/Kerberos auth
mssqlinstance MSSQL instance discovery via SQL Browser

WMI

Tool Description
wmiquery Interactive WMI query shell
wmipersist WMI event subscription persistence

Terminal Services

Tool Description
tstool Terminal Services session and process enumeration

Other Protocols

Tool Description
rdp_check RDP authentication check
mqtt_check MQTT authentication check
exchanger Exchange Web Services client

Utilities

Tool Description
ntfs-read Offline NTFS filesystem parser
ping / ping6 ICMP ping
sniff / sniffer Network packet capture
split Split large files

Authentication

All network tools support three authentication methods:

bash
# Password
gopacket-secretsdump 'domain/user:password@target'

# NTLM hash (pass-the-hash)
gopacket-secretsdump -hashes ':nthash' 'domain/user@target'

# Kerberos (pass-the-ticket)
KRB5CCNAME=ticket.ccache gopacket-secretsdump -k -no-pass 'domain/user@target'

Common Flags

Flag Description
-hashes LMHASH:NTHASH NTLM hash authentication (LM hash can be empty)
-k Use Kerberos authentication
-no-pass Don't prompt for password (use with -k or -hashes)
-dc-ip IP IP address of the domain controller
-target-ip IP IP address of the target (when using hostname for Kerberos)
-port PORT Target port (defaults vary by tool)
-proxy URL Route outbound TCP through a SOCKS5 proxy (e.g. socks5h://127.0.0.1:1080). UDP features are disabled.
-debug Enable debug output

Quick Examples

…

Library

The pkg/ directory contains 24 reusable protocol packages that can be imported independently.

Package Description
smb SMB2/3 client with NTLM and Kerberos auth
ldap LDAP client with NTLM/Kerberos bind
dcerpc DCE/RPC client + 20 service implementations (DRSUAPI, SAMR, SVCCTL, LSARPC, WINREG, NETLOGON, DCOM, TSCH, EPMAPPER, etc.)
kerberos Kerberos client, ticket forging (golden/silver), S4U2Self/S4U2Proxy
ntlm NTLM authentication protocol
relay NTLM relay framework (servers, clients, attacks, SOCKS)
tds SQL Server TDS protocol
ese Extensible Storage Engine parser
registry Windows registry hive parser
ntfs NTFS filesystem parser
security Security descriptors, ACLs, SIDs
dpapi DPAPI structures
mqtt MQTT protocol client
session Target/credential parsing (domain/user:pass@host)
flags Unified CLI flag framework

Missing Features (vs Impacket)

gopacket aims for full Impacket parity. The following are not yet implemented:

Relay protocol clients:

  • IMAP relay client + attack (requires Exchange/IMAP server)
  • SMTP relay client (requires S

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言