pwn

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

gowntools

Go library for CTF pwn challenges and binary exploitation

Quick StartDocs

CI Status Coverage Status Release

Dependencies

For use debug functions:

  • gdb
  • terminal like tmux, xterm or gnome-terminal

For finding gadgets:

  • nasm

Quick start

  1. Install library

go get github.com/Jacute/gowntools@latest

  1. Install cli tool

go install github.com/Jacute/gowntools/cmd/gowncli@latest

  1. Check examples

Documentation

⚠️ Now library supports to analyze only ELF binaries

https://pkg.go.dev/github.com/Jacute/gowntools

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TmuxTerminal  = terminal{"tmux", "splitw", "-h"}
	XtermTerminal = terminal{"xterm", "-e"}
	GnomeTerminal = terminal{"gnome-terminal", "--"}
)
View Source
var (
	ErrInteractiveModeNotSupported = errors.New("interactive mode only supported for TCP or binary")
)
View Source
var (
	ErrTerminalNotFound = errors.New("can't get terminal")
)

Functions

func Debug

func Debug(client Client, opts ...option)

Debug starts a gdb debugging session for the given client. It panics if the client is not a *conn or if the underlying process is not a *bin. The function requires gdb installed and terminal (tmux, xterm or gnome-terminal). Otherwise, the function will panic.

func WithGDBScript added in v0.0.3

func WithGDBScript(script string) func(*debugger)

WithGDBScript returns an option that sets the commands to be executed by gdb when attaching to the process. The commands are split by newline characters, so the following is a valid command string:

break main\n
info registers\n
continue\n

The function can be used to set arbitrary commands to be executed by gdb when attaching to the process. The commands are executed in the order they are given in the string.

func WithTerminal

func WithTerminal(term terminal) func(*debugger)

WithTerminal returns an option that sets the terminal to use when spawning gdb to attach to the process. If this option is not used, the terminal is tried to be determined automatically.

Types

type Client

type Client interface {
	io.ReadWriteCloser

	ReadAll() (out []byte, n int, err error)
	ReadUntil(data []byte) (out []byte, err error)
	ReadLine() (out []byte, err error)
	ReadStringLine() (string, error)

	WriteLine(b []byte) error
	WriteStringLine(s string) error

	Interactive()
}

Client is an interface that represents a pwn client (binary, tcp, udp, etc).

func NewBinary

func NewBinary(path string) Client

NewBinary creates a new binary client given a path to a binary. It returns a new client from the given binary. Function panics on error.

func NewTCP

func NewTCP(address string) Client

NewTCP connects to the address on the "TCP" network Function panics on error

Examples:

NewTCP("golang.org:http")
NewTCP("198.51.100.1:80")

func NewUDP

func NewUDP(address string) Client

NewUDP connects to the address on the "UDP" network Function panics on error

Examples:

NewUDP("golang.org:http")
NewUDP("198.51.100.1:80")

Directories

Path Synopsis
cmd
gowncli command
examples
simple_bof command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL