Binee는 모든 IO 작업의 내성에 중점을 둔 완전한 이진 에뮬레이션 환경입니다. 이 프로젝트의 주요 목표는 시스템에 이진 부작용을 결정하기위한 유연한 환경을 제공하는 것입니다.
Binee가 해결하려는 목표는 다음과 같습니다.
Binee를 사용하여 Microsoft Windows의 일부를 모방하기로 선택한 경우 Microsoft로부터 필요한 권한과 라이센스를 얻는 데 책임이 있습니다.
Github 문제를 제출하거나 직접 대화하고 싶다면 가입이 Slack에 가입하십시오.
슬랙 작업 공간
슬라이드
데모 비디오
프레젠테이션
Microsoft Windows에서 Binee를 실행중인 경우 Mock 파일 시스템 단계를 건너 뛸 수 있습니다.
대부분의 맬웨어에는 적어도 일부 표준 DLL이 필요하며 이러한 DLL은 모의 파일 시스템에서 액세스 할 수 있어야합니다. 기본 "루트"모의 파일 시스템은 os/win10_32/ 에 있습니다. 맬웨어가 DLL을로드 할 수 있도록 MOCK 파일 시스템 내의 적절한 위치로 복사해야합니다. 일반적으로 os/win10_32/windows/system32/ 로 복사해야합니다. 현재 32 비트 Windows 설치에서 32 비트 DLL 만 지원됩니다. 해당 디렉토리에 필요한 파일이 있으면 컴파일 및 실행 단계로 이동할 수 있습니다.
다음 Docker 사령부 docker build -t binee .
docker run -it -v $PWD:/bineedev/go/src/github.com/carbonblack/binee binee bash
Golang 의존성을 다운로드하고 Binee를 구축하십시오
root@2b0fee41629f:~/go/src/github.com/carbonblack/binee# go build
참고 : Go.Mod 파일의 존재는 빌드 유틸리티를 빌드시 의존성을 수집하도록 지시하고, 또한 저장소를 모든 경로 ( $GOPATH 에 관계없이) 디렉토리에서 복제하고 개발할 수 있습니다.
이 시점에서 Docker 컨테이너 내에서 Binee를 실행하고 사용 메뉴를 볼 수 있어야합니다.
root@6a6fe8c2b2a7:~/go/src/github.com/carbonblack/binee# ./binee -h
Usage of ./binee:
-A list all apisets and their mappings
-a string
get the real dll name from an apiset name
-c string
path to configuration file
-d show the dll prfix on all function calls
-e dump pe file's exports table
-i dump a pe file's imports table
-j output data as json
-l call DLLMain while loading DLLs
-r string
root path of mock file system, defaults to ./os/win10_32 (default "os/win10_32/")
-v verbose level 1
-vv
verbose level 2
Microsoft Windows에서 실행 중이거나 Mock 파일 시스템이 올바르게 구성된 경우 tests/ 디렉토리 내에서 모든 PE 파일을 실행할 수 있어야합니다.
root@6a6fe8c2b2a7:~/go/src/github.com/carbonblack/binee# go build && ./binee tests/ConsoleApplication1_x86.exe
[1] 0x2190c0b0: F GetSystemTimeAsFileTime(lpSystemTimeAsFileTime = 0xb7feffe0) = 0xb7feffe0
[1] 0x21905b40: P GetCurrentThreadId() = 0x0
[1] 0x219138d0: P GetCurrentProcessId() = 0x2001
[1] 0x2011ef30: P GetCurrentProcessId() = 0x2001
[1] 0x21905b50: F QueryPerformanceCounter(lpPerformanceCount = 0xb7feffd8) = 0x1
[1] 0x2190c500: F IsProcessorFeaturePresent(ProcessorFeature = 0xa) = 0x1
[1] 0x213af570: F _initterm_e(PVFV = 0x4020d8, PVFV = 0x4020e4) = 0x0
[1] 0x213af970: F _initterm(PVPV = 0x4020cc, PVPV = 0x4020d4) = 0x0
[1] 0x213be980: F __p___argv() = 0x7ffe0004
[1] 0x213b96f0: F __p___argc() = 0x7ffe0000
[1] 0x213bec50: F _get_initial_narrow_environment() = 0x7ffe0000
[1] 0x213ac0a0: P __acrt_iob_func() = 0x5dda9c68
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'GENERIC_READ = 0x%llxn', p0 = 0x80000000) = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'GENERIC_WRITE = 0x%llxn', p0 = 0x40000000) = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'INVALID_HANDLE = 0x%llxn', p0 = 0xffffffff) = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x0
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'CREATE_ALWAYS = 0x%xn', p0 = 0x2) = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'FILE_ATTRIBUTE_NORMAL = 0x%xn', p0 = 0x80) = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'ERROR_SUCCESS = 0x%xn', p0 = 0x0) = 0x403380
[1] 0x21913b80: F CreateFileA(lpFileName = 'malfile.exe', dwDesiredAccess = 0xc0000000, dwShareMode = 0x0, lpSecurityAttributes = 0x0, dwCreationDisposition = 0x2, dwFlagsAndAttributes = 0x80, hTemplateFile = 0x0) = 0xa00007b6
[1] 0x2196bfbe: F VerSetConditionMask() = 0xa00007b6
[1] 0x213ac0a0: P __acrt_iob_func() = 0xa00007b6
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'out = 0x%xn', p0 = 0xa00007b6) = 0x403380
[1] 0x2196bfbe: F VerSetConditionMask() = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'out = 0x%xn', p0 = 0x403380) = 0x403380
[1] 0x2196bfbe: F VerSetConditionMask() = 0x403380
[1] 0x213ac0a0: P __acrt_iob_func() = 0x403380
[1] 0x213bb710: F __stdio_common_vfprintf(stream = 0x0, format = 'out = 0x%xn', p0 = 0x403380) = 0x403380
[1] 0x21bc0780: P memset(dest = 0xb7feff1c, char = 0x0, count = 0x58) = 0xb7feff1c
[1] 0x21914000: F WriteFile(hFile = 0xa00007b6, lpBuffer = 0xb7feff10, nNumberOfBytesToWrite = 0xb, lpNumberOfBytesWritten = 0xb7feff0c, lpOverlapped = 0x0) = 0xb
[1] 0x2190c500: F IsProcessorFeaturePresent(ProcessorFeature = 0x17) = 0x1
[1] 0x2190fef0: F SetUnhandledExceptionFilter(lpTopLevelExceptionFilter = 0x0) = 0x4
[1] 0x21927950: F UnhandledExceptionFilter(ExceptionInfo = 0x402100) = 0x1
[1] 0x219138c0: P GetCurrentProcess() = 0x1
[1] 0x20122cb0: P GetCurrentProcess() = 0x1
[1] 0x21910690: F TerminateProcess(hProcess = 0xffffffff, uExitCode = 0xc0000409) = 0xffffffff
1- install msys64/32 : https://osdn.net/projects/mingw/releases/
2 시스템 패키지 업데이트 :
$ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
-Restart MSYS 다음 다른 모든 것을 업데이트합니다.
$ pacman -Su
Windows 32 비트를 컴파일하려면 실행하십시오.
$ pacman -S python2
$ pacman -S make
$ pacman -S mingw-w64-i686-toolchain
Windows 64 비트를 컴파일하려면 실행 :
$ pacman -S python2
$ pacman -S make
$ pacman -S mingw-w64-x86_64-toolchain
-Stall Go :
pacman -S mingw-w64-x86_64-go
3- 레스트 타르 MSYS 다시; 그런 다음 유니콘으로 복제하고 설치하십시오.
git clone https://github.com/unicorn-engine/unicorn
cd unicorn
./make.sh
./make.sh install
4- 클론 바인과 cd binee 만듭니다
go build