ปิดช่องโหว่ Terrapin CVE-2023–48795 สำหรับ CentOS7 และ Ubuntu 18.04

--

ช่องโหว่ Terrapin เป็นช่องโหว่ของโปรโตคอล Secure Shell หรือ ssh ที่เปิดทางให้แฮกเกอร์สามารถแก้ไขข้อมูลบางส่วนระหว่างเริ่มต้นการเชื่อมต่อ ทำให้สามารถปิดฟีเจอร์ความปลอดภัยบางอย่างได้สำเร็จ ตามข่าว
https://www.blognone.com/node/137433

ซึ่งใน Server Linux ที่ยังไม่มี patch มาแก้ไข เราจะปิดช่องโหว่ ตาม
https://access.redhat.com/security/cve/cve-2023-48795?fbclid=IwAR3vLlSkFXN98DYXqAFUTFm1905ShNMVIiY-u1jWYF1crdVQW9iZMWIil4A

โดยทำตาม ดังนี้

Edit /etc/ssh/sshd_config

# สำหรับ ubuntu 18.04 หรือใหม่กว่า
Ciphers -chacha20-poly1305@openssh.com

# สำหรับ CentOS 7 หรือ เครื่องที่ใส่คอนฟิกด้านบนแล้ว restart sshd ไม่ได้ ให้ใส่แบบนี้แทน

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc
MACs hmac-sha1,hmac-sha1–96,hmac-sha2–256,hmac-sha2–512,hmac-md5,hmac-md5–96,hmac-ripemd160,hmac-ripemd160@openssh.com,umac-64@openssh.com,umac-128@openssh.com

/etc/ssh/sshd_config

จากนั้นสั่ง restart sshd

# systemctl restart sshd

Client ทดสอบโดย โหลด terrapinscanner จาก
https://github.com/RUB-NDS/Terrapin-Scanner/releases

ซึ่งจะมีหลากหลาย platform ทั้ง linux และ Windows โดยผมเลือก Download ของ linux และ chmod ให้ execute ได้ และ rename ให้เรียกใช้งานได้ง่ายขึ้น

# chmod +x Terrapin_Scanner_Linux_amd64
# mv Terrapin_Scanner_Linux_amd64 terrapinscanner

# ./terrapinscanner -connect <IP Address/Hostname>

ถ้า ChaCha20-Poly1305 และ CBC-EtM support: false ถือว่า OK แล้ว

--

--