This commit is contained in:
Eli Peter 2026-06-05 10:16:30 -05:00 committed by GitHub
parent 55247b7fcd
commit 991c84a1eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1464 changed files with 225448 additions and 1985 deletions

View file

@ -0,0 +1,19 @@
// Phase 15 — gin handler, benign.
// Echoes a fixed string; query value is discarded.
package entry
import (
"fmt"
"os/exec"
"nyx-harness/entry/gin"
)
func Handle(c *gin.Context) {
_ = c.Query("payload")
cmd := exec.Command("echo", "hello")
out, _ := cmd.CombinedOutput()
fmt.Print(string(out))
c.String(200, "%s", string(out))
}

View file

@ -0,0 +1,3 @@
module nyx_gin_handler_fixture
go 1.21

View file

@ -0,0 +1,21 @@
// Phase 15 — gin handler, vulnerable.
// Reads gin context query value and pipes to /bin/sh -c.
// Entry: Handle(c *gin.Context) Cap: CODE_EXEC
package entry
import (
"fmt"
"os/exec"
"nyx-harness/entry/gin"
)
func Handle(c *gin.Context) {
fmt.Print("__NYX_SINK_HIT__\n")
payload := c.Query("payload")
cmd := exec.Command("sh", "-c", "echo hello "+payload)
out, _ := cmd.CombinedOutput()
fmt.Print(string(out))
c.String(200, "%s", string(out))
}