Skip to content

Instantly share code, notes, and snippets.

@l50
Last active Aug 21, 2018
Embed
What would you like to do?
Toolkit for evaluating potential vulnerabilities in open NFS mounts
# Usage: bash mount.sh system.target /mount/on/system.target
mkdir $1 │ NORMAL mounts.txt 12% 60:1
mount -t nfs $1:$2 $1
# Print NFS mounts associated with a list of systems
# Usage: print_mounts.py | tee mounts.txt
import subprocess
def return_list(file):
with open(file) as f:
list = f.readlines()
return list
def run_cmd(cmd):
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
(output, err) = p.communicate()
p_status = p.wait()
return output.decode('utf-8')
def print_mounts(target):
print(target)
print(run_cmd("showmount -e " + target))
targets = return_list('systems.txt')
for target in targets:
print_mounts(target)
system1
system2
system3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment