output from nc not displayed

This commit is contained in:
Vomitblood 2025-01-24 11:26:04 +08:00
parent 84d8cc9c58
commit 6568d286aa

View file

@ -8,14 +8,14 @@ import (
func startNetcatListener(lport string) {
// Create the command to run netcat as a listener
cmd := exec.Command("nc", "-lvp", lport)
cli := exec.Command("nc", "-lvp", lport)
// Set up the output to be printed to the console
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cli.Stdout = os.Stdout
cli.Stderr = os.Stderr
// Run the command
err := cmd.Run()
err := cli.Run()
if err != nil {
fmt.Println("Error starting netcat listener:", err)
os.Exit(1)