Skip to content

Instantly share code, notes, and snippets.

@caramelchocolate
Last active July 23, 2019 04:04
Show Gist options
  • Save caramelchocolate/d9750cf6eac7b8a8bec22423ae6f7075 to your computer and use it in GitHub Desktop.
Save caramelchocolate/d9750cf6eac7b8a8bec22423ae6f7075 to your computer and use it in GitHub Desktop.
collect /etc/hosts in jail
#!/bin/sh
jls | awk 'NR>1 {print $4}' | awk -F'/' '{print $NF}' | xargs -I@ sh -c 'j=@; c=$(jexec ${j} cat /etc/hosts); echo "${c}" > "${j}.txt"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment