-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #382 from qilingframework/dev
Dev to 1.1-rc1
- Loading branch information
Showing
327 changed files
with
167,743 additions
and
1,616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ Advisor | |
======= | ||
NGUYEN Anh Quynh <[email protected]> | ||
|
||
Travis, Website and Documentations | ||
================================== | ||
FOO Kevin (chfl4gs) | ||
|
||
Core Developers | ||
=============== | ||
DING tianze (D1iv3) <[email protected]> | ||
|
@@ -18,11 +22,10 @@ Earl MARCUS (klks84) [email protected] | |
|
||
Key Contributors (in no particular order) | ||
========================================= | ||
FOO Kevin (chfl4gs) | ||
kabeor | ||
0ssigeno | ||
liba2k | ||
assaf_carlsba | ||
assafcarlsbad | ||
ucgJhe | ||
jhumble | ||
|
||
|
@@ -53,4 +56,4 @@ phdphuc | |
sashs | ||
knownsec | ||
hwiosec | ||
iamyeh | ||
iamyeh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
recursive-include qiling/extensions/debugger/gdbserver/xml * | ||
recursive-include qiling/extensions/windows_sdk/defs * | ||
recursive-include qiling/profiles * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
--- | ||
|
||
<p align="center"> | ||
<img width="150" height="150" src="docs/qiling_small.png"> | ||
<img width="150" height="150" src="https://raw.githubusercontent.com/qilingframework/qiling/master/docs/qiling_small.png"> | ||
</p> | ||
|
||
Qiling is an advanced binary emulation framework, with the following features: | ||
|
@@ -27,7 +27,7 @@ Visit our website https://www.qiling.io for more information. | |
|
||
#### License | ||
|
||
This project is released and distributed under [free software license GPLv2](COPYING). | ||
This project is released and distributed under [free software license GPLv2](https://github.com/qilingframework/qiling/blob/master/COPYING). | ||
|
||
--- | ||
|
||
|
@@ -199,5 +199,15 @@ Contact us at email [email protected], or via Twitter [@qiling_io](https://twitter. | |
- YU tong (sp1ke) <[email protected]> | ||
- Earl Marcus (klks84) [email protected] | ||
|
||
#### Travis-CI, Docker and Website | ||
#### Travis-CI, Docker, Website and Documentation | ||
|
||
- FOO Kevin (chfl4gs) <[email protected]> | ||
|
||
#### Key Contributors (in no particular order) | ||
|
||
- kabeor | ||
- 0ssigeno | ||
- liba2k | ||
- assafcarlsbad | ||
- ucgJhe | ||
- jhumble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework | ||
# Built on top of Unicorn emulator (www.unicorn-engine.org) | ||
import sys | ||
sys.path.append("..") | ||
from qiling import * | ||
|
||
if __name__ == "__main__": | ||
ql = Qiling( | ||
["rootfs/x86_windows/bin/NtQuerySystemInformation.exe"], | ||
"rootfs/x86_windows", | ||
output="default", | ||
libcache = True | ||
) | ||
ql.run() |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <windows.h> | ||
#include <stdio.h> | ||
#include <Winternl.h > | ||
#include <stdlib.h> | ||
#pragma comment(lib ,"ntdll.lib") | ||
typedef struct _SYSTEM_BASIC_INFORMATION2 | ||
{ | ||
ULONG Reserved; | ||
ULONG TimerResolution; | ||
ULONG PageSize; | ||
ULONG NumberOfPhysicalPages; | ||
ULONG LowestPhysicalPageNumber; | ||
ULONG HighestPhysicalPageNumber; | ||
ULONG AllocationGranularity; | ||
ULONG_PTR MinimumUserModeAddress; | ||
ULONG_PTR MaximumUserModeAddress; | ||
ULONG_PTR ActiveProcessorsAffinityMask; | ||
CCHAR NumberOfProcessors; | ||
} SYSTEM_BASIC_INFORMATION2, * PSYSTEM_BASIC_INFORMATION2; | ||
int main() | ||
{ | ||
ULONG whyme=0; | ||
SYSTEM_BASIC_INFORMATION2 sbi; | ||
|
||
NTSTATUS status = NtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(SYSTEM_BASIC_INFORMATION2), &whyme); | ||
printf("Size : 0x%x Status: 0x%x\n", whyme,status); | ||
|
||
printf("ActiveProcessorsAffinityMask : 0x%x\n", sbi.ActiveProcessorsAffinityMask); | ||
printf("AllocationGranularity : 0x%x\n", sbi.AllocationGranularity); | ||
printf("HighestPhysicalPageNumber : 0x%x\n", sbi.HighestPhysicalPageNumber); | ||
printf("LowestPhysicalPageNumber : 0x%x\n", sbi.LowestPhysicalPageNumber); | ||
printf("MaximumUserModeAddress : 0x%x\n", sbi.MaximumUserModeAddress); | ||
printf("MinimumUserModeAddress : 0x%x\n", sbi.MinimumUserModeAddress); | ||
printf("NumberOfPhysicalPages : 0x%x\n", sbi.NumberOfPhysicalPages); | ||
printf("NumberOfProcessors : 0x%x\n", sbi.NumberOfProcessors); | ||
printf("PageSize : 0x%x\n", sbi.PageSize); | ||
printf("TimerResolution : 0x%x\n", sbi.TimerResolution); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import os | ||
import sys | ||
from qiling import Qiling | ||
from qiling.extensions.sanitizers.heap import QlSanitizedMemoryHeap | ||
|
||
def my_abort(msg): | ||
print(f"\n*** {msg} ***\n") | ||
os.abort() | ||
|
||
def enable_sanitized_heap(ql, fault_rate=0): | ||
ql.loader.heap = QlSanitizedMemoryHeap(ql, ql.loader.heap) | ||
ql.loader.heap.pool_fault_rate = fault_rate | ||
ql.loader.heap.oob_handler = lambda *args: my_abort("Out-of-bounds read detected") | ||
ql.loader.heap.bo_handler = lambda *args: my_abort("Buffer overflow/underflow detected") | ||
ql.loader.heap.bad_free_handler = lambda *args: my_abort("Double free or bad free detected") | ||
ql.loader.heap.uaf_handler = lambda *args: my_abort("Use-after-free detected") | ||
|
||
def sanitized_emulate(path, rootfs, fault_type, output="debug", enable_trace=False): | ||
ql = Qiling([path], rootfs, output=output) | ||
ql.env['FaultType'] = fault_type | ||
enable_sanitized_heap(ql) | ||
ql.run() | ||
if not ql.loader.heap.validate(): | ||
my_abort("Canary corruption detected") | ||
|
||
def usage(): | ||
print(""" | ||
Usage: ./uefi_santizied_heap.py <fault-type> | ||
Valid fault types: | ||
0 - POOL_OVERFLOW_MEMCPY | ||
1 - POOL_UNDERFLOW_MEMCPY | ||
2 - POOL_OVERFLOW_USER, | ||
3 - POOL_UNDERFLOW_USER | ||
4 - POOL_OOB_READ_AHEAD | ||
5 - POOL_OOB_READ_BEHIND | ||
6 - POOL_DOUBLE_FREE | ||
7 - POOL_INVALID_FREE | ||
""") | ||
sys.exit(0) | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) < 2: | ||
usage() | ||
|
||
fault_type = bytes([int(sys.argv[1])]) | ||
rootfs = os.path.join(os.getcwd(), 'rootfs', 'x8664_efi') | ||
path = os.path.join(rootfs, 'bin', 'EfiPoolFault.efi') | ||
sanitized_emulate(path, rootfs, fault_type, output='debug', enable_trace=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.