Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liamg/memit
:no_entry_sign::floppy_disk: Run binaries straight from memory in Linux
https://github.com/liamg/memit
fileless fileless-attack memfd shenanigans
Last synced: 3 days ago
JSON representation
:no_entry_sign::floppy_disk: Run binaries straight from memory in Linux
- Host: GitHub
- URL: https://github.com/liamg/memit
- Owner: liamg
- License: unlicense
- Created: 2021-11-16T12:25:38.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T19:13:06.000Z (over 1 year ago)
- Last Synced: 2024-12-24T04:19:48.886Z (10 days ago)
- Topics: fileless, fileless-attack, memfd, shenanigans
- Language: Go
- Homepage:
- Size: 149 KB
- Stars: 311
- Watchers: 10
- Forks: 34
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Memit
Execute a binary from memory, without touching the disk. Linux only.
Available as both a Go module and a binary.
![demo](demo.gif)
## Using the Go module
The `Command()` method takes an `io.Reader`, so you can use it with things like an HTTP response body, a `bytes.Buffer`, etc.
It provides an `*exec.Cmd` (via `memit.Command(...)`) so you can wire up stdin/out and configure other parameters just like you would with a regular command.
```go
package mainimport "github.com/liamg/memit"
func main() {
resp, _ := http.Get("https://.../mybinary")cmd, _, _ := memit.Command(resp.Body, "--args", "--go", "--here")
cmd.Stderr = os.Stderr
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout_ = cmd.Run()
}
```## Using the binary
Grab the [latest release](https://github.com/liamg/memit/releases/latest) and run it like this:
```bash
memit https://.../mybinary -- # args for the actual binary can be put after the --
```