mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-15 21:11:02 +02:00
[pitboss] phase 19: Track M.1 — ClassMethod end-to-end (all langs)
This commit is contained in:
parent
1b2f9cb7ca
commit
b374f89577
35 changed files with 1894 additions and 41 deletions
15
tests/dynamic_fixtures/class_method/go/benign.go
Normal file
15
tests/dynamic_fixtures/class_method/go/benign.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Phase 19 (Track M.1) — class-method benign control for Go.
|
||||
package entry
|
||||
|
||||
import "os/exec"
|
||||
|
||||
type UserService struct{}
|
||||
|
||||
func (UserService) Run(input string) string {
|
||||
out, _ := exec.Command("/bin/echo", input).Output()
|
||||
return string(out)
|
||||
}
|
||||
|
||||
var NyxReceivers = map[string]interface{}{
|
||||
"UserService": UserService{},
|
||||
}
|
||||
21
tests/dynamic_fixtures/class_method/go/vuln.go
Normal file
21
tests/dynamic_fixtures/class_method/go/vuln.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Phase 19 (Track M.1) — class-method vuln fixture for Go.
|
||||
//
|
||||
// UserService.Run accepts user input and passes it to `sh -c` so the
|
||||
// shell interprets it. The fixture publishes its instance through the
|
||||
// well-known `NyxReceivers` registry the harness uses to construct
|
||||
// receivers reflectively.
|
||||
package entry
|
||||
|
||||
import "os/exec"
|
||||
|
||||
type UserService struct{}
|
||||
|
||||
func (UserService) Run(input string) string {
|
||||
// SINK: tainted input → shell -c
|
||||
out, _ := exec.Command("sh", "-c", "echo "+input).Output()
|
||||
return string(out)
|
||||
}
|
||||
|
||||
var NyxReceivers = map[string]interface{}{
|
||||
"UserService": UserService{},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue