Skip to content

Instantly share code, notes, and snippets.

@sharvell
Last active November 12, 2015 00:35
Show Gist options
  • Select an option

  • Save sharvell/b24d8acde55e8f07e9d1 to your computer and use it in GitHub Desktop.

Select an option

Save sharvell/b24d8acde55e8f07e9d1 to your computer and use it in GitHub Desktop.
#!/bin/bash
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
if [[ "$1" == "edit" ]]
then
sudo ne ${SCRIPT}
fi
wget -rnv -l100 --delete-after --mirror -p "$1"
exit 0
test_url="$1"
test_url_base=`echo $1 | awk -F/ '{print $1"//"$2$3}'`
urls=$(wget -O - ${test_url} 2>&1 | grep iframe | sed -n '/<iframe/s/^.*<iframe src="
for url in ${urls}
do
abs=`echo ${url} | grep ^\/`
if [[ "$abs" != "" ]]
then
url="${test_url_base}${url}"
fi
if [[ $url != *"http"* ]]
then
url="$1/${url}"
fi
echo "scanning: ${url}"
${SCRIPT} "${url}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment