You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo"Potentially vulnerable to CVE-2019-25016: OpenDoas 6.6 through 6.8 may inherit an attacker-controlled PATH for unrestricted rules (verify distro backports)"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
echo"Potentially vulnerable to CVE-2019-15900 and CVE-2019-15901: slicer69/doas before 6.2 can mishandle identities/groups on non-OpenBSD platforms"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
echo"Old doas version detected; if this is the slicer69 portable implementation, review CVE-2019-15900 and CVE-2019-15901"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
echo"Potentially vulnerable to CVE-2023-28339: OpenDoas <=6.8.2 shares the terminal and legacy TIOCSTI is enabled"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
100
+
else
101
+
echo"CVE-2023-28339 TIOCSTI path appears mitigated (dev.tty.legacy_tiocsti=$doas_tiocsti)"| sed -${E}"s,.*,${SED_GREEN},g"
102
+
fi
103
+
else
104
+
echo"OpenDoas <=6.8.2 detected; review CVE-2023-28339 because the kernel TIOCSTI mitigation state could not be read"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
105
+
fi
106
+
fi
107
+
else
108
+
echo"Could not determine the installed doas package/version; check vendor advisories manually"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
109
+
fi
110
+
else
111
+
echo_not_found "doas"
32
112
fi
33
113
34
-
# Check all possible doas.conf locations
35
-
echo -e "\nChecking doas.conf files:"| sed -${E}"s,.*,${SED_LIGHT_CYAN},g"
if [ "$doas_rule_applies"="yes" ] && [ "$doas_rule_root"="yes" ];then
176
+
echo"$conf_file:$doas_rule_number$doas_rule_line"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
177
+
if [ "$doas_rule_unrestricted"="yes" ] && [ "$doas_rule_nopass"="yes" ];then
178
+
echo"POTENTIAL: a matching permit rule allows arbitrary root commands without a password; a later rule may override it"| sed -${E}"s,.*,${SED_RED},g"
179
+
elif [ "$doas_rule_unrestricted"="yes" ];then
180
+
echo"POTENTIAL: a matching permit rule allows arbitrary root commands after authentication; a later rule may override it"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
echo"POTENTIAL: a matching permit rule allows GTFOBins-capable command $doas_rule_cmd_value as root without a password; a later rule may override it"| sed -${E}"s,.*,${SED_RED},g"
183
+
if [ "${doas_rule_cmd_value##*/}"="dstat" ];then
184
+
echo"This is the HTB Soccer privilege-escalation pattern: a user-controlled dstat plugin can execute as root"| sed -${E}"s,.*,${SED_RED},g"
185
+
fi
186
+
elif [ "$doas_rule_dangerous"="yes" ];then
187
+
echo"POTENTIAL: a matching permit rule allows GTFOBins-capable command $doas_rule_cmd_value as root after authentication; a later rule may override it"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
188
+
elif [ "$doas_rule_nopass"="yes" ];then
189
+
echo"POTENTIAL: a matching permit rule allows $doas_rule_cmd_value as root without a password; inspect command-specific escapes and later rules"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
190
+
fi
191
+
if [ "$doas_rule_env"="yes" ];then
192
+
echo"Dangerous environment preservation is enabled for an applicable root rule (keepenv or sensitive setenv variable)"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
echo"$conf_file:$doas_rule_number$doas_rule_line"| sed -${E}"s,.*,${SED_LIGHT_CYAN},g"
196
+
else
197
+
echo"$conf_file:$doas_rule_number$doas_rule_line"
198
+
fi
199
+
done<<EOF
200
+
$doas_active_rules
201
+
EOF
41
202
fi
42
-
cat "$conf_file"2>/dev/null | sed -${E}"s,$sh_usrs,${SED_RED},g"| sed "s,root,${SED_RED},g"| sed "s,nopass,${SED_RED},g"| sed -${E}"s,$nosh_usrs,${SED_BLUE},g"| sed "s,$USER,${SED_RED_YELLOW},g"
203
+
else
204
+
echo"Cannot read $conf_file directly; attempting safe effective-rule checks with doas -C"
205
+
doas_active_rules=""
43
206
fi
44
-
done
45
207
46
-
# Check if doas is working
47
-
if [ -n"$doas_bin" ];then
48
-
echo -e "\nTesting doas:"| sed -${E}"s,.*,${SED_LIGHT_CYAN},g"
49
-
if$doas_bin -l 2>/dev/null;then
50
-
echo"doas -l command works!"| sed -${E}"s,.*,${SED_RED_YELLOW},g"
0 commit comments