Binee เป็นสภาพแวดล้อมการจำลองแบบไบนารีที่สมบูรณ์ซึ่งมุ่งเน้นไปที่การวิปัสสนาของการดำเนินการ IO ทั้งหมด เป้าหมายหลักสำหรับโครงการนี้คือการให้สภาพแวดล้อมที่ยืดหยุ่นสำหรับการกำหนดผลข้างเคียงของไบนารีต่อระบบ
เป้าหมายที่ Binee พยายามแก้ไขมีดังต่อไปนี้:
หากคุณเลือกที่จะใช้ Binee เพื่อเลียนแบบบางส่วนของ Microsoft Windows คุณต้องรับผิดชอบ แต่เพียงผู้เดียวในการได้รับสิทธิ์และใบอนุญาตที่จำเป็นจาก Microsoft
โปรดส่งปัญหา GitHub หรือหากคุณต้องการพูดคุยกับเราโดยตรงมาร่วมเข้าร่วมอยู่ใน Slack
พื้นที่ทำงานหย่อน
สไลด์
วิดีโอสาธิต
การนำเสนอ
หากคุณใช้งาน Binee บน Microsoft Windows คุณสามารถข้ามขั้นตอนระบบไฟล์จำลอง
มัลแวร์ส่วนใหญ่จะต้องใช้ DLL มาตรฐานอย่างน้อยและ DLL เหล่านี้จะต้องสามารถเข้าถึงได้จากระบบไฟล์จำลอง ระบบล้อเลียน "รูท" เริ่มต้นอยู่ใน os/win10_32/ เพื่อให้มัลแวร์โหลด DLLS คุณจะต้องคัดลอกไปยังตำแหน่งที่เหมาะสมภายในระบบไฟล์จำลอง โดยทั่วไปควรคัดลอกสิ่งเหล่านี้ลงใน os/win10_32/windows/system32/ ปัจจุบันรองรับ DLL เพียง 32 บิตจากการติดตั้ง Windows 32 บิตเท่านั้น เมื่อคุณมีไฟล์ที่ต้องการในไดเรกทอรีนั้นคุณสามารถย้ายไปยังขั้นตอนการรวบรวมและเรียกใช้
สร้างด้วยคำสั่ง 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 )
ณ จุดนี้คุณควรจะสามารถดำเนินการ binee ภายในคอนเทนเนอร์ Docker และดูเมนูการใช้งาน
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 และ/ หรือคุณมีระบบไฟล์จำลองที่กำหนดค่าไว้อย่างถูกต้องคุณควรจะสามารถเรียกใช้ไฟล์ PE ทั้งหมดได้ภายใน tests/ ไดเรกทอรี
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
-ติดตั้งไป:
pacman -S mingw-w64-x86_64-go
3-restart msys อีกครั้ง; จากนั้นโคลนเข้าไปในยูนิคอร์นและติดตั้ง:
git clone https://github.com/unicorn-engine/unicorn
cd unicorn
./make.sh
./make.sh install
4-Clone Binee และสร้าง cd binee
go build