Skip to content

Commit

Permalink
fix (exp shim-pwn): #104 merged directory appears twice in path (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
neargle authored Nov 15, 2024
1 parent c37caa4 commit 4e23c85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/exploit/escaping/containerd_shim_pwn.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"log"
"net"
"os"
"path/filepath"
"regexp"
"strings"

Expand Down Expand Up @@ -123,7 +124,9 @@ func containerdShimApiExp(sock, shellCmd, rhost, rport string) error {
localBundlePath := fmt.Sprintf("/cdk_%s", util.RandString(6))
os.Mkdir(localBundlePath, os.ModePerm)

dockerAbsPath := GetDockerAbsPath() + "/merged" + localBundlePath
absPath := GetDockerAbsPath()
absPath = strings.TrimSuffix(absPath, "/merged")
dockerAbsPath := filepath.Join(absPath, "merged", localBundlePath)

var payloadShellCmd = ""
if len(shellCmd) > 0 {
Expand Down

0 comments on commit 4e23c85

Please sign in to comment.