mandiant / mandiant/capa-rules

persist via Windows service

Open
#1,100 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

false positive good first issue help wanted
Dominant language
No language data
Stars
736
Forks
245
Avg merge
4d 53m
Merged PRs (30d)
2

Description

sample:

https://www.virustotal.com/gui/file/41d097e47778252aec073666502f9ab7eda2e47c6800f529064128dff186f39d

verdict:

0x404427,persist via Windows service,FP,"Function modifies NetBT parameters (NetbiosOptions), does not create or modify a service binary path for persistence.","Verify registry value is ImagePath or StartType."

decompilation:
```c
undefined4 __cdecl FUN_00404427(LPCSTR param_1,char *param_2)

{
char cVar1;
LSTATUS LVar2;
undefined4 uVar3;
HKEY local_410;
CHAR local_40c [1024];
BYTE local_c [8];

memset(local_40c,0,0x400);
lstrcpyA(local_40c,"SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters\\Interfaces\\Tcpip_");
lstrcatA(local_40c,param_1);
LVar2 = RegOpenKeyExA((HKEY)0x80000002,local_40c,0,0x20006,&local_410);
if (LVar2 == 0) {
local_c[4] = '\x04';
local_c[5] = '\0';
local_c[6] = '\0';
local_c[7] = '\0';
cVar1 = *param_2;
if (cVar1 == '0') {
local_c[0] = '\0';
}
else if (cVar1 == '1') {
local_c[0] = '\x01';
}
else if (cVar1 == '2') {
local_c[0] = '\x02';
}
else {
local_c[0] = '\0';
}
local_c[1] = 0;
local_c[2] = 0;
local_c[3] = 0;
RegSetValueExA(local_410,"NetbiosOptions",0,4,local_c,4);
RegCloseKey(local_410);
uVar3 = 1;
}
else {
uVar3 = 0;
}
return uVar3;
}
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the rule corresponding to verdict 0x404427 and compare its match conditions with FUN_00404427 in the supplied decompilation. Confirm that the function changes the NetBT Parameters registry value NetbiosOptions rather than a service ImagePath or StartType. Done means this behavior is no longer classified as persistence via a Windows service.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.