KAIST-IS521 / 2018s-gitctf-team2

1 stars 1 forks source link

exploit-bug2 #56

Closed saykim0727 closed 6 years ago

saykim0727 commented 6 years ago

-----BEGIN PGP MESSAGE-----

hQEMAy8nZUIPGP0nAQf/UfRv28MNyJQSqEo1VoMOURMB83CWZBziN8rDw3EPgJX1 hE6/vizrFNbjHPFKJ3K/GDuVyuIDu48Cie8f13TWK2Cy02U3Q4eJkKRlhq05ZNxH P+AM/5q69euYGyNQkMUGmGSBPqhLJPFL2bq9yVDLiKFPwtwULcesDTk5IZe0uijU h/u94RVy+u2xez2ABTYZdvNzyO4hpmafyuZsYdG9Y55Xr+sHIzOxJ9F6UWswp1xE gFLZ3YItBJcaexlHifSlg2V4KFYEiVDAxT2awLcAayNlpeRIzmK/A0ErMI2GZp7n WEuKgByOq003gFvBtaLDj+bT4IDFKoQF7PlnsNPtkoUCDAM4dsjNUVw9egEQAIUi i9aKkfllHVAQ1HMc8pNkD6pjDPWar+NveIY1WAPnEQjBBUPgWpkKyx4sYasc0uUx FILTZ+PAteRXKg+sS15enHVIpxLtAJpLzHMWRXckbYxbbLXv+BMFxzWWm0Uc5Wz4 JjnFz+X9DE25IUrsWwa2JHmaE/UkBJg2uFvJ09mBvS4N+Ip2g3wDuvjGH0ME7Ffq k5q2MBJBw1NP/1p1SmUP0oVoEWOWo9yiLEljUGEmaSFg1flA8ZUK5922ePahYGwW SC8Cm5X5IsFbsRnH1urojIzNV5/xqKZ3/K0eg9Rp19jspgiD/V7XSttUYYk6NgJ1 eMMrvgBjtA07sIcdi2G8vUFr2Fuv7FLLRl5JlSQmzaG57t5+/SedB8dC8Mhs2aNU 3FqqC1WAl77ok5fJNMlUcDHdgxC2MO7HdafKW9qTIArwwkbJAHHVp56WjGdunetH r3U7YEvhJohw30lWd2VWhhdin2wF8v1vrO0T+EPUAaKuJyAEsHyjoH5r89tFKeuF roOSjFSePEn5H+Ii88NyqUCYwVTjxsK8knoa3v1WpiLk15FJ4mM3WPtF4vLEMCIu lccq7O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CKTa5YZDzxGK8oL2xDN45wNH0bHGflzccH3aUaylZ kMbfqZCAF60HK41aZmjNwTyyjjVSHI11TLMteLdldqDnkQh+jOsbLe4Hhq3ii8vw 45n9AQKoObqAEQnkeU+VTmt3sc87cZoloyXHwCV1xA4l4lXfZGAfeTVradns8VuX MIV5D14OgIxBZlnqdCk431uLb2x7dVgovKf10jlzjtXJVJUGdSOQFBKM3xUoT1ZM iSBzuSxycgyLo9tZH71SPbRt172g8k7JXW6cB0DK9cQk9+9weeXsYhYtpJXYSisE yDTztz4E4LofR8JeTbdGR2xLijY9rahnxe+jl5fvHgL17ZTirLzxTzzU19fqhOTL AT+TXQhtmQTFykJPnMuc/GwKGepVoZAjt6DAq+pJDLbeXI5Q/cXRcUR2h28Rl59u n54OG6v2Bn90jMdosoWk2ClN/j0q1EQ+i2TWW+b1V1nUOk5JvpAMMZnFJf8eB/3v FxJa+UP/JAoa4GgyCvfJC3qY7SlT1uRiy1R9fFRkRt6eGdP6YammtWzZwEAyfLzV HojtOA== =Eu/D -----END PGP MESSAGE-----

softsec-is521 commented 6 years ago
About exploit-bug2 (exploit-service branch)
[*] Starting service from 2018s-gitctf-team2 (branch 'b4ed9e1cb98b46ca4a11675188af50ab147c7881')
Sending build context to Docker daemon  285.7kB
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/
---> 6e7da3f8c02a
Step 6/8 : ADD . /src
---> 3c47778f21c7
Step 7/8 : RUN cd /src; make
---> Running in 9378ac384ae2
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 9378ac384ae2
---> 6e618f21eb91
Step 8/8 : ENTRYPOINT ["/src/server", "4000"]
---> Running in 42163c4dbc48
Removing intermediate container 42163c4dbc48
---> 9192d80abc26
Successfully built 9192d80abc26
Successfully tagged 2018s-gitctf-team2-b4ed9e1cb98b46ca4a11675188af50ab147c7881:latest
3a8844dc6a449c634b42b93e0dce989800f6acba0ef09326402ee525a0fd314c
[*] Started service successfully
[*] Running exploit
Sending build context to Docker daemon  6.144kB
Step 1/9 : FROM debian:latest
---> 8626492fecd3
Step 2/9 : MAINTAINER 2018s-team2-bugg2
---> Using cache
---> 4b1908734f7d
Step 3/9 : ENV DEBIAN_FRONTEND noninteractive
---> Using cache
---> ba6eccbff9c5
Step 4/9 : RUN DIST=xenial &&     sed -i 's/deb.debian.org/ftp.daumkakao.com/' /etc/apt/sources.list &&     apt-get update &&     apt-get install -y python python-pip python-dev gcc
---> Using cache
---> c3a5d8e3b7c3
Step 5/9 : RUN rm -rf /var/lib/apt/lists/* &&     apt-get clean
---> Using cache
---> 592472b3d118
Step 6/9 : COPY test.sh /bin/exploit
---> Using cache
---> e8b0d6468b70
Step 7/9 : COPY solve.py /bin/exploits
---> Using cache
---> 6eaeec845dba
Step 8/9 : RUN chmod 777 /bin/exploits
---> Using cache
---> 07c10ce34986
Step 9/9 : RUN chmod 777 /bin/exploit
---> Using cache
---> 3ac233946ef7
Successfully built 3ac233946ef7
Successfully tagged exploit-b4ed9e1cb98b46ca4a11675188af50ab147c7881:latest
123
hello
hello
9
48
[*] Failed to run exploit

==========================
[*] Exploit returned : None
[*] Solution flag : fFaSG72dbI
[*] Exploit returned a wrong flag string

[*] The exploit did not work.