KAIST-IS521 / 2018s-gitctf-team2

1 stars 1 forks source link

exploit-bug4 #66

Closed S-KYUCHAN closed 6 years ago

S-KYUCHAN commented 6 years ago

-----BEGIN PGP MESSAGE----- Version: GnuPG v1

hQEMAy8nZUIPGP0nAQf/bXo05FHSppXqvVt4ciHyE28vTWIDyBh9tPu9byu+9NkC vjLjGQ23T7i3vlxC+Dh/rfXU6xUv4HHCRm2vJ5oTUyQgcgNxvfcrdqFZHdWK794a Q8kka29n2gQfmouy0MvYggdmDB65UYuTCFbfKVL+0TC8fe0WSH4OmGfnuhE88JBr raqUmxjAaJOE1FYyqLOnCxQfUQRe8SknTHnNw1xuzi6QzWNE2Z7UzzASEgvYfLL0 NTPBKvcCovrZ6st7QOa10ySs4mvoslB7FEDb8Cw8kfh88X/pWBBkP8YSCNoGNNJ5 gc9wIki7l14BfhLZBEFYASDX0xzEdMDOKmOJLM5mq4UCDAM4dsjNUVw9egEP/1Uf pBnq5qcVVAHu9VvkJ27cxIAi5KuYDH/3bKpAapntWwvaVljJUsjN6Ker5ZM54iAb lpWHSTaE4l6uOeXsTDH/AHR69cXJ9HW8nmEOjFc2oOlfIWronjyWdSsOWsPeBjDb 06BY+H6TARtfwhMjvGahaSJNSTDjOae+GMqlF9ifCb06K6h9TySeaFUKODoVnmvV RbwdJQZAuJUI5Tkxvqy7+Rg6F0ymKB2QLl7+RU2bwj0PUJFfIOZHK+WxxbExddxT mZhEAy2cS1nPM6CKKSCMOhIvcFzF/761vJj8C3Pwp5lIkbign0Ql0dXWoGTOsctn dQLCLyMLlRTecaLCamLbWtP/tJc8pF0WRQ3JDwXaQ7goMSGNL3AZLoi1PzC7K4Db qQ29sk22hWF1FT6sdLEOZSqb9K0qRjkqnAJVd0GxFozTXMEwtDJVFlzy0xUALDAI s50DITkS2mlChPiUY5WsfP0MlRBGVyiCRRoN6+QjVzzaaQHLJMZX6LS+8oJO6D28 oTLyth6NPT8xRUywAQGtpUo8EE6q0HBx3yIZX6ouwwNngYX7W9KP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SrESKMhr0NVUL7UABKTzqEHf2JoeR+xRjvbHSM I9NuGUIb017yvVpMRfTtTAC3N8nPRA6lfYbnuV26CQG/ILAuHg5kR4C205ZZZYRG H8N6nt6okENXGhu0ff6XsRCmuiBDoLr7wrWXEYkPFqqzX8xqUOkNbC3JkiAfREtN DV7+703/zDzX3aMy714N3gfNMACtXcGAHF8vo5keiVyu8gEwF0eBWqXgKO8iE26B f01+vpzzy+de8ju5P+8Rs+ZBRtPmg+1eZMTcYClx/93YKId+/nNPPNquCZNdsy52 Trsc6ABhKqUyXOAItKkRPa7cz9gQAN752suC20g25irhZnf4yi5mSiTcq2W9Emrx OvZ09kXxTd4dohYXPpBREVGsQU1Peq/M8c8nZPmZYm5fivNNz3STrDMQxdN9urHT FLn0Li3ldrgUphJmbEUmlZ4NiwQmrtWHQ06rS+OutBq2NuCu6y/3DD57LJJAP/UD HuGGs60YJjQ6GMf0oEXyzmQA =fBm4 -----END PGP MESSAGE-----

softsec-is521 commented 6 years ago
About exploit-bug4 (exploit-service branch)
[*] Starting service from 2018s-gitctf-team2 (branch 'fe26e2ba5789e238ba74d1bd191609ae89ce6483')
Sending build context to Docker daemon  283.1kB
Step 1/8 : FROM debian:latest
---> 8626492fecd3
Step 2/8 : RUN         sed -i 's/deb.debian.org/ftp.daumkakao.com/g' /etc/apt/sources.list
---> Using cache
---> 45fa25df3fa6
Step 3/8 : RUN apt-get update && apt-get install -y make gcc procps
---> Using cache
---> b5afc8e01f5a
Step 4/8 : RUN mkdir -p /var/ctf
---> Using cache
---> bfee81318d4c
Step 5/8 : COPY ./flag /var/ctf/
---> b158c7eda955
Step 6/8 : ADD . /src
---> 1c40004bca60
Step 7/8 : RUN cd /src; make
---> Running in 67b5004de6f4
gcc -fpie -pie -z now -o cclient -Wall tcp_client.c
tcp_client.c: In function 'message':
tcp_client.c:311:56: warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
printf("Error, message to long, message length is: %d\n", strlen(text));
^
tcp_client.c:288:8: warning: variable 'command' set but not used [-Wunused-but-set-variable]
char *command, *handle, *text, *orig;
^~~~~~~
tcp_client.c: In function 'broadcast':
tcp_client.c:341:55: warning: format '%d' expects argument of type 'int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
printf("Error, message to long, message length is: %d\n", strlen(text));
^
tcp_client.c:325:8: warning: variable 'command' set but not used [-Wunused-but-set-variable]
char *command, *text, *orig;
^~~~~~~
gcc -fpie -pie -z now -o server -Wall tcp_server.c
Removing intermediate container 67b5004de6f4
---> ea7c3365b611
Step 8/8 : ENTRYPOINT ["/src/server", "4000"]
---> Running in 2182aef83e53
Removing intermediate container 2182aef83e53
---> b54c38459bad
Successfully built b54c38459bad
Successfully tagged 2018s-gitctf-team2-fe26e2ba5789e238ba74d1bd191609ae89ce6483:latest
2ef21261c38ff9ef662f8ad0021e8c80d9bbecdc78cf61e0e97f06ae648864fa
[*] Started service successfully
[*] Running exploit
Sending build context to Docker daemon  10.75kB
Step 1/3 : FROM debian:latest
---> 8626492fecd3
Step 2/3 : RUN apt-get update && apt-get install -y       python
---> Using cache
---> 8691a6228602
Step 3/3 : COPY exploit /bin/
---> Using cache
---> 1c4dbcbb7a32
Successfully built 1c4dbcbb7a32
Successfully tagged exploit-fe26e2ba5789e238ba74d1bd191609ae89ce6483:latest
aaaaadminadmin

mj7CBEHtm6XshellXshellXshell
[*] Exploit returned : mj7CBEHtm6XshellXshellXshell
[*] Solution flag : mj7CBEHtm6
[*] Exploit returned a wrong flag string

[*] The exploit did not work.