-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwes-wrap
34 lines (30 loc) · 1.29 KB
/
wes-wrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
print_usage() {
echo "\
Usage: wes-wrap [OPTION]... -f [systeminfo]
Search for possible Windows exploits given systeminfo.exe output
Windows Exploit Suggester 0.98 ( https://github.com/bitsadmin/wesng/ )
required arguments:
-f File Specify the systeminfo file
optional arguments:
-i Impact Only display vulnerabilities with a given impact
(Impacts: 'privilege', 'execution', 'denial', 'spoofing', 'disclosure', 'bypass')
-s Severity Only display vulnerabilities with a given severity
(Severities: 'Moderate', 'Important', 'Critical')
-x Exploits Only display vulnerabilities with exploits if passed"
}
while getopts 'hxi:s:f:' flag; do
case "$flag" in
i) IMPACT="$OPTARG" ;;
s) SEVERITY="$OPTARG" ;;
f) FILE="$OPTARG";;
x) EXPLOIT="Exploit";;
esac
done
if [ -n "$FILE" ]; then
[ -n "$SEVERITY" ] && SEVERITY="$(tr '[:lower:]' '[:upper:]' <<< ${SEVERITY:0:1})${SEVERITY:1}"
[ -n "$IMPACT" ] && IMPACT="$(tr '[:lower:]' '[:upper:]' <<< ${IMPACT:0:1})${IMPACT:1}"
wesng `realpath $FILE` | awk -v RS='' -v ORS='\n\n' "/$SEVERITY/" | awk -v RS='' -v ORS='\n\n' "/$IMPACT/" | grep -vwE '(Date:|Exploit: n/a|KB:)' | awk -v RS='' -v ORS='\n\n' "/$EXPLOIT/"
else
print_usage
fi