-
Notifications
You must be signed in to change notification settings - Fork 199
minor reorg linux rules and logic #452
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ea3ea14
minor reorg linux rules and logic
c4a9cdf
create-reverse-shell-on-linux: match namespace not rule name
williballenthin 32fed5f
fix lints
55fc4f0
Update host-interaction/file-system/change-file-permission-on-linux.yml
williballenthin cf08e8f
Merge branch 'os-linux-rules' of github.com:fireeye/capa-rules into o…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,4 @@ rule: | |
| features: | ||
| - and: | ||
| - match: receive data | ||
| - match: write file | ||
| - match: host-interaction/file-system/write | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| rule: | ||
| meta: | ||
| name: create unix reverse shell | ||
| name: create reverse shell on Linux | ||
| namespace: c2/shell | ||
| author: [email protected] | ||
| scope: function | ||
|
|
@@ -11,7 +11,7 @@ rule: | |
| examples: | ||
| - 7351f8a40c5450557b24622417fc478d:0x40231E | ||
| features: | ||
| - or: | ||
| - and: | ||
| - match: duplicate stdin and stdout | ||
| - match: create process | ||
| - and: | ||
| - os: linux | ||
| - match: duplicate stdin and stdout | ||
| - match: host-interaction/process/create | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| rule: | ||
| meta: | ||
| name: execute shell command received from socket | ||
| name: execute shell command received from socket on Linux | ||
| namespace: c2/shell | ||
| author: [email protected] | ||
| scope: function | ||
|
|
@@ -10,5 +10,6 @@ rule: | |
| - 7351f8a40c5450557b24622417fc478d:0x406549 | ||
| features: | ||
| - and: | ||
| - os: linux | ||
| - match: receive data on socket | ||
| - api: system | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| rule: | ||
| meta: | ||
| name: get current user on Linux | ||
| namespace: collection | ||
| author: [email protected] | ||
| scope: function | ||
| examples: | ||
| - 7351f8a40c5450557b24622417fc478d:0x405438 | ||
| features: | ||
| - and: | ||
| - os: linux | ||
| - or: | ||
| - and: | ||
| - api: geteuid | ||
| - api: getpwuid | ||
| - api: getlogin | ||
| - api: getlogin_r | ||
| - api: cuserid |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| rule: | ||
| meta: | ||
| name: get MAC address on Windows | ||
| namespace: collection/network | ||
| author: | ||
| - [email protected] | ||
| scope: function | ||
| att&ck: | ||
| - Discovery::System Information Discovery [T1082] | ||
| examples: | ||
| - al-khaser_x64.exe_:0x14001A1BC | ||
| features: | ||
| - and: | ||
| - os: windows | ||
| - api: iphlpapi.GetAdaptersInfo | ||
| - or: | ||
| - offset: 0x194 = IP_ADAPTER_INFO.Address | ||
| - offset: 0x195 = IP_ADAPTER_INFO.Address+1 | ||
| - offset: 0x196 = IP_ADAPTER_INFO.Address+2 | ||
| - offset: 0x197 = IP_ADAPTER_INFO.Address+3 | ||
| - offset: 0x198 = IP_ADAPTER_INFO.Address+4 | ||
| - offset: 0x199 = IP_ADAPTER_INFO.Address+5 | ||
| - optional: | ||
| - string: "%02X-%02X-%02X-%02X-%02X-%02X" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
...on/file-system/change-file-permission.yml → ...ystem/change-file-permission-on-linux.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| rule: | ||
| meta: | ||
| name: change file permission | ||
| name: change file permission on Linux | ||
| namespace: host-interaction/file-system | ||
| author: [email protected] | ||
| scope: basic block | ||
| examples: | ||
| - 7351f8a40c5450557b24622417fc478d:0x407C68 | ||
| features: | ||
| - or: | ||
| - api: chown | ||
| - api: fchown | ||
| - api: lchown | ||
| - api: fchownat | ||
| - and: | ||
| - os: windows | ||
| - or: | ||
| - api: chown | ||
| - api: fchown | ||
| - api: lchown | ||
| - api: fchownat | ||
20 changes: 20 additions & 0 deletions
20
host-interaction/file-system/files/list/enumerate-files-on-linux.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| rule: | ||
| meta: | ||
| name: enumerate files on Linux | ||
| namespace: host-interaction/file-system/files/list | ||
| author: [email protected] | ||
| scope: function | ||
| att&ck: | ||
| - Discovery::File and Directory Discovery [T1083] | ||
| features: | ||
| - and: | ||
| - os: linux | ||
| - or: | ||
| - and: | ||
| - match: create or open file | ||
| - or: | ||
| - api: getdents | ||
| - api: getdents64 | ||
| - and: | ||
| - api: opendir | ||
| - api: readdir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| rule: | ||
| meta: | ||
| name: read file on Linux | ||
| namespace: host-interaction/file-system/read | ||
| author: | ||
| - [email protected] | ||
| - [email protected] | ||
| scope: function | ||
| mbc: | ||
| - File System::Read File [C0051] | ||
| examples: | ||
| - BFB9B5391A13D0AFD787E87AB90F14F5:0x1314567B | ||
| features: | ||
| - and: | ||
| - os: linux | ||
| - optional: | ||
| - match: create or open file | ||
| - or: | ||
| - api: fgetc | ||
| - api: fgets | ||
| - api: getc | ||
| - api: getchar | ||
| - api: read | ||
| - api: getline | ||
| - api: getdelim | ||
| - api: fgetwc | ||
| - api: getwc | ||
| - api: fscanf | ||
| - api: vfscanf | ||
| - api: fread |
26 changes: 26 additions & 0 deletions
26
host-interaction/file-system/read/read-file-on-windows.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| rule: | ||
| meta: | ||
| name: read file on Windows | ||
| namespace: host-interaction/file-system/read | ||
| author: | ||
| - [email protected] | ||
| scope: function | ||
| mbc: | ||
| - File System::Read File [C0051] | ||
| examples: | ||
| - BFB9B5391A13D0AFD787E87AB90F14F5:0x1314567B | ||
| features: | ||
| - and: | ||
| - os: windows | ||
| - optional: | ||
| - and: | ||
| - number: 0x80000000 = GENERIC_READ | ||
| - or: | ||
| - api: kernel32.CreateFile | ||
| - or: | ||
| - api: kernel32.ReadFile | ||
| - api: ReadFileEx | ||
| - api: NtReadFile | ||
| - api: ZwReadFile | ||
| - api: _read | ||
| - api: fread |
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
host-interaction/file-system/write/write-file-on-windows.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| rule: | ||
| meta: | ||
| name: write file on Windows | ||
| namespace: host-interaction/file-system/write | ||
| author: | ||
| - [email protected] | ||
| scope: function | ||
| mbc: | ||
| - File System::Writes File [C0052] | ||
| examples: | ||
| - Practical Malware Analysis Lab 01-04.exe_:0x4011FC | ||
| # ntdll | ||
| - 563653399B82CD443F120ECEFF836EA3678D4CF11D9B351BB737573C2D856299:0x1400025C4 | ||
| features: | ||
| - and: | ||
| - os: windows | ||
| - optional: | ||
| - or: | ||
| - and: | ||
| - number: 0x40000000 = GENERIC_WRITE | ||
| - or: | ||
| - api: kernel32.CreateFile | ||
| - and: | ||
| - number: 0x2 = FILE_WRITE_DATA | ||
| - or: | ||
| - api: NtCreateFile | ||
| - api: ZwCreateFile | ||
| - or: | ||
| - api: kernel32.WriteFile | ||
| - api: kernel32.WriteFileEx | ||
| - api: NtWriteFile | ||
| - api: ZwWriteFile | ||
| - api: _fwrite | ||
| - api: fwrite |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.