Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check .NET-Anti-Debug coverage #596

Open
mike-hunhoff opened this issue Jul 22, 2022 · 5 comments
Open

check .NET-Anti-Debug coverage #596

mike-hunhoff opened this issue Jul 22, 2022 · 5 comments
Assignees
Labels

Comments

@mike-hunhoff
Copy link
Collaborator

https://github.com/Outbuilt/.NET-Anti-Debug

@williballenthin
Copy link
Collaborator

  • md5: new System.Security.Cryptography.MD5CryptoServiceProvider(), ComputeHash
  • reference self file: System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName, Assembly.GetEntryAssembly().Location
  • is administrator:
        private static bool IsAdministrator()
        {
            var identity = WindowsIdentity.GetCurrent();
            var principal = new WindowsPrincipal(identity);
            return principal.IsInRole(WindowsBuiltInRole.Administrator);
        }
  • sandboxie detection: SbieDll.dll
  • enumerate PIDs: new PerformanceCounterCategory("Process");, GetInstanceNames, GetCounters, CounterName, "ID Process"
  • system proxy: Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings, ProxyEnable, ProxyServer
  • spawn process: new System.Diagnostics.ProcessStartInfo, System.Diagnostics.Process
  • timing: Environment.TickCount, Thread.Sleep
  • anti vm: Select * from Win32_ComputerSystem, virtual, vmware, virtualbox
  • anti vm: SELECT * FROM Win32_VideoController, vmware, vbox
  • cpuid: Win32_Processor, UniqueID, ProcessorID, Name, Manufacturer
  • biosid: Win32_BIOS, Manufacturer, SMBIOSBIOSVersion,IdentificationCode,SerialNumber,ReleaseDate,Version
  • diskid: Win32_DiskDrive,Model,Manufacturer,Signature,TotalHeads
  • motherboard id: Win32_BaseBoard,Model,Manufacturer,Name,SerialNumber
  • video id: Win32_VideoController,DriverVersion,Name
  • macid: Win32_NetworkAdapterConfiguration,MACAddress,IPEnabled

@williballenthin williballenthin self-assigned this Jan 24, 2023
@komen205
Copy link

komen205 commented Mar 17, 2023

Hello everyone,

This issue appears to not have any progress since January, so I decided to contribute with my own rule.

The field that I targeted is : "anti vm: Select * from Win32_ComputerSystem, virtual, vmware, virtualbox"

I left the "examples" field empty as I'm not sure if any example is already on the capa-testfiles repo, if not, I can provide the EXE that I created and using to test the rules.

I can also provide all the other rules if you let me take the issue.

I hope it helps, thanks!

@mr-tz
Copy link
Collaborator

mr-tz commented Mar 20, 2023

Great, would be great if you want to tackle more rules here and contribute a PR. If there's no examples, you can provide them or place the rules in the nursery directory. Please also note the potential overlap with related rules, e.g., reference anti-VM strings targeting VMWare.

@komen205
Copy link

Hello,

Thanks for assigning the task to me.

The following rules mentioned are already done and I don't think there's any need to modify them.
sandboxie detection:


md5: new System.Security.Cryptography.MD5CryptoServiceProvider(), ComputeHash

is administrator:
- api: System.Security.Principal.WindowsPrincipal::IsInRole

I added the whole CPU information at host-interaction/hardware/cpu/get-cpu-information.yml, for reference: f2da1d4

Regarding the rules the following rules, I will add them in their respective file, I don't think there's a need to create a new one and also I will target dotnet to prevent overlap's.
anti vm: Select * from Win32_ComputerSystem, virtual, vmware, virtualbox
anti vm: SELECT * FROM Win32_VideoController, vmware, vbox

For the rules targeting macid and Environment.TickCount, I have no idea where to put them so I will add them to nursery later on.

Thanks :)

@mr-tz
Copy link
Collaborator

mr-tz commented Mar 21, 2023

Great, thanks for your work here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants