mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-21 20:18:06 +02:00
[pitboss] phase 20: Track M.2 — MessageHandler end-to-end (Kafka / SQS / Pub-Sub / NATS / RabbitMQ)
This commit is contained in:
parent
fedc507e6a
commit
bd0135e423
45 changed files with 3227 additions and 25 deletions
19
tests/dynamic_fixtures/message_handler/pubsub_go/benign.go
Normal file
19
tests/dynamic_fixtures/message_handler/pubsub_go/benign.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Phase 20 (Track M.2) — Google Pub/Sub Go benign control.
|
||||
package entry
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
const _adapterMarker = "cloud.google.com/go/pubsub"
|
||||
|
||||
func OnMessage(payload string) {
|
||||
cmd := exec.Command("echo", payload)
|
||||
out, _ := cmd.Output()
|
||||
os.Stdout.Write(out)
|
||||
}
|
||||
|
||||
var NyxHandlers = map[string]interface{}{
|
||||
"OnMessage": OnMessage,
|
||||
}
|
||||
24
tests/dynamic_fixtures/message_handler/pubsub_go/vuln.go
Normal file
24
tests/dynamic_fixtures/message_handler/pubsub_go/vuln.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Phase 20 (Track M.2) — Google Pub/Sub Go vuln fixture.
|
||||
//
|
||||
// Adapter source-marker: cloud.google.com/go/pubsub (string-literal only).
|
||||
// The handler signature accepts a string so the Phase 20 harness
|
||||
// dispatch falls through to the NYX_PAYLOAD env var.
|
||||
package entry
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
const _adapterMarker = "cloud.google.com/go/pubsub"
|
||||
|
||||
func OnMessage(payload string) {
|
||||
// SINK: tainted payload concatenated into shell command
|
||||
cmd := exec.Command("sh", "-c", "echo "+payload)
|
||||
out, _ := cmd.Output()
|
||||
os.Stdout.Write(out)
|
||||
}
|
||||
|
||||
var NyxHandlers = map[string]interface{}{
|
||||
"OnMessage": OnMessage,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue