Last active
November 29, 2017 02:34
-
-
Save IskenHuang/b9afedc3aca67a693ad2183d18385f91 to your computer and use it in GitHub Desktop.
Scan url response have keywords
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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