Skip to content

Commit

Permalink
Update netcat_remote_code_execution_in_container.go
Browse files Browse the repository at this point in the history
Signed-off-by: Kapil Sharma <ks3913688@gmail.com>
  • Loading branch information
h4l0gen authored and poiana committed Apr 4, 2024
1 parent 62cd476 commit 54e91ae
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions events/syscall/netcat_remote_code_execution_in_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ var _ = events.Register(NetcatRemoteCodeExecutionInContainer)
func NetcatRemoteCodeExecutionInContainer(h events.Helper) error {
if h.InContainer() {
// Launch netcat (nc) with the -e flag for remote code execution
cmd := exec.Command("nc", "-e", "/bin/bash")
cmd := exec.Command("nc", "-e")

h.Log().Info("Netcat runs inside container that allows remote code execution")
err := cmd.Run()
if err != nil {
h.Log().WithError(err).Error("Failed to launch netcat (nc) for remote code execution")
return err
}
}

return nil
}
}

0 comments on commit 54e91ae

Please sign in to comment.