mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-03 20:41:00 +02:00
refactor(dynamic): expand Go framework support with updated route dispatch logic, enhance stub generation, and improve Go module management
This commit is contained in:
parent
68bdd30eca
commit
170d2028d0
9 changed files with 252 additions and 86 deletions
|
|
@ -6,6 +6,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
|
||||
|
|
@ -14,7 +15,9 @@ import (
|
|||
|
||||
func Run(w http.ResponseWriter, r *http.Request) {
|
||||
cmd := r.URL.Query().Get("cmd")
|
||||
_ = exec.Command("sh", "-c", cmd).Run()
|
||||
fmt.Print("__NYX_SINK_HIT__\n")
|
||||
out, _ := exec.Command("sh", "-c", cmd).CombinedOutput()
|
||||
fmt.Print(string(out))
|
||||
_, _ = w.Write([]byte("ok"))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
|
@ -13,7 +14,10 @@ import (
|
|||
|
||||
func Run(c echo.Context) error {
|
||||
cmd := c.QueryParam("cmd")
|
||||
return exec.Command("sh", "-c", cmd).Run()
|
||||
fmt.Print("__NYX_SINK_HIT__\n")
|
||||
out, err := exec.Command("sh", "-c", cmd).CombinedOutput()
|
||||
fmt.Print(string(out))
|
||||
return err
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
|
@ -13,7 +14,10 @@ import (
|
|||
|
||||
func Run(c *fiber.Ctx) error {
|
||||
cmd := c.Query("cmd")
|
||||
return exec.Command("sh", "-c", cmd).Run()
|
||||
fmt.Print("__NYX_SINK_HIT__\n")
|
||||
out, err := exec.Command("sh", "-c", cmd).CombinedOutput()
|
||||
fmt.Print(string(out))
|
||||
return err
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
|
@ -14,7 +15,9 @@ import (
|
|||
|
||||
func Run(c *gin.Context) {
|
||||
cmd := c.Query("cmd")
|
||||
_ = exec.Command("sh", "-c", cmd).Run()
|
||||
fmt.Print("__NYX_SINK_HIT__\n")
|
||||
out, _ := exec.Command("sh", "-c", cmd).CombinedOutput()
|
||||
fmt.Print(string(out))
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue