pwn

package module
v0.0.2 Latest Latest
Warning

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

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

README

gowntools

Go library for CTF pwn challenges and binary exploitation

Quick StartDocs

CI Status Coverage Status Release

Quick start

  1. Install library

go get github.com/Jacute/gowntools

  1. Check examples

Documentation

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 (
	ErrTerminalNotFound = errors.New("can't get terminal")
)

Functions

func Debug

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

Debug starts a gdb debugging session for the given client. It returns an error if the client is not a *conn or if the underlying process is not a *bin. The function also returns an error if it can't spawn a terminal to attach to the process or if the process hasn't attached to gdb after the given timeout.

The function try to use terminals of different types (tmux, xterm, gnome-terminal)

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)

	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
examples
simple_bof command

Jump to

Keyboard shortcuts

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