Skip to content

Instantly share code, notes, and snippets.

@IskenHuang
Last active November 29, 2017 02:34
Show Gist options
  • Save IskenHuang/b9afedc3aca67a693ad2183d18385f91 to your computer and use it in GitHub Desktop.
Save IskenHuang/b9afedc3aca67a693ad2183d18385f91 to your computer and use it in GitHub Desktop.
Scan url response have keywords
#!/bin/bash
# fetch the page and using regex to catch keywords. When catch the keywords will save to result.txt
array=(
"https://www.tmall.com"
)
index=1
echo "Scan start"
for i in "${array[@]}"
do
echo "${index}/${#array[@]} scaning - ${i}"
count=$(curl -A "Weex/1.0.0" -v --silent $i 2>&1 | grep -E "hello" | wc -l)
echo "> ${count}"
if [ $count -gt 0 ]
then
echo "${i}, ${count}" >> result.txt
fi
((index++))
done
echo "Scan finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment