-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcheck_cve.sh
More file actions
executable file
·40 lines (36 loc) · 1.39 KB
/
Copy pathcheck_cve.sh
File metadata and controls
executable file
·40 lines (36 loc) · 1.39 KB
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
35
36
37
38
39
40
#!/bin/bash
# CVE-2026-31431 (Copy-Fail) Vulnerability Checker
echo "=========================================="
echo "CVE-2026-31431 (Copy-Fail) Checker"
echo "=========================================="
V=0
echo -e "\n[1] algif_aead module"
lsmod | grep -q "^algif_aead" && echo "[VULN] LOADED" && V=1 || echo "[INFO] not loaded"
echo -e "\n[2] CRYPTO_USER_API config"
if zcat /proc/config.gz 2>/dev/null | grep -q "^CONFIG_CRYPTO_USER_API=y"; then
echo "[VULN] BUILT-IN"; V=1
elif zcat /proc/config.gz 2>/dev/null | grep -q "^CONFIG_CRYPTO_USER_API=m"; then
echo "[INFO] MODULE (trying to load...)"
modprobe algif_aead 2>/dev/null
lsmod | grep -q "^algif_aead" && echo "[VULN] loaded OK" && V=1
else
echo "[SAFE] not enabled"
fi
echo -e "\n[3] authencesn algorithm"
grep -q "authencesn" /proc/crypto 2>/dev/null && echo "[VULN] available" && V=1 || echo "[SAFE] not found"
echo -e "\n[4] AF_ALG socket test"
python3 -c "
import socket
try:
s=socket.socket(38,5,0)
s.bind(('aead','authencesn(hmac(sha256),cbc(aes))'))
print('[VULN] socket created OK')
exit(0)
except Exception as e:
print('[SAFE] failed:',e)
exit(1)
" 2>/dev/null && V=1
echo -e "\n=========================================="
echo "RESULT: $([ $V -eq 1 ] && echo '[!!!] VULNERABLE' || echo '[OK] NOT vulnerable')"
echo "=========================================="
echo "Fix: rmmod algif_aead || update kernel"