All Projects → pjbgf → gosystract

pjbgf / gosystract

Licence: MIT license
A lightweight CLI tool that finds system calls being called inside golang applications.

Programming Languages

shell
77523 projects
go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to gosystract

Contained.af
A stupid game for learning about containers, capabilities, and syscalls.
Stars: ✭ 730 (+2417.24%)
Mutual labels:  syscalls
Syswall
Work in progress firewall for Linux syscalls, written in Rust
Stars: ✭ 110 (+279.31%)
Mutual labels:  syscalls
Kafel
A language and library for specifying syscall filtering policies.
Stars: ✭ 202 (+596.55%)
Mutual labels:  syscalls
Proot
chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
Stars: ✭ 933 (+3117.24%)
Mutual labels:  syscalls
Cubostratus
Blazingly fast Linux syscall collector
Stars: ✭ 68 (+134.48%)
Mutual labels:  syscalls
Ptracer
A library for ptrace-based tracing of Python programs
Stars: ✭ 136 (+368.97%)
Mutual labels:  syscalls
Kubectl Dig
Deep kubernetes visibility from the kubectl
Stars: ✭ 325 (+1020.69%)
Mutual labels:  syscalls
InlineWhispers2
Tool for working with Direct System Calls in Cobalt Strike's Beacon Object Files (BOF) via Syswhispers2
Stars: ✭ 156 (+437.93%)
Mutual labels:  syscalls
Write A Strace And Gdb
A tiny system call tracer and debugger implementation
Stars: ✭ 93 (+220.69%)
Mutual labels:  syscalls
Gweb
Interact with browser from Go. Manually-crafted WebAPI interoperation library.
Stars: ✭ 163 (+462.07%)
Mutual labels:  syscalls
Freshycalls
FreshyCalls tries to make the use of syscalls comfortable and simple, without generating too much boilerplate and in modern C++17!
Stars: ✭ 37 (+27.59%)
Mutual labels:  syscalls
Nitro
Stars: ✭ 38 (+31.03%)
Mutual labels:  syscalls
Tardis
Trace And Rewrite Delays In Syscalls: Hooking time-related Linux syscalls to warp a process's perspective of time, using ptrace.
Stars: ✭ 144 (+396.55%)
Mutual labels:  syscalls
Shellen
🌸 Interactive shellcoding environment to easily craft shellcodes
Stars: ✭ 799 (+2655.17%)
Mutual labels:  syscalls
Inline syscall
Inline syscalls made easy for windows on clang
Stars: ✭ 232 (+700%)
Mutual labels:  syscalls
Syscall intercept
The system call intercepting library
Stars: ✭ 408 (+1306.9%)
Mutual labels:  syscalls
Ltp
Linux Test Project http://linux-test-project.github.io/
Stars: ✭ 1,654 (+5603.45%)
Mutual labels:  syscalls
AlanFramework
A C2 post-exploitation framework
Stars: ✭ 405 (+1296.55%)
Mutual labels:  security-tool
honeycomb
An extensible honeypot framework
Stars: ✭ 93 (+220.69%)
Mutual labels:  security-tool
Kvm Vmi
KVM-based Virtual Machine Introspection
Stars: ✭ 153 (+427.59%)
Mutual labels:  syscalls

gosystract

gosystract extracts all system calls that may be called within the execution path of a go application.

codecov Dependabot Status GoReport GoDoc build MIT License

Installation:

using container image

docker run --rm -it paulinhu/gosystract gosystract

using go environment

go install github.com/pjbgf/gosystract

If you don't have $GOPATH/bin in your $PATH, prefix the command with:

PATH=$PATH:$GOPATH/bin gosystract

Note that gosystract has a dependency to the go tools when working against executable files. In that case, ensure that go is in your $PATH.

Command-line Usage:

Syntax

Usage:

	gosystrac [flags] filePath

Flags:
    --dumpfile, -d    Handles a dump file instead of a go executable.
    --template        Defines a go template for the results.
                      Example: --template='{{- range . }}{{printf "%d - %s\n" .ID .Name}}{{- end}}'

Running against gosystract itself:

$ gosystract $(which gosystract)

18 system calls found:
    sched_yield (24)
    futex (202)
    write (1)
    rt_sigprocmask (14)
    getpid (39)
    epoll_ctl (233)
    gettid (186)
    mmap (9)
    tgkill (234)
    rt_sigaction (13)
    exit_group (231)
    madvise (28)
    read (0)
    getpgrp (111)
    arch_prctl (158)
    readlinkat (267)
    close (3)
    fcntl (72)

Running the sample dump file:

$ gosystract --dumpfile test/keyring.dump

20 system calls found:
    sched_yield (24)
    futex (202)
    read (0)
    write (1)
    rt_sigprocmask (14)
    getpid (39)
    gettid (186)
    tgkill (234)
    rt_sigaction (13)
    exit_group (231)
    mmap (9)
    madvise (28)
    getpgrp (111)
    arch_prctl (158)
    epoll_ctl (233)
    readlinkat (267)
    close (3)
    fcntl (72)
    add_key (248)
    keyctl (250)

To generate a dump file from a go application use the go tool objdump:

$ go tool objdump goapp > goapp.dump

Using it programmatically

package main

import "github.com/pjbgf/gosystract/cmd/systract"

func main() {
	source := systract.NewExeReader("goapp")
	syscalls, err := systract.Extract(source)
	if err != nil {
		panic(err)
	}

    for _, syscall := range syscalls {
        fmt.Printf("%s (%d)\n", syscall.Name, syscall.ID)
    }
}

License

This application is licensed under the MIT License, you may obtain a copy of it here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].