1 Star 0 Fork 0

ltfafei/IIS-ShortName-Scanner

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
multi_targets.sh 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
soroush dalili 提交于 2016-01-18 19:44 . v2.3.4
#!/bin/bash
if [ -z "$1" ]; then
echo "[*] Scanning multiple targets using IIS Short Name (8.3) Scanner by Soroush Dalili - @irsdl"
echo "[*] Usage: $0 <scope file> <is_default_https (1=https)>"
echo "[*] Example: $0 scope.txt 1"
exit 0
fi
default_scheme="http"
if [ "$2" = "1" ]; then
default_scheme="https"
fi
# current directory
CUR=`pwd`
# Load scope
if [ ! -f "$1" ]; then
echo "File not found: $1"
exit 1
fi
scope=`cat "$1"`
### IIS Shortname Scanner time!
resultDir="$CUR"/iis_shortname_results
mkdir "$resultDir"
uniquehostname=()
while read target; do
if [[ "$target" =~ [\'\"]+ ]]; then
echo "Error: an invalid character was found in $1"
exit 1
fi
if [[ "$target" =~ ^[[:space:]]*$ ]]; then
# the input is whitespace!
myhostname=""
else
myhostname=`python -c "from urlparse import urlparse;url = urlparse('$target','$default_scheme');print url.scheme+'://'+url.netloc+url.path"`
if [ -z "$myhostname" ]; then
# when target is not a url (ip address for example), python variable will be empty
myhostname="$target"
fi
uniquehostname+=("$myhostname")
fi
done <<<"$scope"
# unique hosts only
uniquehostname=($(printf "%s\n" "${uniquehostname[@]}" | sort -u));
for myhostname in "${uniquehostname[@]}"; do
targetFile=$(echo "$myhostname" | tr '[\/\\\:\000-\017\177\377]' '_')
java -jar iis_shortname_scanner.jar 0 20 "$myhostname" > "$resultDir/iis_shortname_${targetFile}.txt"
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/afei00123/IIS-ShortName-Scanner.git
git@gitee.com:afei00123/IIS-ShortName-Scanner.git
afei00123
IIS-ShortName-Scanner
IIS-ShortName-Scanner
master

搜索帮助