## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-YASSDEV221608-CVE-2024-6387_POC
# ์์ฝ
์ด๋ ๋ณธ์ง์ ์ผ๋ก ํต๊ณ์ ์ทจ์ฝ์ ์
๋๋ค. ์ฆ, ๋ ์ด์ค ์ปจ๋์
์์ ์น๋ฆฌํ๊ณ ์์ ์ฝ๋๋ฅผ ์ฑ๊ณต์ ์ผ๋ก ์คํํ๋ ค๋ฉด ๋ง์ ์๋๊ฐ ํ์ํฉ๋๋ค. ๊ณต๊ฒฉ์๋ ๋ง์ ์ฅ์ ๋ฌผ์ ๊ทน๋ณตํด์ผ ํ๋ค๊ณ Schwartz๋ SecurityWeek์ ๋งํ์ต๋๋ค. "์ต์์ ์๋๋ฆฌ์ค์์๋ ๊ฐ์ฅ ์ ์๋ ค์ง ์ทจ์ฝ์ ์ ์
์ฉํ๋ ๋ฐ 4์๊ฐ ์ด์์ด ๊ฑธ๋ฆฝ๋๋ค."
OpenSSH 9.8 ๋ฆด๋ฆฌ์ค ๋
ธํธ์์ ๊ฐ๋ฐ์๋ค์ ์ด ์ทจ์ฝ์ ์ด glibc ๊ธฐ๋ฐ 32๋นํธ Linux ์์คํ
์์๋ง ํ์ธ๋์์ผ๋ฉฐ OpenBSD๋ ์ํฅ์ ๋ฐ์ง ์๋๋ค๊ณ ๋ฐํ์ต๋๋ค.
# ํ๊ฒฝ ์ค์
ํ๊ฒฝ์ Docker๋ฅผ ์ฌ์ฉํ์ฌ ์ค์ ๋ฉ๋๋ค.
## 1\. Dockerfile ์์ฑ
root@kitploit:~
# 1.1. Writing the Dockerfile
FROM i386/ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y \
build-essential \
wget \
curl \
libssl-dev:i386 \
zlib1g-dev:i386
RUN groupadd sshd && useradd -g sshd -s /bin/false sshd
RUN wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.2p1.tar.gz && \
tar -xzf openssh-9.2p1.tar.gz && \
cd openssh-9.2p1 && \
./configure && make && make install
RUN mkdir /var/run/sshd
RUN echo 'root:password' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /usr/local/etc/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /usr/local/etc/sshd_config && \
echo 'MaxStartups 100:30:200' >> /usr/local/etc/sshd_config
RUN echo '#!/bin/bash\n/usr/local/sbin/sshd -V' > /show_version.sh && \
chmod +x /show_version.sh
EXPOSE 22
CMD ["/usr/local/sbin/sshd", "-D"]