AttackSurfaceAnalyzer icon indicating copy to clipboard operation
AttackSurfaceAnalyzer copied to clipboard

DEP and ASLR Flags reported as false positive

Open Kurosaki22 opened this issue 4 years ago • 5 comments

Describe the bug Files with active DEP and ASLR flags are reported as false positive. We are facing the issue that files which are verified to have DEP and ASLR activated reported that theses flags are missing.

To Reproduce Run ASA GUI as Admin Use Guided Mode Select "Enable FileSystem Collector" Let ASA analyze the system and wait until is in monitoring mode and you can perform changes Install any software and launch it. Close the software and stop the monitoring of ASA

Expected behavior Files with DEP and ASLR are not reported as false positive

Screenshots image

System Configuration (please complete the following information):

  • OS: Windows
  • OS Version: Windows 11 21H2 (OS Build 22000.258)
  • Application Version: 2.3.282
  • CLI or GUI: GUI (as Administrator)

Additional Context JSON export of an Microsoft binary as example JSON report example.txt

Kurosaki22 avatar Jun 22 '22 10:06 Kurosaki22

Hey @Kurosaki22,

Thanks for the report.

The rules for DEP and ASLR are based on the image characteristics field. Reference: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_optional_header32

From your sample these are the ones that are listed for this file:

 "Characteristics": [
        "IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE",
        "IMAGE_DLLCHARACTERISTICS_NX_COMPAT",
        "IMAGE_DLLCHARACTERISTICS_NO_SEH",
        "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE"
      ],

This does appear to have DEP (nx compat) but not ASLR (high entropy va). I'll double check the DEP rule and run against some .NET binaries.

What mechanism/tool did you use to confirm dep and aslr separately?

gfs avatar Jun 22 '22 16:06 gfs

I can reproduce this with a netstandard.dll I have locally.

gfs avatar Jun 22 '22 20:06 gfs

The root cause was an oversight in the default OAT Contains and Contains Any operations. Fix is here: https://github.com/microsoft/OAT/pull/147 after merged I'll update ASA's dependencies and confirm it fixes the issue and push a new version with the updated lib.

gfs avatar Jun 22 '22 22:06 gfs

Sounds good. Thanks for your effort :)

Kurosaki22 avatar Jun 22 '22 22:06 Kurosaki22

I just merged a commit that seems to fix this in my testing.

Thanks for your report, and don't hesitate to reach out if you have additional issues.

gfs avatar Jun 22 '22 23:06 gfs