Skip to content

Instantly share code, notes, and snippets.

@l50
Last active August 21, 2018 21:44
Show Gist options
  • Save l50/0b71356292f2955edb33b8df42ed5c46 to your computer and use it in GitHub Desktop.
Save l50/0b71356292f2955edb33b8df42ed5c46 to your computer and use it in GitHub Desktop.
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