Last active
March 21, 2019 16:42
-
-
Save wheelq/ea7545c7e49f7a148c89728d43eabfd9 to your computer and use it in GitHub Desktop.
DevSecOps/Automated Wapiti3 scanner (wheelq)
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 | |
#title :wapiti_scan.sh | |
#description :This script is used for automated wapiti scans. | |
#author :Michal Wiczynski <wheelq@gmail.com> | |
#date :2019-03-06 | |
#version :0.1c | |
#usage :bash wapiti_scan.sh | |
#notes :[N/A] | |
#============================================================================== | |
#Remove \r | |
_HOSTS_FILE="${1}" | |
_HOSTS_FILE_TR="wapitiready_${1}" | |
tr -d '\r' < "${_HOSTS_FILE}" > "${_HOSTS_FILE_TR}" | |
#Define values for date, hosts file and results dir | |
_HOSTS="$(cat ${_HOSTS_FILE_TR})" | |
_RESULTS_DIR="results" | |
_TODAY="$(date +%Y%m%d)" | |
#Create results dir | |
mkdir -p "${_RESULTS_DIR}" | |
cd "${_RESULTS_DIR}" | |
for i in ${_HOSTS}; do | |
#Remove trailing / | |
if [ "${i: -1}" == "/" ]; then | |
i=${i%?} | |
fi | |
echo "[${_today}] Scanning: \"${i}\""; | |
_DIRNAME="$(echo ${i}|sed 's~http[s]*://~~g')" | |
wapiti -u ${i}/ -m blindsql,sql -d 5 --max-scan-time 5 --scope folder --format txt --verify-ssl 1 -o "${_DIRNAME}.txt"; | |
grep -Hn ' : ' *.txt|egrep -v " 0" > ../Vulnerable_sites.log | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment