在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):taviso/loadlibrary开源软件地址(OpenSource Url):https://github.com/taviso/loadlibrary开源编程语言(OpenSource Language):C 99.2%开源软件介绍(OpenSource Introduction):Porting Windows Dynamic Link Libraries to LinuxIntroductionThis repository contains a library that allows native Linux programs to load and call functions from a Windows DLL. As a demonstration, I've ported Windows Defender to Linux.
How does it work?The What works?The intention is to allow scalable and efficient fuzzing of self-contained Windows libraries on Linux. Good candidates might be video codecs, decompression libraries, virus scanners, image decoders, and so on.
If you need to add support for any external imports, writing stubs is usually quick and easy. Why?Distributed, scalable fuzzing on Windows can be challenging and inefficient. This is especially true for endpoint security products, which use complex interconnected components that span across kernel and user space. This often requires spinning up an entire virtualized Windows environment to fuzz them or collect coverage data. This is less of a problem on Linux, and I've found that porting components of Windows Antivirus products to Linux is often possible. This allows me to run the code I’m testing in minimal containers with very little overhead, and easily scale up testing. This is just personal opinion, but I also think Linux has better tools. Windows DefenderMsMpEng is the Malware Protection service that is enabled by default on Windows 8, 8.1, 10, Windows Server 2016, and so on. Additionally, Microsoft Security Essentials, System Centre Endpoint Protection and various other Microsoft security products share the same core engine. The core component of MsMpEng responsible for scanning and analysis is called mpengine. Mpengine is a vast and complex attack surface, comprising of handlers for dozens of esoteric archive formats, executable packers, full system emulators for various architectures and interpreters for various languages. All of this code is accessible to remote attackers. BuildingTo build the test client, simply type
DependenciesNote that the
You will need to download the 32-bit antimalware update file from this page: This should be a direct link to the right file: This will download a file called
If you want to know which version you got, try this:
RunningThe main mpengine loader is called
There are some other sample tools, DebuggingIf you want to debug a crash, single step through a routine or set breakpoints, follow these examples. First, you need a map file from IDA. Microsoft doesn't release public symbols for every build, and sometimes the symbols lag behind for a few months after release. Make sure you're using an mpengine version with public symbols available. Use the following sample commandline to generate map and idb files.
If you generate the map files on Windows, you'll get CRLF line terminators, fix them like this:
When you run mpclient under gdb, it will detect a debugger and print the commands you need to enter to teach gdb about the symbols:
If you enter the commands it shows into gdb, you will have symbols available.
Then you can continue, and it will run as normal.
Breakpoints, watchpoints and backtraces all work as normal, although it may be more reliable to use hardware breakpoints than software breakpoints. To use hardware breakpoints in gdb, you just use
What about Wine and Winelib?This project does not replace Wine or Winelib. Winelib is used to port Windows C++ projects to Linux, and Wine is intended to run full Windows applications. This project is intended to allow native Linux code to load simple Windows DLLs. The closest analogy would be ndiswrapper but for userspace. Further Examples
LicenseGPL2 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论