https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-0235
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-0235
파일명 : cve-2015-0235.c
#include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #define CANARY "in_the_coal_mine" struct { char buffer[1024]; char canary[sizeof(CANARY)]; } temp = { "buffer", CANARY }; int main(void) { struct hostent resbuf; struct hostent *result; int herrno; int retval; /*** strlen (name) = size_needed - sizeof (*host_addr) - sizeof (*h_addr_ptrs) - 1; ***/ size_t len = sizeof(temp.buffer) - 16*sizeof(unsigned char) - 2*sizeof(char *) - 1; char name[sizeof(temp.buffer)]; memset(name, '0', len); name[len] = ' '; retval = gethostbyname_r(name, &resbuf, temp.buffer, sizeof(temp.buffer), &result, &herrno); if (strcmp(temp.canary, CANARY) != 0) { puts("vulnerable"); exit(EXIT_SUCCESS); } if (retval == ERANGE) { puts("not vulnerable"); exit(EXIT_SUCCESS); } puts("should not happen"); exit(EXIT_FAILURE); }
|
gcc -o check_ghost cve-2015-0235.c
./check_ghost
실행후
vulnerable : 취약점을 가지고 있으므로 패치가 필요
not vulnerable : 취약점이 패치되어 있음
물론 업데이트 이후 완전한 적용을 위해 리부팅을 진행해야함~
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
» | CVE-2015-0235 GHOST BUG | 위대한유저 | 2015.02.05 | 997 |
48 | WordPress 4.9.1 Security and Maintenance Release | 관리자 | 2017.11.30 | 1064 |
47 | cacti-0.8.8c 버전에서의 주의점 | 위대한유저 | 2015.02.03 | 1077 |
46 | Aria from berserk | 위대한유저 | 2015.07.08 | 1080 |
45 | cannot load media library on wordpress (feat. modsecurity & sql injection ruleset) | 관리자 | 2018.02.26 | 1108 |
44 | Creating default object from empty value in PHP5.4 | 위대한유저 | 2015.04.29 | 1112 |
43 | PHP + redis(phpredis) 연동하기 | 위대한유저 | 2015.06.04 | 1122 |
42 | 리눅스 virtualbox에서 게스트os에 usb드라이브 마운트 안된다면... | 위대한유저 | 2015.01.20 | 1146 |
41 | XE 1.8.6 RELEASE | 위대한유저 | 2015.07.14 | 1173 |
40 | ORA-65096: invalid common user or role name on oracle12c | 위대한유저 | 2015.07.08 | 1211 |
39 | [python] ValueError: zero length field name in format. | 관리자 | 2018.03.30 | 1279 |
38 | NL-00303: SYNTAX ERROR IN NV STRING | 위대한유저 | 2015.07.08 | 1418 |
37 | How to download and install prebuilt OpenJDK packages in LINUX(redhat and ubuntu) | 관리자 | 2018.04.24 | 1497 |
36 | atime, mtime, ctime 의 차이점 | 위대한유저 | 2014.11.27 | 1502 |
35 | hdparm 을 이용한 디스크 초기화 | 위대한유저 | 2014.11.14 | 1521 |