Jump to content
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr ×
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr

RAD Studio 11.1과 윈도우 PE 보안 플래그


Recommended Posts

엠바카데로 블로그에 마르코 칸투가 쓴 "RAD Studio 11.1 and Windows PE Security Flags"를 번역한 글 (원문 작성일: 2022년 3월 25일, 번역일: 2022년 3월 30일)

Delphi and C++Builder in 11.1 enable by default a number of PE security flags for Windows applications, some of which were already available, but a bit hidden.

델파이와 C++빌더는 11.1에서 윈도우 애플리케이션용 여러 PE 보안 플래그를 기본적으로 활성화한다. 그 중 일부는 살짝 숨겨져 있었을 뿐 이미 있었던 것들이다.

--------

Delphi has long had some support for ASLR and some of the other recommended Windows security flags. In the recent 11.1 release, Embarcadero made it easier to use those flags in both Delphi and C++Builder, by surfacing specific linker options, enabling them by default, and also building packages and applications that are part of RAD Studio with those flags enabled.

델파이는 오랫동안 ASLR 및 기타 권장 윈도우 보안 플래그를 지원해 왔다. 최근 11.1 릴리스에서 엠바카데로는 델파이와 C++빌더 모두에서 해당 플래그를 더 쉽게 사용할 수 있도록 했다. 여기에는 특정 링커 옵션을 쉽게 찾을 수 있도록 꺼내 놓기, 옵션을 기본적으로 활성화하기, RAD 스튜디오의 일부인 패키지와 애플리케이션을 해당 플래그를 활성화한 상태에서 빌드하기 등이 포함된다.

 

해당 윈도우 PE 플래그에 대한 추가 사항 (More on these Windows PE Flags)

데이터 실행 방지(DEP, Data Execution Prevention)

Allows the system to mark one or more pages of memory as non-executable preventing code from running from these regions of memory, making it harder to exploit buffer overruns. You can read more about it in the Microsoft documentation here.

시스템은 하나 이상의 메모리 페이지를 실행 불가능으로 표시하여 이 메모리 영역에서 코드가 실행되지 않도록 할 수 있다. 그 결과, 버퍼 오버런을 악용하기 어렵게 만든다. 더 자세한 내용은 마이크로소프트 설명서에 있다.

 

주소 공간 배치 무작위화(ASLR, Address Space Layout Randomization)

Randomly arranges the address space positions of key data areas of a process, including the base of the executable and the positions of the stack, heap and libraries. Prevents exploitation of memory corruption vulnerabilities. You can read more about ASLR on Wikipedia.

프로세스의 주요 데이터 영역이 차지하는 주소 공간 위치를 무작위로 배정한다. 여기에는 실행 파일의 기반 뿐만 아니라 스택(stack), 힙(heap), 라이브러리의 위치도 포함된다. 그 결과, 메모리 손상 취약점을 악용하지 못하게 방지한다. 더 자세한 내용은 위키피디아에 있는 ASLR에 대한 설명을 읽기 바란다.

 

고-엔트로피(High-entropy) 64비트 ASLR (64-비트 애플리케이션에서만)

Allows ASLR to use the entire 64-bit address space, as you can read here.

ASLR은 전체 64비트 주소 공간을 사용할 수 있다. 자세한 내용은 여기를 참고

 

터미널 서비스 (Terminal Services)

Create Terminal Server aware (TSAWARE) applications. This is not related with security and covered by Microsoft here.

터미널 서버를 인식하는 (TSAWARE) 애플리케이션을 생성한다. 이것은 보안과 관련이 없으며 마이크로소프트가 여기에서 설명한다.


RAD 스튜디오 지원 능력 향상 (RAD Studio Improved Support)

While compiler flags existed before, the RAD Studio IDE now exposes these flags as linker options. You can see below the settings for Delphi and C++ Windows compilers (thanks for the images to Jim McKeeth)

컴파일러 플래그는 이미 예전부터 있었다. 하지만 이제는 RAD 스튜디오 IDE 안에 있는 링커 옵션에서 쉽게 설정할 수 있다. 아래 그림은 델파이와 C++에서 윈도우 컴파일러 옵션을 설정하는 화면이다 (이미지를 제공해준 Jim McKeeth에게 감사한다).

peflags111_01-2313780.png

peflags111_02-3606655.png

 

몇 가지 주의 사항 (A Couple of Caveats)

The ASLR compiler configuration works as expected for Delphi applications that use runtime package. For programs that link in libraries in the executable, there is a conflict with the way programs refer to delayed loaded DLL functions, which is preventing the expected behavior. This is an issue Embarcadero found after the release and would provide a fix for in the (near) future.

ASLR 컴파일러 구성은 런타임 패키지를 사용하는 델파이에서 예상대로 작동한다. 실행 파일의 라이브러리에 연결된 프로그램인 경우에는 프로그램이 지연 로드된 DLL 함수를 참조하는 방식과 충돌하여 예상되는 동작을 방해한다. 엠바카데로는 11.1 릴리스 이후에 이 이슈를 발견했으며, (가까운) 미래에 대한 픽스(fix)를 제공할 것이다.

As you can see below, for an app with runtime packages, you get the proper configuration, as shown by SysInternals Process Explorer:

아래에서 볼 수 있듯이 런타임 패키지를 사용하는 앱의 경우 SysInternals Process Explorer에 표시된 대로 적절한 구성을 얻을 수 있다.

peflags111_03-9363841.png

In general notice that these flags enforce security and there is a chance that an application using low-level code might not work any more. For example, we discovered that some old ActiveX control don’t work in the IDE any more, due to a conflict with the DEP flag.

대체로, 지금까지 설명한 플래그들은 보안을 강화한다. 그리고 로우-레벨 코드를 사용한 애플리케이션이 더 이상 동작하지 않을 가능성도 있다. 예를 들어, 우리는 IDE 안에 있던 오래된 ActiveX 컨트롤 몇가지가 더이상 작동하지 않는다는 사실을 발견했는데, DEP 플래그와 충돌이 원인이었다. 

If you see any issue in your applications, you can disable these flags, but we recommend looking into the underlying issue, as some companies as starting to require that all of the software they use is built with all of the Microsoft recommended security flags enabled.

당신의 애플리케이션에서 이슈가 있다면, 이 플래그들을 비활성화 해도 된다. 하지만, 이슈의 근본 원인 파악을 권장한다. 이미 몇몇 회사들에서는 마이크로소프트에서 권장하는 모든 보안 플래그를 활성화하여 구축한 소프트웨어 만을 요청하기 시작했기 때문이다.

이 댓글 링크
다른 사이트에 공유하기

이 토의에 참여하세요

지금 바로 의견을 남길 수 있습니다. 그리고 나서 가입해도 됩니다. 이미 회원이라면, 지금 로그인하고 본인 계정으로 의견을 남기세요.

Guest
이 토픽(기고/질문)에 답하기

×   서식있는 텍스트로 붙여넣기.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   이전에 작성한 콘텐츠가 복원되었습니다..   편집창 비우기

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

중요한 정보

이용약관 개인정보보호정책 이용규칙 이 사이트가 더 잘 작동하기 위해 방문자의 컴퓨터에 쿠키가 배치됩니다. 쿠키 설정 변경에서 원하는 설정을 할 수 있습니다. 변경하지 않으면 쿠키를 허용하는 것으로 이해합니다.