Go SSTI
Investigation
import "html/template"
...
template.New("foo").Parse("{{ . }}")Exploit
// `main.go` of target website
type User struct {
Id string
Name string
}
// Read contents of the file and output it.
func GetFile(filepath string) {
...
}
// Execute system command.
func ExecuteCmd(cmd string) {
...
}Payloads
References
Last updated