Binee adalah lingkungan emulasi biner lengkap yang berfokus pada introspeksi semua operasi IO. Tujuan utama untuk proyek ini adalah untuk menyediakan lingkungan yang fleksibel untuk menentukan efek samping binari pada sistem.
Tujuan yang coba Binee coba selesaikan adalah sebagai berikut:
Jika Anda memilih untuk menggunakan Binee untuk meniru bagian Microsoft Windows, Anda bertanggung jawab penuh untuk mendapatkan hak dan lisensi yang diperlukan dari Microsoft.
Silakan kirimkan masalah github atau jika Anda ingin berbicara dengan kami secara langsung, ikut bergabung dalam kendur
ruang kerja slack
slide
video demo
presentasi
Jika Anda menjalankan Binee di Microsoft Windows, Anda dapat melewatkan langkah sistem file mock.
Sebagian besar malware akan membutuhkan setidaknya beberapa DLL standar dan DLL ini perlu diakses dari sistem file mock. Sistem file mock "root" default terletak di os/win10_32/ . Untuk memungkinkan malware memuat DLL, Anda perlu menyalinnya ke lokasi yang sesuai dalam sistem file mock. Biasanya, ini harus disalin ke, os/win10_32/windows/system32/ . Saat ini, hanya 32-bit DLL yang ditarik dari instalasi Windows 32-bit didukung. Setelah Anda memiliki file yang diperlukan di direktori itu, Anda dapat pindah ke langkah kompilasi dan berjalan.
Bangun dengan komando Docker berikut docker build -t binee .
docker run -it -v $PWD:/bineedev/go/src/github.com/carbonblack/binee binee bash
Unduh Ketergantungan Golang dan Bangun Binee
root@2b0fee41629f:~/go/src/github.com/carbonblack/binee# go build
Catatan: Kehadiran file go.mod akan mengarahkan utilitas build untuk mengumpulkan dependensi saat dibangun, dan juga memungkinkan repositori dikloning dan dikembangkan di jalur apa pun (terlepas dari $GOPATH ) direktori
Pada titik ini Anda harus dapat menjalankan Binee di dalam wadah Docker dan melihat menu penggunaan.
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
Jika Anda menjalankan di Microsoft Windows dan/ atau Anda memiliki sistem file mock Anda yang dikonfigurasi dengan benar, Anda harus dapat menjalankan semua file PE dalam tests/ direktori.
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-update Paket Sistem:
$ pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime
-Restart msys kemudian perbarui yang lainnya:
$ pacman -Su
Untuk menyusun Windows 32-bit, jalankan:
$ pacman -S python2
$ pacman -S make
$ pacman -S mingw-w64-i686-toolchain
Untuk menyusun Windows 64-bit, jalankan:
$ pacman -S python2
$ pacman -S make
$ pacman -S mingw-w64-x86_64-toolchain
-instal pergi:
pacman -S mingw-w64-x86_64-go
3-Restart MSYS lagi; Kemudian klon ke unicorn dan instal:
git clone https://github.com/unicorn-engine/unicorn
cd unicorn
./make.sh
./make.sh install
4-Clone Binee dan Bangun cd binee
go build