Code Monkey home page Code Monkey logo

Comments (5)

ElektroKill avatar ElektroKill commented on August 26, 2024 1

While we are at it, we may as well try to circumvent 0xd4d/antinet ? It could be tricky .

Yes, you are right, circumventing antinet will definitely be tricky due to how it works. We can't just hook an unmanaged function as we do with CheckRemoteDebuggerPresent, IsDebuggerPresent, etc.

at about check for breakpoints by current system time?

I'm not exactly sure what you mean by this...

from dnspy.

mastercodeon314 avatar mastercodeon314 commented on August 26, 2024 1

.NET obfuscators and protectors like to employ "Anti Debug" measures to prevent debugging. dnSpy is currently able to bypass the following methods of checking for a debugger:

  • IsAttached and IsLogging properties/methods from the System.Diagnostics.Debugger class.
  • CheckRemoteDebuggerPresent native API.
  • IsDebuggerPresent native API.

Other known ways that can detect the dnSpy debugger:

  • Checking for presence of the dnSpy hooks on CheckRemoteDebuggerPresent and IsDebuggerPresent.
  • CloseHandle native API - passing an invalid handle that is not zero will cause the API to throw an exception only if the process is running under a debugger.
  • NtQueryInformationProcess native API - Used to retrieve the parent process and is often compared to an internal table of known debugger tools.
  • Checking process list for process names that contain dnSpy - Very rarely used in software that is not UnpackMes.
  • Checking for the existence of %APPDATA%\dnSpy\dnSpy.xml file - Very rarely used in software that is not UnpackMes.

Potential solutions:

  1. Allow usage of https://github.com/x64dbg/ScyllaHide together with dnSpy to greatly improve the AntiAntiDebug component.
  2. If 1 fails or is not viable, we can manually implement bypasses for the aforementioned methods.

We can detect dnspy hook for IsAttached property/method from the System.Diagnostics.Debugger class as well.
I made a PR for https://github.com/XenocodeRCE/dnSpyDetector with the IsAttached hook detection. Will be implementing IsLogging today as well.

from dnspy.

MikeZeDev avatar MikeZeDev commented on August 26, 2024

While we are at it, we may as well try to circumvent https://github.com/0xd4d/antinet ? It could be tricky .

from dnspy.

GazziFX avatar GazziFX commented on August 26, 2024

what about check for breakpoints by current system time?

from dnspy.

MikeZeDev avatar MikeZeDev commented on August 26, 2024

I'm not exactly sure what you mean by this...

Its that kind of anti debug :

Check system time S1

some code

Check system time again S2

If too much time between S2 and S1 it means there have been pauses during execution, therefore breakpoints or being under a debugger. Not a reliable antidebugger but still used in non managed binaries.
The usual method of bypass is faking system time returned by the API.

from dnspy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.