Artwork

Black Hat/ CMP Media, Inc. and Jeff Moss에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Black Hat/ CMP Media, Inc. and Jeff Moss 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.
Player FM -팟 캐스트 앱
Player FM 앱으로 오프라인으로 전환하세요!

Nick Harbour: Stealth Secrets of the Malware Ninjas

53:15
 
공유
 

Manage episode 153226724 series 1085097
Black Hat/ CMP Media, Inc. and Jeff Moss에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Black Hat/ CMP Media, Inc. and Jeff Moss 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.
It is important for the security professional to understand the techniques used by those they hope to defend against. This presentation focuses on the anti-forensic techniques which malware authors incorporate into their malicious code, as opposed to relying solely on an external rootkit. In addition to describing a number of known but scarcely documented techniques, this presentation will describe techniques which have never been observed through the presenter?s experience with incident response and malware reverse engineering. This presentation will also demonstrate a new technique for executing a malicious program directly from memory under unix. A new technique for avoiding entropy detection of packed or encrypted executables will also be discussed.
This presentation will contain a great deal of highly technical content which covers the specifics of the techniques down to the machine instruction level. For the security professional/enthusiast with a limited technical background in this area, this presentation will serve as an eye-opening overview of malware anti-forensic techniques as well as a limited introduction to forensic analysis.
The Executable Toolkit (exetk) will be introduced and demonstrated throughout the presentation. Included in the toolkit are various utilities for data hiding, manipulation and infection of executable files.
The ability to execute a program directly from memory greatly enhances its stealth. With this ability, one malicious program can use any technique it chooses (such as downloading from the web) to fill a memory buffer with an executable, and then launch it directly without that executable ever being written to disk. If the executable is never written to disk there will be no binary for a forensic examiner to capture. A somewhat similar technique has been described before by ?the grugq?, though its inner workings were never fully described nor promised source code released. The approach taken by ?the grugq? was also significantly more obtuse and importable.
The approach to executing a process directly from memory under unix which I describe for the first time in this presentation will take the following three stage approach. The first stage is a part of an executable program which is either stand alone or infected into another legitimate process or program file. The job of the first stage loader is to first act as a debugger, and launch a debugged process with a breakpoint at the entry point. This is accomplished through the ptrace() system call. With the debugged process suspended by a breakpoint at its entry point, the first stage loader will overwrite the memory at the entry point with the second stage loader, then resume continuous execution on the process. When the debugged process resumes continuous execution the code of the second stage loader begins executing.
The role of the second stage loader is to first allocate enough memory for the new malicious executable. It then adjusts the memory protection on the new memory area to allow for writing and executing in addition to reading. The purpose for having a third stage loader is that the new executable code will likely have to be written to the same memory area in which the second stage loader currently resides. The third stage loader is a part of the same program which contains the first stage loader and performs its memory operations on the debugged process in the same fashion tradition debuggers use to alter process memory.
Control is passed from the second stage loader to the third stage loader simply by setting a breakpoint interrupt at the end of the second stage loader. Control will return to the same program which contains the first stage loader but its role at this point is changed. The job of the third stage loader is to copy the malicious program into the new process memory in the same fashion as the operating system would had the program been executed traditionally. The third stage loader must also manually resolve program imports by loading all dynamic libraries and finding the appropriate exported symbols and populating the pointers in the program?s import table accordingly. Once everything has been loaded and dynamically linked, the instruction pointer of the new malicious process is set to its entry point and execution is resumed. At this point the process containing the first and third stage loader may detach itself from debugging if necessary.
Packers will be discussed in detail. Use of a common packer such as UPX or PECompact can mask the malicious functionality of an executable but it is also very easy to ?unpack? these executables. This presentation will discuss how exactly a packer works and how you can write your own. The Executable Toolkit (exetk) will be demonstrated as a clean reference implementation for a simple obfuscating packer.
The latest malware detection software is beginning to scan for such custom packers through the use of entropy (randomness) detection. The presentation will discuss a technique to create a packer which obscures program contents which keeping a non-suspicious entropy within the data.
  continue reading

89 에피소드

Artwork
icon공유
 
Manage episode 153226724 series 1085097
Black Hat/ CMP Media, Inc. and Jeff Moss에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 Black Hat/ CMP Media, Inc. and Jeff Moss 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.
It is important for the security professional to understand the techniques used by those they hope to defend against. This presentation focuses on the anti-forensic techniques which malware authors incorporate into their malicious code, as opposed to relying solely on an external rootkit. In addition to describing a number of known but scarcely documented techniques, this presentation will describe techniques which have never been observed through the presenter?s experience with incident response and malware reverse engineering. This presentation will also demonstrate a new technique for executing a malicious program directly from memory under unix. A new technique for avoiding entropy detection of packed or encrypted executables will also be discussed.
This presentation will contain a great deal of highly technical content which covers the specifics of the techniques down to the machine instruction level. For the security professional/enthusiast with a limited technical background in this area, this presentation will serve as an eye-opening overview of malware anti-forensic techniques as well as a limited introduction to forensic analysis.
The Executable Toolkit (exetk) will be introduced and demonstrated throughout the presentation. Included in the toolkit are various utilities for data hiding, manipulation and infection of executable files.
The ability to execute a program directly from memory greatly enhances its stealth. With this ability, one malicious program can use any technique it chooses (such as downloading from the web) to fill a memory buffer with an executable, and then launch it directly without that executable ever being written to disk. If the executable is never written to disk there will be no binary for a forensic examiner to capture. A somewhat similar technique has been described before by ?the grugq?, though its inner workings were never fully described nor promised source code released. The approach taken by ?the grugq? was also significantly more obtuse and importable.
The approach to executing a process directly from memory under unix which I describe for the first time in this presentation will take the following three stage approach. The first stage is a part of an executable program which is either stand alone or infected into another legitimate process or program file. The job of the first stage loader is to first act as a debugger, and launch a debugged process with a breakpoint at the entry point. This is accomplished through the ptrace() system call. With the debugged process suspended by a breakpoint at its entry point, the first stage loader will overwrite the memory at the entry point with the second stage loader, then resume continuous execution on the process. When the debugged process resumes continuous execution the code of the second stage loader begins executing.
The role of the second stage loader is to first allocate enough memory for the new malicious executable. It then adjusts the memory protection on the new memory area to allow for writing and executing in addition to reading. The purpose for having a third stage loader is that the new executable code will likely have to be written to the same memory area in which the second stage loader currently resides. The third stage loader is a part of the same program which contains the first stage loader and performs its memory operations on the debugged process in the same fashion tradition debuggers use to alter process memory.
Control is passed from the second stage loader to the third stage loader simply by setting a breakpoint interrupt at the end of the second stage loader. Control will return to the same program which contains the first stage loader but its role at this point is changed. The job of the third stage loader is to copy the malicious program into the new process memory in the same fashion as the operating system would had the program been executed traditionally. The third stage loader must also manually resolve program imports by loading all dynamic libraries and finding the appropriate exported symbols and populating the pointers in the program?s import table accordingly. Once everything has been loaded and dynamically linked, the instruction pointer of the new malicious process is set to its entry point and execution is resumed. At this point the process containing the first and third stage loader may detach itself from debugging if necessary.
Packers will be discussed in detail. Use of a common packer such as UPX or PECompact can mask the malicious functionality of an executable but it is also very easy to ?unpack? these executables. This presentation will discuss how exactly a packer works and how you can write your own. The Executable Toolkit (exetk) will be demonstrated as a clean reference implementation for a simple obfuscating packer.
The latest malware detection software is beginning to scan for such custom packers through the use of entropy (randomness) detection. The presentation will discuss a technique to create a packer which obscures program contents which keeping a non-suspicious entropy within the data.
  continue reading

89 에피소드

모든 에피소드

×
 
Loading …

플레이어 FM에 오신것을 환영합니다!

플레이어 FM은 웹에서 고품질 팟캐스트를 검색하여 지금 바로 즐길 수 있도록 합니다. 최고의 팟캐스트 앱이며 Android, iPhone 및 웹에서도 작동합니다. 장치 간 구독 동기화를 위해 가입하세요.

 

빠른 참조 가이드