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

Addition to CAR-2021-05-004: BITS Job Persistence #171

Open
Matcha-42 opened this issue Mar 24, 2023 · 0 comments
Open

Addition to CAR-2021-05-004: BITS Job Persistence #171

Matcha-42 opened this issue Mar 24, 2023 · 0 comments

Comments

@Matcha-42
Copy link

The purpose of this issue is not to create a new CAR analytic, but add to an existing one (for which I do not see a template).

Specifically, I propose an addition to CAR-2021-05-004: BITS Job Persistence.

The context of BITS abuse that this analytic is oriented toward is the fact that, in addition to pulling files onto a host in a way that is difficult to detect, BITS can also be configured to run an arbitrary executable when a job completes or errors-out; an attacker can therefore create a BITS job which runs malware on completion and, by scheduling this BITS jobs to run regularly, it is possible create a persistence mechanism in this way, ensuring that a given executable is run regularly.

The existing analytic implementation for CAR-2021-05-004 detects the creation of a BITS job using bitsadmin.exe; I think that there is room for improvement here as:

  • There are ways to create BITS jobs without the use of bitsadmin.exe (for example, through the use of the PowerShell cmdlet Start-BitsTransfer, so no all BITS jobs creations will be caught by this analytic.
  • There are often many legitimate BITS jobs, so this is a somewhat noisy analytic.
  • This only detects the creation of a BITS job; it does not indicate whether that BITS job is actually being used for persistence nor the location of the malware if it is.

It is possible instead to directly detect when the completion (or error-ing out) of a BITS job triggers the execution of an executable: when this happens (and only when this happens), the malware is run with the parent command svchost.exe -k netsvcs -p -s BITS.

I therefore propose the following additions to CAR-2021-05-004:

To Data Model References, add the following row:

Object Action Field
process create parent_command_line

To Implimentations, add the following paragraph:

Pseudocode – detect a BITS job triggering code execution (Pseudocode, CAR native)

processes = search Process:Create
bits_job_triggered_execution = filter processes where (parent_command_line is "svchost.exe -k netsvcs -p -s BITS")
output bits_job_triggered_execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Matcha-42 and others