{"id":15396617,"url":"https://github.com/hupe1980/gopwn","last_synced_at":"2025-04-16T01:47:52.642Z","repository":{"id":57623737,"uuid":"396668091","full_name":"hupe1980/gopwn","owner":"hupe1980","description":"Golang CTF framework and exploit development module","archived":false,"fork":false,"pushed_at":"2021-08-31T18:46:31.000Z","size":229,"stargazers_count":27,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-29T03:41:32.709Z","etag":null,"topics":["binary","cave","ctf","ctf-framework","elf","exploit","golang","macho","pe","shellcode"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hupe1980.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-16T07:11:41.000Z","updated_at":"2024-11-16T20:41:48.000Z","dependencies_parsed_at":"2022-09-12T11:01:27.429Z","dependency_job_id":null,"html_url":"https://github.com/hupe1980/gopwn","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgopwn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgopwn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgopwn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hupe1980%2Fgopwn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hupe1980","download_url":"https://codeload.github.com/hupe1980/gopwn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249182966,"owners_count":21226123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","cave","ctf","ctf-framework","elf","exploit","golang","macho","pe","shellcode"],"created_at":"2024-10-01T15:34:23.493Z","updated_at":"2025-04-16T01:47:52.625Z","avatar_url":"https://github.com/hupe1980.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gopwn \n![Build Status](https://github.com/hupe1980/gopwn/workflows/build/badge.svg) \n[![Go Reference](https://pkg.go.dev/badge/github.com/hupe1980/gopwn.svg)](https://pkg.go.dev/github.com/hupe1980/gopwn)\n\u003e Golang CTF framework and exploit development module\n\nThis module is strictly for educational purposes only. Usage of the methods and tools for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable laws. Developers assume no liability and are not responsible for any misuse or damage caused by this module.\n\n:warning: This is experimental and subject to breaking changes.\n\n## Usage\n```go\npackage main\n\nimport (\n  \"bytes\"\n  \"fmt\"\n\n  \"github.com/hupe1980/gopwn\"\n)\n\nfunc main() {\n  p, _ := gopwn.NewProcess([]string{\"./ctfbinary\"})\n  p.SendLine(append(bytes.Repeat([]byte(\"A\"), 200), gopwn.P32L(0xdeadbeef)...))\n  out, _ := p.RecvLine()\n  fmt.Println(string(out))\n}\n```\n\n### Packing Integers\n```go\n//32Bit LittelEndian\nb := gopwn.P32L(0xdeadbeef)\nassert.Equal(t, []byte(\"\\xef\\xbe\\xad\\xde\"), b) // true\ni := gopwn.U32L([]byte(\"\\xef\\xbe\\xad\\xde\"))\nassert.Equal(t, uint32(0xdeadbeef), i) // true\n```\n\n### Assembly and Disassembly\n```go\ninsn, _ := gopwn.AssembleI386(\"mov eax, 0\")\nfmt.Println(gopwn.HexString(insn))\n```\nOutputs:\n```\nb800000000\n```\n```go\nassembly, _ := gopwn.DisamI386([]byte(\"\\xb8\\x5d\\x00\\x00\\x00\"), 0)\nfmt.Println(assembly)\n```\nOutputs:\n```\n0x0           b8 5d 00 00 00                mov eax, 0x5d\n```\n\n### Misc Tools\nGenerate unique sequences to find offsets in your buffer causing a crash:\n```go\nassert.Equal(t, []byte(\"aaaabaaacaaadaaa\"), gopwn.Cyclic(16)) // true\nassert.Equal(t, 4, gopwn.CyclicFind([]byte(\"baaa\")) // true\n```\n\n### Binary Analysis and Manipulation\n```go\nelf, _ := gopwn.NewELF(\"./ctfbinary\")\n```\n\n```go\npe, _ := gopwn.NewPE(\"./ctfbinary.exe\")\n```\n\n```go\nmacho, _ := gopwn.NewMACHO(\"./ctfbinary\")\n```\n\n### Documentation\nSee [godoc](https://pkg.go.dev/github.com/hupe1980/gopwn).\n\n### Examples\nSee more complete [examples](https://github.com/hupe1980/gopwn/tree/main/_examples).\n\n## CLI\n```\ngopwn command-line interface\n\nUsage:\n  gopwn [command]\n\nAvailable Commands:\n  cave        Search for code caves\n  checksec    Check binary security settings\n  completion  Prints shell autocompletion scripts for gopwn\n  cyclic      Generation of unique sequences\n  help        Help about any command\n\nFlags:\n  -h, --help      help for gopwn\n  -v, --version   version for gopwn\n\nUse \"gopwn [command] --help\" for more information about a command.\n```\n\n### Installing\nYou can install the pre-compiled binary in several different ways\n\n#### deb/rpm/apk:\nDownload the .deb, .rpm or .apk from the [releases page](https://github.com/hupe1980/gopwn/releases) and install them with the appropriate tools.\n\n#### manually:\nDownload the pre-compiled binaries from the [releases page](https://github.com/hupe1980/gopwn/releases) and copy to the desired location.\n\n## License\n[MIT](LICENCE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fgopwn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhupe1980%2Fgopwn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhupe1980%2Fgopwn/lists"}