mirror of
https://github.com/mandiant/capa.git
synced 2025-12-17 09:57:48 -08:00
Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29e61e24a6 | ||
|
|
041c8a4c2d | ||
|
|
433dfd8fa9 | ||
|
|
2b46043419 | ||
|
|
d31c8b0190 | ||
|
|
9003fdc1a2 | ||
|
|
b1f4a2853e | ||
|
|
07412f047d | ||
|
|
26ac21b908 | ||
|
|
4cc496a8e5 | ||
|
|
4f4e0881b5 | ||
|
|
9fe164665c | ||
|
|
c74193b5d7 | ||
|
|
31ef06ef2b | ||
|
|
83a95d66d1 | ||
|
|
4451b76f89 | ||
|
|
a1075b63ec | ||
|
|
97c41228e0 | ||
|
|
8903d2abcb | ||
|
|
328e13fbfe | ||
|
|
b7cd5fec76 | ||
|
|
6086dbcd84 | ||
|
|
5f88e02aa3 | ||
|
|
96a4f585cd | ||
|
|
73ec980e01 | ||
|
|
e5ed7ce0d3 | ||
|
|
08a7b8afb7 | ||
|
|
bb7a588f6b | ||
|
|
9faa0734c1 | ||
|
|
cf55b34b4e | ||
|
|
5881899cc2 | ||
|
|
4e64ef8ab3 | ||
|
|
7e5532ac84 | ||
|
|
3d638df08c | ||
|
|
bf984a38ed | ||
|
|
e68f2ce141 | ||
|
|
d0a3244108 | ||
|
|
d09901d512 | ||
|
|
2d46bac351 | ||
|
|
2285c76cbf | ||
|
|
c003ab4e42 | ||
|
|
78e97a217a | ||
|
|
720585170c | ||
|
|
19d54f3f4d | ||
|
|
23a0aec1e6 | ||
|
|
6b0db01c13 | ||
|
|
93c14c3a1f | ||
|
|
b66760fc5c | ||
|
|
64a801cc55 | ||
|
|
35fc8ee3e8 | ||
|
|
887c566f7c | ||
|
|
2f59499087 | ||
|
|
b4a239569c | ||
|
|
e4073a844b | ||
|
|
f313ad37b3 | ||
|
|
8de69c639a | ||
|
|
0714dbee0d | ||
|
|
ead8a836be | ||
|
|
d471e66073 | ||
|
|
4ddef1f60b | ||
|
|
7b9da896e8 | ||
|
|
41786f4ab8 | ||
|
|
4661da729f | ||
|
|
97dc40a585 |
26
.github/CONTRIBUTING.md
vendored
26
.github/CONTRIBUTING.md
vendored
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
First off, thanks for taking the time to contribute!
|
First off, thanks for taking the time to contribute!
|
||||||
|
|
||||||
The following is a set of guidelines for contributing to capa and its packages, which are hosted in the [FireEye Organization](https://github.com/fireeye) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
The following is a set of guidelines for contributing to capa and its packages, which are hosted in the [Mandiant Organization](https://github.com/mandiant) on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||||
|
|
||||||
#### Table Of Contents
|
#### Table Of Contents
|
||||||
|
|
||||||
@@ -32,9 +32,9 @@ This project and everyone participating in it is governed by the [Capa Code of C
|
|||||||
### Capa and its repositories
|
### Capa and its repositories
|
||||||
|
|
||||||
We host the capa project as three Github repositories:
|
We host the capa project as three Github repositories:
|
||||||
- [capa](https://github.com/fireeye/capa)
|
- [capa](https://github.com/mandiant/capa)
|
||||||
- [capa-rules](https://github.com/fireeye/capa-rules)
|
- [capa-rules](https://github.com/mandiant/capa-rules)
|
||||||
- [capa-testfiles](https://github.com/fireeye/capa-testfiles)
|
- [capa-testfiles](https://github.com/mandiant/capa-testfiles)
|
||||||
|
|
||||||
The command line tools, logic engine, and other Python source code are found in the `capa` repository.
|
The command line tools, logic engine, and other Python source code are found in the `capa` repository.
|
||||||
This is the repository to fork when you want to enhance the features, performance, or user interface of capa.
|
This is the repository to fork when you want to enhance the features, performance, or user interface of capa.
|
||||||
@@ -54,7 +54,7 @@ These are files you'll need in order to run the linter (in `--thorough` mode) an
|
|||||||
### Design Decisions
|
### Design Decisions
|
||||||
|
|
||||||
When we make a significant decision in how we maintain the project and what we can or cannot support,
|
When we make a significant decision in how we maintain the project and what we can or cannot support,
|
||||||
we will document it in the [capa issues tracker](https://github.com/fireeye/capa/issues).
|
we will document it in the [capa issues tracker](https://github.com/mandiant/capa/issues).
|
||||||
This is the best place review our discussions about what/how/why we do things in the project.
|
This is the best place review our discussions about what/how/why we do things in the project.
|
||||||
If you have a question, check to see if it is documented there.
|
If you have a question, check to see if it is documented there.
|
||||||
If it is *not* documented there, or you can't find an answer, please open a issue.
|
If it is *not* documented there, or you can't find an answer, please open a issue.
|
||||||
@@ -78,7 +78,7 @@ Fill out [the required template](./ISSUE_TEMPLATE/bug_report.md),
|
|||||||
#### Before Submitting A Bug Report
|
#### Before Submitting A Bug Report
|
||||||
|
|
||||||
* **Determine [which repository the problem should be reported in](#capa-and-its-repositories)**.
|
* **Determine [which repository the problem should be reported in](#capa-and-its-repositories)**.
|
||||||
* **Perform a [cursory search](https://github.com/fireeye/capa/issues?q=is%3Aissue)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
|
* **Perform a [cursory search](https://github.com/mandiant/capa/issues?q=is%3Aissue)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
|
||||||
|
|
||||||
#### How Do I Submit A (Good) Bug Report?
|
#### How Do I Submit A (Good) Bug Report?
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ Explain the problem and include additional details to help maintainers reproduce
|
|||||||
Provide more context by answering these questions:
|
Provide more context by answering these questions:
|
||||||
|
|
||||||
* **Did the problem start happening recently** (e.g. after updating to a new version of capa) or was this always a problem?
|
* **Did the problem start happening recently** (e.g. after updating to a new version of capa) or was this always a problem?
|
||||||
* If the problem started happening recently, **can you reproduce the problem in an older version of capa?** What's the most recent version in which the problem doesn't happen? You can download older versions of capa from [the releases page](https://github.com/fireeye/capa/releases).
|
* If the problem started happening recently, **can you reproduce the problem in an older version of capa?** What's the most recent version in which the problem doesn't happen? You can download older versions of capa from [the releases page](https://github.com/mandiant/capa/releases).
|
||||||
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
|
* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
|
||||||
* If the problem is related to working with files (e.g. opening and editing files), **does the problem happen for all files and projects or only some?** Does the problem happen only when working with local or remote files (e.g. on network drives), with files of a specific type (e.g. only JavaScript or Python files), with large files or files with very long lines, or with files in a specific encoding? Is there anything else special about the files you are using?
|
* If the problem is related to working with files (e.g. opening and editing files), **does the problem happen for all files and projects or only some?** Does the problem happen only when working with local or remote files (e.g. on network drives), with files of a specific type (e.g. only JavaScript or Python files), with large files or files with very long lines, or with files in a specific encoding? Is there anything else special about the files you are using?
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ Before creating enhancement suggestions, please check [this list](#before-submit
|
|||||||
#### Before Submitting An Enhancement Suggestion
|
#### Before Submitting An Enhancement Suggestion
|
||||||
|
|
||||||
* **Determine [which repository the enhancement should be suggested in](#capa-and-its-repositories).**
|
* **Determine [which repository the enhancement should be suggested in](#capa-and-its-repositories).**
|
||||||
* **Perform a [cursory search](https://github.com/fireeye/capa/issues?q=is%3Aissue)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
* **Perform a [cursory search](https://github.com/mandiant/capa/issues?q=is%3Aissue)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
|
||||||
|
|
||||||
#### How Do I Submit A (Good) Enhancement Suggestion?
|
#### How Do I Submit A (Good) Enhancement Suggestion?
|
||||||
|
|
||||||
@@ -138,15 +138,15 @@ Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com
|
|||||||
|
|
||||||
Unsure where to begin contributing to capa? You can start by looking through these `good-first-issue` and `rule-idea` issues:
|
Unsure where to begin contributing to capa? You can start by looking through these `good-first-issue` and `rule-idea` issues:
|
||||||
|
|
||||||
* [good-first-issue](https://github.com/fireeye/capa/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - issues which should only require a few lines of code, and a test or two.
|
* [good-first-issue](https://github.com/mandiant/capa/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) - issues which should only require a few lines of code, and a test or two.
|
||||||
* [rule-idea](https://github.com/fireeye/capa-rules/issues?q=is%3Aissue+is%3Aopen+label%3A%22rule+idea%22) - issues that describe potential new rule ideas.
|
* [rule-idea](https://github.com/mandiant/capa-rules/issues?q=is%3Aissue+is%3Aopen+label%3A%22rule+idea%22) - issues that describe potential new rule ideas.
|
||||||
|
|
||||||
Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have.
|
Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have.
|
||||||
|
|
||||||
#### Local development
|
#### Local development
|
||||||
|
|
||||||
capa and all its resources can be developed locally.
|
capa and all its resources can be developed locally.
|
||||||
For instructions on how to do this, see the "Method 3" section of the [installation guide](https://github.com/fireeye/capa/blob/master/doc/installation.md).
|
For instructions on how to do this, see the "Method 3" section of the [installation guide](https://github.com/mandiant/capa/blob/master/doc/installation.md).
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
|
|
||||||
@@ -190,8 +190,8 @@ Our CI pipeline will reformat and enforce the Python styleguide.
|
|||||||
|
|
||||||
All (non-nursery) capa rules must:
|
All (non-nursery) capa rules must:
|
||||||
|
|
||||||
1. pass the [linter](https://github.com/fireeye/capa/blob/master/scripts/lint.py), and
|
1. pass the [linter](https://github.com/mandiant/capa/blob/master/scripts/lint.py), and
|
||||||
2. be formatted with [capafmt](https://github.com/fireeye/capa/blob/master/scripts/capafmt.py)
|
2. be formatted with [capafmt](https://github.com/mandiant/capa/blob/master/scripts/capafmt.py)
|
||||||
|
|
||||||
This ensures that all rules meet the same minimum level of quality and are structured in a consistent way.
|
This ensures that all rules meet the same minimum level of quality and are structured in a consistent way.
|
||||||
Our CI pipeline will reformat and enforce the capa rules styleguide.
|
Our CI pipeline will reformat and enforce the capa rules styleguide.
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
8
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -5,16 +5,16 @@ about: Create a report to help us improve
|
|||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
# Is your bug report related to capa rules (for example a false positive)?
|
# Is your bug report related to capa rules (for example a false positive)?
|
||||||
We use submodules to separate code, rules and test data. If your issue is related to capa rules, please report it at https://github.com/fireeye/capa-rules/issues.
|
We use submodules to separate code, rules and test data. If your issue is related to capa rules, please report it at https://github.com/mandiant/capa-rules/issues.
|
||||||
|
|
||||||
# Have you checked that your issue isn't already filed?
|
# Have you checked that your issue isn't already filed?
|
||||||
Please search if there is a similar issue at https://github.com/fireeye/capa/issues. If there is already a similar issue, please add more details there instead of opening a new one.
|
Please search if there is a similar issue at https://github.com/mandiant/capa/issues. If there is already a similar issue, please add more details there instead of opening a new one.
|
||||||
|
|
||||||
# Have you read capa's Code of Conduct?
|
# Have you read capa's Code of Conduct?
|
||||||
By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/fireeye/capa/blob/master/.github/CODE_OF_CONDUCT.md
|
By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/mandiant/capa/blob/master/.github/CODE_OF_CONDUCT.md
|
||||||
|
|
||||||
# Have you read capa's CONTRIBUTING guide?
|
# Have you read capa's CONTRIBUTING guide?
|
||||||
It contains helpful information about how to contribute to capa. Check https://github.com/fireeye/capa/blob/master/.github/CONTRIBUTING.md#reporting-bugs
|
It contains helpful information about how to contribute to capa. Check https://github.com/mandiant/capa/blob/master/.github/CONTRIBUTING.md#reporting-bugs
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -5,16 +5,16 @@ about: Suggest an idea for capa
|
|||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
# Is your issue related to capa rules (for example an idea for a new rule)?
|
# Is your issue related to capa rules (for example an idea for a new rule)?
|
||||||
We use submodules to separate code, rules and test data. If your issue is related to capa rules, please report it at https://github.com/fireeye/capa-rules/issues.
|
We use submodules to separate code, rules and test data. If your issue is related to capa rules, please report it at https://github.com/mandiant/capa-rules/issues.
|
||||||
|
|
||||||
# Have you checked that your issue isn't already filed?
|
# Have you checked that your issue isn't already filed?
|
||||||
Please search if there is a similar issue at https://github.com/fireeye/capa/issues. If there is already a similar issue, please add more details there instead of opening a new one.
|
Please search if there is a similar issue at https://github.com/mandiant/capa/issues. If there is already a similar issue, please add more details there instead of opening a new one.
|
||||||
|
|
||||||
# Have you read capa's Code of Conduct?
|
# Have you read capa's Code of Conduct?
|
||||||
By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/fireeye/capa/blob/master/.github/CODE_OF_CONDUCT.md
|
By filing an Issue, you are expected to comply with it, including treating everyone with respect: https://github.com/mandiant/capa/blob/master/.github/CODE_OF_CONDUCT.md
|
||||||
|
|
||||||
# Have you read capa's CONTRIBUTING guide?
|
# Have you read capa's CONTRIBUTING guide?
|
||||||
It contains helpful information about how to contribute to capa. Check https://github.com/fireeye/capa/blob/master/.github/CONTRIBUTING.md#suggesting-enhancements
|
It contains helpful information about how to contribute to capa. Check https://github.com/mandiant/capa/blob/master/.github/CONTRIBUTING.md#suggesting-enhancements
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Summary
|
### Summary
|
||||||
|
|||||||
2
.github/pull_request_template.md
vendored
2
.github/pull_request_template.md
vendored
@@ -3,7 +3,7 @@
|
|||||||
Thank you for contributing to capa! <3
|
Thank you for contributing to capa! <3
|
||||||
|
|
||||||
Please read capa's CONTRIBUTING guide if you haven't done so already.
|
Please read capa's CONTRIBUTING guide if you haven't done so already.
|
||||||
It contains helpful information about how to contribute to capa. Check https://github.com/fireeye/capa/blob/master/.github/CONTRIBUTING.md
|
It contains helpful information about how to contribute to capa. Check https://github.com/mandiant/capa/blob/master/.github/CONTRIBUTING.md
|
||||||
|
|
||||||
Please describe the changes in this pull request (PR). Include your motivation and context to help us review.
|
Please describe the changes in this pull request (PR). Include your motivation and context to help us review.
|
||||||
|
|
||||||
|
|||||||
2
.github/pyinstaller/hooks/hook-smda.py
vendored
2
.github/pyinstaller/hooks/hook-smda.py
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
import PyInstaller.utils.hooks
|
import PyInstaller.utils.hooks
|
||||||
|
|
||||||
# ref: https://groups.google.com/g/pyinstaller/c/amWi0-66uZI/m/miPoKfWjBAAJ
|
# ref: https://groups.google.com/g/pyinstaller/c/amWi0-66uZI/m/miPoKfWjBAAJ
|
||||||
|
|||||||
4
.github/pyinstaller/hooks/hook-vivisect.py
vendored
4
.github/pyinstaller/hooks/hook-vivisect.py
vendored
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
|
|
||||||
from PyInstaller.utils.hooks import copy_metadata
|
from PyInstaller.utils.hooks import copy_metadata
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ hiddenimports = [
|
|||||||
"vivisect.analysis.crypto",
|
"vivisect.analysis.crypto",
|
||||||
"vivisect.analysis.crypto.constants",
|
"vivisect.analysis.crypto.constants",
|
||||||
"vivisect.analysis.elf",
|
"vivisect.analysis.elf",
|
||||||
"vivisect.analysis.elf",
|
|
||||||
"vivisect.analysis.elf.elfplt",
|
"vivisect.analysis.elf.elfplt",
|
||||||
|
"vivisect.analysis.elf.elfplt_late",
|
||||||
"vivisect.analysis.elf.libc_start_main",
|
"vivisect.analysis.elf.libc_start_main",
|
||||||
"vivisect.analysis.generic",
|
"vivisect.analysis.generic",
|
||||||
"vivisect.analysis.generic",
|
"vivisect.analysis.generic",
|
||||||
|
|||||||
2
.github/pyinstaller/pyinstaller.spec
vendored
2
.github/pyinstaller/pyinstaller.spec
vendored
@@ -1,5 +1,5 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
import os.path
|
import os.path
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -41,8 +41,12 @@ jobs:
|
|||||||
run: pip install -e .
|
run: pip install -e .
|
||||||
- name: Build standalone executable
|
- name: Build standalone executable
|
||||||
run: pyinstaller .github/pyinstaller/pyinstaller.spec
|
run: pyinstaller .github/pyinstaller/pyinstaller.spec
|
||||||
- name: Does it run?
|
- name: Does it run (PE)?
|
||||||
run: dist/capa "tests/data/Practical Malware Analysis Lab 01-01.dll_"
|
run: dist/capa "tests/data/Practical Malware Analysis Lab 01-01.dll_"
|
||||||
|
- name: Does it run (Shellcode)?
|
||||||
|
run: dist/capa "tests/data/499c2a85f6e8142c3f48d4251c9c7cd6.raw32"
|
||||||
|
- name: Does it run (ELF)?
|
||||||
|
run: dist/capa "tests/data/7351f8a40c5450557b24622417fc478d.elf_"
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.asset_name }}
|
name: ${{ matrix.asset_name }}
|
||||||
|
|||||||
8
.github/workflows/tag.yml
vendored
8
.github/workflows/tag.yml
vendored
@@ -12,18 +12,18 @@ jobs:
|
|||||||
- name: Checkout capa-rules
|
- name: Checkout capa-rules
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
repository: fireeye/capa-rules
|
repository: mandiant/capa-rules
|
||||||
token: ${{ secrets.CAPA_TOKEN }}
|
token: ${{ secrets.CAPA_TOKEN }}
|
||||||
- name: Tag capa-rules
|
- name: Tag capa-rules
|
||||||
run: |
|
run: |
|
||||||
# user information is needed to create annotated tags (with a message)
|
# user information is needed to create annotated tags (with a message)
|
||||||
git config user.email 'capa-dev@fireeye.com'
|
git config user.email 'capa-dev@mandiant.com'
|
||||||
git config user.name 'Capa Bot'
|
git config user.name 'Capa Bot'
|
||||||
name=${{ github.event.release.tag_name }}
|
name=${{ github.event.release.tag_name }}
|
||||||
git tag $name -m "https://github.com/fireeye/capa/releases/$name"
|
git tag $name -m "https://github.com/mandiant/capa/releases/$name"
|
||||||
- name: Push tag to capa-rules
|
- name: Push tag to capa-rules
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
repository: fireeye/capa-rules
|
repository: mandiant/capa-rules
|
||||||
github_token: ${{ secrets.CAPA_TOKEN }}
|
github_token: ${{ secrets.CAPA_TOKEN }}
|
||||||
tags: true
|
tags: true
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -114,3 +114,4 @@ venv.bak/
|
|||||||
isort-output.log
|
isort-output.log
|
||||||
black-output.log
|
black-output.log
|
||||||
rule-linter-output.log
|
rule-linter-output.log
|
||||||
|
.vscode
|
||||||
|
|||||||
226
CHANGELOG.md
226
CHANGELOG.md
@@ -17,8 +17,62 @@
|
|||||||
### Development
|
### Development
|
||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
- [capa v3.0.1...master](https://github.com/fireeye/capa/compare/v3.0.1...master)
|
- [capa <release>...master](https://github.com/mandiant/capa/compare/v3.0.3...master)
|
||||||
- [capa-rules v3.0.1...master](https://github.com/fireeye/capa-rules/compare/v3.0.1...master)
|
- [capa-rules <release>...master](https://github.com/mandiant/capa-rules/compare/v3.0.3...master)
|
||||||
|
|
||||||
|
|
||||||
|
## v3.0.3 (2021-10-27)
|
||||||
|
|
||||||
|
This is primarily a rule maintenance release:
|
||||||
|
- eight new rules, including all relevant techniques from [ATT&CK v10](https://medium.com/mitre-attack/introducing-attack-v10-7743870b37e3), and
|
||||||
|
- two rules removed, due to the prevalence of false positives
|
||||||
|
|
||||||
|
We've also tweaked the status codes returned by capa.exe to be more specific and added a bit more metadata to the JSON output format.
|
||||||
|
|
||||||
|
As always, welcome first time contributors!
|
||||||
|
- still@teamt5.org
|
||||||
|
- zander.work@mandiant.com
|
||||||
|
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- show in which function a BB match is #130 @williballenthin
|
||||||
|
- main: exit with unique error codes when bailing #802 @williballenthin
|
||||||
|
|
||||||
|
### New Rules (8)
|
||||||
|
|
||||||
|
- nursery/resolve-function-by-fnv-1a-hash still@teamt5.org
|
||||||
|
- data-manipulation/encryption/encrypt-data-using-memfrob-from-glibc zander.work@mandiant.com
|
||||||
|
- collection/group-policy/discover-group-policy-via-gpresult william.ballenthin@mandiant.com
|
||||||
|
- host-interaction/bootloader/manipulate-safe-mode-programs william.ballenthin@mandiant.com
|
||||||
|
- nursery/enable-safe-mode-boot william.ballenthin@mandiant.com
|
||||||
|
- persistence/iis/persist-via-iis-module william.ballenthin@mandiant.com
|
||||||
|
- persistence/iis/persist-via-isapi-extension william.ballenthin@mandiant.com
|
||||||
|
- targeting/language/identify-system-language-via-api william.ballenthin@mandiant.com
|
||||||
|
|
||||||
|
## Removed rules (2)
|
||||||
|
- load-code/pe/parse-pe-exports: too many false positives in unrelated structure accesses
|
||||||
|
- anti-analysis/anti-vm/vm-detection/execute-anti-vm-instructions: too many false positives in junk code
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- update references from FireEye to Mandiant
|
||||||
|
|
||||||
|
### Raw diffs
|
||||||
|
- [capa v3.0.2...v3.0.3](https://github.com/fireeye/capa/compare/v3.0.2...v3.0.3)
|
||||||
|
- [capa-rules v3.0.2...v3.0.3](https://github.com/fireeye/capa-rules/compare/v3.0.2...v3.0.3)
|
||||||
|
|
||||||
|
## v3.0.2 (2021-09-28)
|
||||||
|
|
||||||
|
This release fixes an issue with the standalone executables built with PyInstaller when running capa against ELF files.
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- fix bug in PyInstaller config preventing ELF analysis #795 @mr-tz
|
||||||
|
|
||||||
|
### Raw diffs
|
||||||
|
- [capa v3.0.1...v3.0.2](https://github.com/fireeye/capa/compare/v3.0.1...v3.0.2)
|
||||||
|
- [capa-rules v3.0.1...v3.0.2](https://github.com/fireeye/capa-rules/compare/v3.0.1...v3.0.2)
|
||||||
|
|
||||||
## v3.0.1 (2021-09-27)
|
## v3.0.1 (2021-09-27)
|
||||||
|
|
||||||
@@ -70,29 +124,29 @@ Also, welcome first time contributors:
|
|||||||
### New Rules (80)
|
### New Rules (80)
|
||||||
|
|
||||||
- collection/webcam/capture-webcam-image @johnk3r
|
- collection/webcam/capture-webcam-image @johnk3r
|
||||||
- nursery/list-drag-and-drop-files michael.hunhoff@fireeye.com
|
- nursery/list-drag-and-drop-files michael.hunhoff@mandiant.com
|
||||||
- nursery/monitor-clipboard-content michael.hunhoff@fireeye.com
|
- nursery/monitor-clipboard-content michael.hunhoff@mandiant.com
|
||||||
- nursery/monitor-local-ipv4-address-changes michael.hunhoff@fireeye.com
|
- nursery/monitor-local-ipv4-address-changes michael.hunhoff@mandiant.com
|
||||||
- nursery/load-windows-common-language-runtime michael.hunhoff@fireeye.com
|
- nursery/load-windows-common-language-runtime michael.hunhoff@mandiant.com
|
||||||
- nursery/resize-volume-shadow-copy-storage michael.hunhoff@fireeye.com
|
- nursery/resize-volume-shadow-copy-storage michael.hunhoff@mandiant.com
|
||||||
- nursery/add-user-account-group michael.hunhoff@fireeye.com
|
- nursery/add-user-account-group michael.hunhoff@mandiant.com
|
||||||
- nursery/add-user-account-to-group michael.hunhoff@fireeye.com
|
- nursery/add-user-account-to-group michael.hunhoff@mandiant.com
|
||||||
- nursery/add-user-account michael.hunhoff@fireeye.com
|
- nursery/add-user-account michael.hunhoff@mandiant.com
|
||||||
- nursery/change-user-account-password michael.hunhoff@fireeye.com
|
- nursery/change-user-account-password michael.hunhoff@mandiant.com
|
||||||
- nursery/delete-user-account-from-group michael.hunhoff@fireeye.com
|
- nursery/delete-user-account-from-group michael.hunhoff@mandiant.com
|
||||||
- nursery/delete-user-account-group michael.hunhoff@fireeye.com
|
- nursery/delete-user-account-group michael.hunhoff@mandiant.com
|
||||||
- nursery/delete-user-account michael.hunhoff@fireeye.com
|
- nursery/delete-user-account michael.hunhoff@mandiant.com
|
||||||
- nursery/list-domain-servers michael.hunhoff@fireeye.com
|
- nursery/list-domain-servers michael.hunhoff@mandiant.com
|
||||||
- nursery/list-groups-for-user-account michael.hunhoff@fireeye.com
|
- nursery/list-groups-for-user-account michael.hunhoff@mandiant.com
|
||||||
- nursery/list-user-account-groups michael.hunhoff@fireeye.com
|
- nursery/list-user-account-groups michael.hunhoff@mandiant.com
|
||||||
- nursery/list-user-accounts-for-group michael.hunhoff@fireeye.com
|
- nursery/list-user-accounts-for-group michael.hunhoff@mandiant.com
|
||||||
- nursery/list-user-accounts michael.hunhoff@fireeye.com
|
- nursery/list-user-accounts michael.hunhoff@mandiant.com
|
||||||
- nursery/parse-url michael.hunhoff@fireeye.com
|
- nursery/parse-url michael.hunhoff@mandiant.com
|
||||||
- nursery/register-raw-input-devices michael.hunhoff@fireeye.com
|
- nursery/register-raw-input-devices michael.hunhoff@mandiant.com
|
||||||
- anti-analysis/packer/gopacker/packed-with-gopacker jared.wilson@fireeye.com
|
- anti-analysis/packer/gopacker/packed-with-gopacker jared.wilson@mandiant.com
|
||||||
- host-interaction/driver/create-device-object @mr-tz
|
- host-interaction/driver/create-device-object @mr-tz
|
||||||
- host-interaction/process/create/execute-command @mr-tz
|
- host-interaction/process/create/execute-command @mr-tz
|
||||||
- data-manipulation/encryption/create-new-key-via-cryptacquirecontext chuong.dong@fireeye.com
|
- data-manipulation/encryption/create-new-key-via-cryptacquirecontext chuong.dong@mandiant.com
|
||||||
- host-interaction/log/clfs/append-data-to-clfs-log-container blaine.stancill@mandiant.com
|
- host-interaction/log/clfs/append-data-to-clfs-log-container blaine.stancill@mandiant.com
|
||||||
- host-interaction/log/clfs/read-data-from-clfs-log-container blaine.stancill@mandiant.com
|
- host-interaction/log/clfs/read-data-from-clfs-log-container blaine.stancill@mandiant.com
|
||||||
- data-manipulation/encryption/hc-128/encrypt-data-using-hc-128-via-wolfssl blaine.stancill@mandiant.com
|
- data-manipulation/encryption/hc-128/encrypt-data-using-hc-128-via-wolfssl blaine.stancill@mandiant.com
|
||||||
@@ -114,15 +168,15 @@ Also, welcome first time contributors:
|
|||||||
- persistence/persist-via-shell-profile-or-rc-file joakim@intezer.com
|
- persistence/persist-via-shell-profile-or-rc-file joakim@intezer.com
|
||||||
- persistence/service/persist-via-rc-script joakim@intezer.com
|
- persistence/service/persist-via-rc-script joakim@intezer.com
|
||||||
- collection/get-current-user-on-linux joakim@intezer.com
|
- collection/get-current-user-on-linux joakim@intezer.com
|
||||||
- collection/network/get-mac-address-on-windows moritz.raabe@fireeye.com
|
- collection/network/get-mac-address-on-windows moritz.raabe@mandiant.com
|
||||||
- host-interaction/file-system/read/read-file-on-linux moritz.raabe@fireeye.com joakim@intezer.com
|
- host-interaction/file-system/read/read-file-on-linux moritz.raabe@mandiant.com joakim@intezer.com
|
||||||
- host-interaction/file-system/read/read-file-on-windows moritz.raabe@fireeye.com
|
- host-interaction/file-system/read/read-file-on-windows moritz.raabe@mandiant.com
|
||||||
- host-interaction/file-system/write/write-file-on-windows william.ballenthin@fireeye.com
|
- host-interaction/file-system/write/write-file-on-windows william.ballenthin@mandiant.com
|
||||||
- host-interaction/os/info/get-system-information-on-windows moritz.raabe@fireeye.com joakim@intezer.com
|
- host-interaction/os/info/get-system-information-on-windows moritz.raabe@mandiant.com joakim@intezer.com
|
||||||
- host-interaction/process/create/create-process-on-windows moritz.raabe@fireeye.com
|
- host-interaction/process/create/create-process-on-windows moritz.raabe@mandiant.com
|
||||||
- linking/runtime-linking/link-function-at-runtime-on-windows moritz.raabe@fireeye.com
|
- linking/runtime-linking/link-function-at-runtime-on-windows moritz.raabe@mandiant.com
|
||||||
- nursery/create-process-on-linux joakim@intezer.com
|
- nursery/create-process-on-linux joakim@intezer.com
|
||||||
- nursery/enumerate-files-on-linux william.ballenthin@fireeye.com
|
- nursery/enumerate-files-on-linux william.ballenthin@mandiant.com
|
||||||
- nursery/get-mac-address-on-linux joakim@intezer.com
|
- nursery/get-mac-address-on-linux joakim@intezer.com
|
||||||
- nursery/get-system-information-on-linux joakim@intezer.com
|
- nursery/get-system-information-on-linux joakim@intezer.com
|
||||||
- nursery/link-function-at-runtime-on-linux joakim@intezer.com
|
- nursery/link-function-at-runtime-on-linux joakim@intezer.com
|
||||||
@@ -154,8 +208,8 @@ Also, welcome first time contributors:
|
|||||||
### Development
|
### Development
|
||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
- [capa v2.0.0...v3.0.0](https://github.com/fireeye/capa/compare/v2.0.0...v3.0.0)
|
- [capa v2.0.0...v3.0.0](https://github.com/mandiant/capa/compare/v2.0.0...v3.0.0)
|
||||||
- [capa-rules v2.0.0...v3.0.0](https://github.com/fireeye/capa-rules/compare/v2.0.0...v3.0.0)
|
- [capa-rules v2.0.0...v3.0.0](https://github.com/mandiant/capa-rules/compare/v2.0.0...v3.0.0)
|
||||||
|
|
||||||
|
|
||||||
## v2.0.0 (2021-07-19)
|
## v2.0.0 (2021-07-19)
|
||||||
@@ -174,7 +228,7 @@ A huge thanks to everyone who submitted issues, provided feedback, and contribut
|
|||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
|
|
||||||
- rules: update ATT&CK and MBC mappings https://github.com/fireeye/capa-rules/pull/317 @williballenthin
|
- rules: update ATT&CK and MBC mappings https://github.com/mandiant/capa-rules/pull/317 @williballenthin
|
||||||
- main: use FLIRT signatures to identify and ignore library code #446 @williballenthin
|
- main: use FLIRT signatures to identify and ignore library code #446 @williballenthin
|
||||||
- tests: update test cases and caching #545 @mr-tz
|
- tests: update test cases and caching #545 @mr-tz
|
||||||
- scripts: capa2yara.py convert capa rules to YARA rules #561 @ruppde
|
- scripts: capa2yara.py convert capa rules to YARA rules #561 @ruppde
|
||||||
@@ -262,34 +316,34 @@ A huge thanks to everyone who submitted issues, provided feedback, and contribut
|
|||||||
- nursery/run-in-container @williballenthin
|
- nursery/run-in-container @williballenthin
|
||||||
- persistence/registry/appinitdlls/disable-appinit_dlls-code-signature-enforcement @williballenthin
|
- persistence/registry/appinitdlls/disable-appinit_dlls-code-signature-enforcement @williballenthin
|
||||||
- collection/password-manager/steal-keepass-passwords-using-keefarce @Ana06
|
- collection/password-manager/steal-keepass-passwords-using-keefarce @Ana06
|
||||||
- host-interaction/network/connectivity/check-internet-connectivity-via-wininet matthew.williams@fireeye.com michael.hunhoff@fireeye.com
|
- host-interaction/network/connectivity/check-internet-connectivity-via-wininet matthew.williams@mandiant.com michael.hunhoff@mandiant.com
|
||||||
- nursery/create-bits-job @mr-tz
|
- nursery/create-bits-job @mr-tz
|
||||||
- nursery/execute-syscall-instruction @kulinacs @mr-tz
|
- nursery/execute-syscall-instruction @kulinacs @mr-tz
|
||||||
- nursery/connect-to-wmi-namespace-via-wbemlocator michael.hunhoff@fireeye.com
|
- nursery/connect-to-wmi-namespace-via-wbemlocator michael.hunhoff@mandiant.com
|
||||||
- anti-analysis/obfuscation/obfuscated-with-callobfuscator johnk3r
|
- anti-analysis/obfuscation/obfuscated-with-callobfuscator johnk3r
|
||||||
- executable/installer/inno-setup/packaged-as-an-inno-setup-installer awillia2@cisco.com
|
- executable/installer/inno-setup/packaged-as-an-inno-setup-installer awillia2@cisco.com
|
||||||
- data-manipulation/hashing/djb2/hash-data-using-djb2 awillia2@cisco.com
|
- data-manipulation/hashing/djb2/hash-data-using-djb2 awillia2@cisco.com
|
||||||
- data-manipulation/encoding/base64/decode-data-using-base64-via-dword-translation-table gilbert.elliot@fireeye.com
|
- data-manipulation/encoding/base64/decode-data-using-base64-via-dword-translation-table gilbert.elliot@mandiant.com
|
||||||
- nursery/list-tcp-connections-and-listeners michael.hunhoff@fireeye.com
|
- nursery/list-tcp-connections-and-listeners michael.hunhoff@mandiant.com
|
||||||
- nursery/list-udp-connections-and-listeners michael.hunhoff@fireeye.com
|
- nursery/list-udp-connections-and-listeners michael.hunhoff@mandiant.com
|
||||||
- nursery/log-keystrokes-via-raw-input-data michael.hunhoff@fireeye.com
|
- nursery/log-keystrokes-via-raw-input-data michael.hunhoff@mandiant.com
|
||||||
- nursery/register-http-server-url michael.hunhoff@fireeye.com
|
- nursery/register-http-server-url michael.hunhoff@mandiant.com
|
||||||
- internal/limitation/file/internal-autoit-file-limitation.yml william.ballenthin@fireeye.com
|
- internal/limitation/file/internal-autoit-file-limitation.yml william.ballenthin@mandiant.com
|
||||||
- internal/limitation/file/internal-dotnet-file-limitation.yml william.ballenthin@fireeye.com
|
- internal/limitation/file/internal-dotnet-file-limitation.yml william.ballenthin@mandiant.com
|
||||||
- internal/limitation/file/internal-installer-file-limitation.yml william.ballenthin@fireeye.com
|
- internal/limitation/file/internal-installer-file-limitation.yml william.ballenthin@mandiant.com
|
||||||
- internal/limitation/file/internal-packer-file-limitation.yml william.ballenthin@fireeye.com
|
- internal/limitation/file/internal-packer-file-limitation.yml william.ballenthin@mandiant.com
|
||||||
- host-interaction/network/domain/enumerate-domain-computers-via-ldap awillia2@cisco.com
|
- host-interaction/network/domain/enumerate-domain-computers-via-ldap awillia2@cisco.com
|
||||||
- host-interaction/network/domain/get-domain-controller-name awillia2@cisco.com
|
- host-interaction/network/domain/get-domain-controller-name awillia2@cisco.com
|
||||||
- internal/limitation/file/internal-visual-basic-file-limitation @mr-tz
|
- internal/limitation/file/internal-visual-basic-file-limitation @mr-tz
|
||||||
- data-manipulation/hashing/md5/hash-data-with-md5 moritz.raabe@fireeye.com
|
- data-manipulation/hashing/md5/hash-data-with-md5 moritz.raabe@mandiant.com
|
||||||
- compiler/autohotkey/compiled-with-autohotkey awillia2@cisco.com
|
- compiler/autohotkey/compiled-with-autohotkey awillia2@cisco.com
|
||||||
- internal/limitation/file/internal-autohotkey-file-limitation @mr-tz
|
- internal/limitation/file/internal-autohotkey-file-limitation @mr-tz
|
||||||
- host-interaction/process/dump/create-process-memory-minidump michael.hunhoff@fireeye.com
|
- host-interaction/process/dump/create-process-memory-minidump michael.hunhoff@mandiant.com
|
||||||
- nursery/get-storage-device-properties michael.hunhoff@fireeye.com
|
- nursery/get-storage-device-properties michael.hunhoff@mandiant.com
|
||||||
- nursery/execute-shell-command-via-windows-remote-management michael.hunhoff@fireeye.com
|
- nursery/execute-shell-command-via-windows-remote-management michael.hunhoff@mandiant.com
|
||||||
- nursery/get-token-privileges michael.hunhoff@fireeye.com
|
- nursery/get-token-privileges michael.hunhoff@mandiant.com
|
||||||
- nursery/prompt-user-for-credentials michael.hunhoff@fireeye.com
|
- nursery/prompt-user-for-credentials michael.hunhoff@mandiant.com
|
||||||
- nursery/spoof-parent-pid michael.hunhoff@fireeye.com
|
- nursery/spoof-parent-pid michael.hunhoff@mandiant.com
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
@@ -309,8 +363,8 @@ A huge thanks to everyone who submitted issues, provided feedback, and contribut
|
|||||||
### Development
|
### Development
|
||||||
|
|
||||||
- ci: add capa release link to capa-rules tag #517 @Ana06
|
- ci: add capa release link to capa-rules tag #517 @Ana06
|
||||||
- ci, changelog: update `New Rules` section in CHANGELOG automatically https://github.com/fireeye/capa-rules/pull/374 #549 #604 @Ana06
|
- ci, changelog: update `New Rules` section in CHANGELOG automatically https://github.com/mandiant/capa-rules/pull/374 #549 #604 @Ana06
|
||||||
- ci, changelog: support multiple author in sync GH https://github.com/fireeye/capa-rules/pull/378 @Ana06
|
- ci, changelog: support multiple author in sync GH https://github.com/mandiant/capa-rules/pull/378 @Ana06
|
||||||
- ci, lint: check statements for single child statements #563 @mr-tz
|
- ci, lint: check statements for single child statements #563 @mr-tz
|
||||||
- ci: reject PRs without CHANGELOG update to ensure CHANGELOG is kept up-to-date #584 @Ana06
|
- ci: reject PRs without CHANGELOG update to ensure CHANGELOG is kept up-to-date #584 @Ana06
|
||||||
- ci: test that scripts run #660 @mr-tz
|
- ci: test that scripts run #660 @mr-tz
|
||||||
@@ -318,8 +372,8 @@ A huge thanks to everyone who submitted issues, provided feedback, and contribut
|
|||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
<!-- The diff uses v1.6.1 because master doesn't include v1.6.2 and v1.6.3 -->
|
<!-- The diff uses v1.6.1 because master doesn't include v1.6.2 and v1.6.3 -->
|
||||||
- [capa v1.6.1...v2.0.0](https://github.com/fireeye/capa/compare/v1.6.1...v2.0.0)
|
- [capa v1.6.1...v2.0.0](https://github.com/mandiant/capa/compare/v1.6.1...v2.0.0)
|
||||||
- [capa-rules v1.6.1...v2.0.0](https://github.com/fireeye/capa-rules/compare/v1.6.1...v2.0.0)
|
- [capa-rules v1.6.1...v2.0.0](https://github.com/mandiant/capa-rules/compare/v1.6.1...v2.0.0)
|
||||||
|
|
||||||
|
|
||||||
## v1.6.3 (2021-04-29)
|
## v1.6.3 (2021-04-29)
|
||||||
@@ -332,7 +386,7 @@ This release adds IDA 7.6 support to capa.
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.6.2...v1.6.3](https://github.com/fireeye/capa/compare/v1.6.2...v1.6.3)
|
- [capa v1.6.2...v1.6.3](https://github.com/mandiant/capa/compare/v1.6.2...v1.6.3)
|
||||||
|
|
||||||
|
|
||||||
## v1.6.2 (2021-04-13)
|
## v1.6.2 (2021-04-13)
|
||||||
@@ -345,7 +399,7 @@ This release backports a fix to capa 1.6: The Windows binary was built with Pyth
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.6.1...v1.6.2](https://github.com/fireeye/capa/compare/v1.6.1...v1.6.2)
|
- [capa v1.6.1...v1.6.2](https://github.com/mandiant/capa/compare/v1.6.1...v1.6.2)
|
||||||
|
|
||||||
|
|
||||||
## v1.6.1 (2021-04-07)
|
## v1.6.1 (2021-04-07)
|
||||||
@@ -413,8 +467,8 @@ This release includes several bug fixes, such as a vivisect issue that prevented
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.6.0...v1.6.1](https://github.com/fireeye/capa/compare/v1.6.0...v1.6.1)
|
- [capa v1.6.0...v1.6.1](https://github.com/mandiant/capa/compare/v1.6.0...v1.6.1)
|
||||||
- [capa-rules v1.6.0...v1.6.1](https://github.com/fireeye/capa-rules/compare/v1.6.0...v1.6.1)
|
- [capa-rules v1.6.0...v1.6.1](https://github.com/mandiant/capa-rules/compare/v1.6.0...v1.6.1)
|
||||||
|
|
||||||
|
|
||||||
## v1.6.0 (2021-03-09)
|
## v1.6.0 (2021-03-09)
|
||||||
@@ -423,7 +477,7 @@ This release adds the capa explorer rule generator plugin for IDA Pro, vivisect
|
|||||||
|
|
||||||
### Rule Generator IDA Plugin
|
### Rule Generator IDA Plugin
|
||||||
|
|
||||||
The capa explorer IDA plugin now helps you quickly build new capa rules using features extracted directly from your IDA database. Without leaving the plugin interface you can use the features extracted by capa explorer to develop and test new rules and save your work directly to your capa rules directory. To get started select the new `Rule Generator` tab, navigate to a function in the IDA `Disassembly` view, and click `Analyze`. For more information check out the capa explorer [readme](https://github.com/fireeye/capa/blob/master/capa/ida/plugin/README.md).
|
The capa explorer IDA plugin now helps you quickly build new capa rules using features extracted directly from your IDA database. Without leaving the plugin interface you can use the features extracted by capa explorer to develop and test new rules and save your work directly to your capa rules directory. To get started select the new `Rule Generator` tab, navigate to a function in the IDA `Disassembly` view, and click `Analyze`. For more information check out the capa explorer [readme](https://github.com/mandiant/capa/blob/master/capa/ida/plugin/README.md).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -485,8 +539,8 @@ If you have workflows that rely on the Python 2 version and need future maintena
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.5.1...v1.6.0](https://github.com/fireeye/capa/compare/v1.5.1...v1.6.0)
|
- [capa v1.5.1...v1.6.0](https://github.com/mandiant/capa/compare/v1.5.1...v1.6.0)
|
||||||
- [capa-rules v1.5.1...v1.6.0](https://github.com/fireeye/capa-rules/compare/v1.5.1...v1.6.0)
|
- [capa-rules v1.5.1...v1.6.0](https://github.com/mandiant/capa-rules/compare/v1.5.1...v1.6.0)
|
||||||
|
|
||||||
|
|
||||||
## v1.5.1 (2021-02-09)
|
## v1.5.1 (2021-02-09)
|
||||||
@@ -499,8 +553,8 @@ This release fixes the version number that we forgot to update for v1.5.0 (there
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.5.0...v1.5.1](https://github.com/fireeye/capa/compare/v1.5.1...v1.6.0)
|
- [capa v1.5.0...v1.5.1](https://github.com/mandiant/capa/compare/v1.5.1...v1.6.0)
|
||||||
- [capa-rules v1.5.0...v1.5.1](https://github.com/fireeye/capa-rules/compare/v1.5.1...v1.6.0)
|
- [capa-rules v1.5.0...v1.5.1](https://github.com/mandiant/capa-rules/compare/v1.5.1...v1.6.0)
|
||||||
|
|
||||||
|
|
||||||
## v1.5.0 (2021-02-05)
|
## v1.5.0 (2021-02-05)
|
||||||
@@ -515,7 +569,7 @@ This release brings support for running capa under Python 3 via [SMDA](https://g
|
|||||||
|
|
||||||
@dzbeck also added [Malware Behavior Catalog](https://github.com/MBCProject/mbc-markdown) (MBC) and ATT&CK mappings for many rules.
|
@dzbeck also added [Malware Behavior Catalog](https://github.com/MBCProject/mbc-markdown) (MBC) and ATT&CK mappings for many rules.
|
||||||
|
|
||||||
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/fireeye/capa/). Report issues on our [issue tracker](https://github.com/fireeye/capa/issues) and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/).
|
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/mandiant/capa/). Report issues on our [issue tracker](https://github.com/mandiant/capa/issues) and contribute new rules at [capa-rules](https://github.com/mandiant/capa-rules/).
|
||||||
|
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
@@ -598,8 +652,8 @@ Download a standalone binary below and checkout the readme [here on GitHub](http
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.4.1...v1.5.0](https://github.com/fireeye/capa/compare/v1.4.1...v1.5.0)
|
- [capa v1.4.1...v1.5.0](https://github.com/mandiant/capa/compare/v1.4.1...v1.5.0)
|
||||||
- [capa-rules v1.4.0...v1.5.0](https://github.com/fireeye/capa-rules/compare/v1.4.0...v1.5.0)
|
- [capa-rules v1.4.0...v1.5.0](https://github.com/mandiant/capa-rules/compare/v1.4.0...v1.5.0)
|
||||||
|
|
||||||
## v1.4.1 (2020-10-23)
|
## v1.4.1 (2020-10-23)
|
||||||
|
|
||||||
@@ -611,8 +665,8 @@ This release fixes an issue building capa on our CI server, which prevented us f
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.4.0...v1.4.1](https://github.com/fireeye/capa/compare/v1.4.0...v1.4.1)
|
- [capa v1.4.0...v1.4.1](https://github.com/mandiant/capa/compare/v1.4.0...v1.4.1)
|
||||||
- [capa-rules v1.4.0...v1.4.1](https://github.com/fireeye/capa-rules/compare/v1.4.0...v1.4.1)
|
- [capa-rules v1.4.0...v1.4.1](https://github.com/mandiant/capa-rules/compare/v1.4.0...v1.4.1)
|
||||||
|
|
||||||
## v1.4.0 (2020-10-23)
|
## v1.4.0 (2020-10-23)
|
||||||
|
|
||||||
@@ -623,7 +677,7 @@ This capa release includes changes to the rule parsing, enhanced feature extract
|
|||||||
|
|
||||||
@dzbeck added [Malware Behavior Catalog](https://github.com/MBCProject/mbc-markdown) (MBC) and ATT&CK mappings for 86 rules.
|
@dzbeck added [Malware Behavior Catalog](https://github.com/MBCProject/mbc-markdown) (MBC) and ATT&CK mappings for 86 rules.
|
||||||
|
|
||||||
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/fireeye/capa/). Report issues on our [issue tracker](https://github.com/fireeye/capa/issues) and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/).
|
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/mandiant/capa/). Report issues on our [issue tracker](https://github.com/mandiant/capa/issues) and contribute new rules at [capa-rules](https://github.com/mandiant/capa-rules/).
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
@@ -726,8 +780,8 @@ Download a standalone binary below and checkout the readme [here on GitHub](http
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.3.0...v1.4.0](https://github.com/fireeye/capa/compare/v1.3.0...v1.4.0)
|
- [capa v1.3.0...v1.4.0](https://github.com/mandiant/capa/compare/v1.3.0...v1.4.0)
|
||||||
- [capa-rules v1.3.0...v1.4.0](https://github.com/fireeye/capa-rules/compare/v1.3.0...v1.4.0)
|
- [capa-rules v1.3.0...v1.4.0](https://github.com/mandiant/capa-rules/compare/v1.3.0...v1.4.0)
|
||||||
|
|
||||||
## v1.3.0 (2020-09-14)
|
## v1.3.0 (2020-09-14)
|
||||||
|
|
||||||
@@ -741,7 +795,7 @@ This release brings newly updated mappings to the [Malware Behavior Catalog vers
|
|||||||
- @weslambert
|
- @weslambert
|
||||||
- @stevemk14ebr
|
- @stevemk14ebr
|
||||||
|
|
||||||
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/fireeye/capa/). Report issues on our [issue tracker](https://github.com/fireeye/capa/issues) and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/).
|
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/mandiant/capa/). Report issues on our [issue tracker](https://github.com/mandiant/capa/issues) and contribute new rules at [capa-rules](https://github.com/mandiant/capa-rules/).
|
||||||
|
|
||||||
### Key changes to IDA Plugin
|
### Key changes to IDA Plugin
|
||||||
|
|
||||||
@@ -751,9 +805,9 @@ The IDA Pro integration is now distributed as a real plugin, instead of a script
|
|||||||
- updates distributed PyPI/`pip install --upgrade` without touching your `%IDADIR%`
|
- updates distributed PyPI/`pip install --upgrade` without touching your `%IDADIR%`
|
||||||
- generally doing thing the "right way"
|
- generally doing thing the "right way"
|
||||||
|
|
||||||
How to get this new version? Its easy: download [capa_explorer.py](https://raw.githubusercontent.com/fireeye/capa/master/capa/ida/plugin/capa_explorer.py) to your IDA plugins directory and update your capa installation (incidentally, this is a good opportunity to migrate to `pip install flare-capa` instead of git checkouts). Now you should see the plugin listed in the `Edit > Plugins > FLARE capa explorer` menu in IDA.
|
How to get this new version? Its easy: download [capa_explorer.py](https://raw.githubusercontent.com/mandiant/capa/master/capa/ida/plugin/capa_explorer.py) to your IDA plugins directory and update your capa installation (incidentally, this is a good opportunity to migrate to `pip install flare-capa` instead of git checkouts). Now you should see the plugin listed in the `Edit > Plugins > FLARE capa explorer` menu in IDA.
|
||||||
|
|
||||||
Please refer to the plugin [readme](https://github.com/fireeye/capa/blob/master/capa/ida/plugin/README.md) for additional information on installing and using the IDA Pro plugin.
|
Please refer to the plugin [readme](https://github.com/mandiant/capa/blob/master/capa/ida/plugin/README.md) for additional information on installing and using the IDA Pro plugin.
|
||||||
|
|
||||||
Please open an issue in this repository if you notice anything weird.
|
Please open an issue in this repository if you notice anything weird.
|
||||||
|
|
||||||
@@ -798,8 +852,8 @@ Please open an issue in this repository if you notice anything weird.
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.2.0...v1.3.0](https://github.com/fireeye/capa/compare/v1.2.0...v1.3.0)
|
- [capa v1.2.0...v1.3.0](https://github.com/mandiant/capa/compare/v1.2.0...v1.3.0)
|
||||||
- [capa-rules v1.2.0...v1.3.0](https://github.com/fireeye/capa-rules/compare/v1.2.0...v1.3.0)
|
- [capa-rules v1.2.0...v1.3.0](https://github.com/mandiant/capa-rules/compare/v1.2.0...v1.3.0)
|
||||||
|
|
||||||
## v1.2.0 (2020-08-31)
|
## v1.2.0 (2020-08-31)
|
||||||
|
|
||||||
@@ -815,9 +869,9 @@ We received contributions from ten reverse engineers, including five new ones:
|
|||||||
- @edeca
|
- @edeca
|
||||||
- @winniepe
|
- @winniepe
|
||||||
|
|
||||||
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/fireeye/capa/).
|
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/mandiant/capa/).
|
||||||
Report issues on our [issue tracker](https://github.com/fireeye/capa/issues)
|
Report issues on our [issue tracker](https://github.com/mandiant/capa/issues)
|
||||||
and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/).
|
and contribute new rules at [capa-rules](https://github.com/mandiant/capa-rules/).
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
@@ -896,8 +950,8 @@ and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/)
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.1.0...v1.2.0](https://github.com/fireeye/capa/compare/v1.1.0...v1.2.0)
|
- [capa v1.1.0...v1.2.0](https://github.com/mandiant/capa/compare/v1.1.0...v1.2.0)
|
||||||
- [capa-rules v1.1.0...v1.2.0](https://github.com/fireeye/capa-rules/compare/v1.1.0...v1.2.0)
|
- [capa-rules v1.1.0...v1.2.0](https://github.com/mandiant/capa-rules/compare/v1.1.0...v1.2.0)
|
||||||
|
|
||||||
## v1.1.0 (2020-08-05)
|
## v1.1.0 (2020-08-05)
|
||||||
|
|
||||||
@@ -910,7 +964,7 @@ We received contributions from eight reverse engineers, including four new ones:
|
|||||||
- @bitsofbinary
|
- @bitsofbinary
|
||||||
- @threathive
|
- @threathive
|
||||||
|
|
||||||
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/fireeye/capa/). Report issues on our [issue tracker](https://github.com/fireeye/capa/issues) and contribute new rules at [capa-rules](https://github.com/fireeye/capa-rules/).
|
Download a standalone binary below and checkout the readme [here on GitHub](https://github.com/mandiant/capa/). Report issues on our [issue tracker](https://github.com/mandiant/capa/issues) and contribute new rules at [capa-rules](https://github.com/mandiant/capa-rules/).
|
||||||
|
|
||||||
### New features
|
### New features
|
||||||
|
|
||||||
@@ -983,5 +1037,5 @@ Download a standalone binary below and checkout the readme [here on GitHub](http
|
|||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
|
|
||||||
- [capa v1.0.0...v1.1.0](https://github.com/fireeye/capa/compare/v1.0.0...v1.1.0)
|
- [capa v1.0.0...v1.1.0](https://github.com/mandiant/capa/compare/v1.0.0...v1.1.0)
|
||||||
- [capa-rules v1.0.0...v1.1.0](https://github.com/fireeye/capa-rules/compare/v1.0.0...v1.1.0)
|
- [capa-rules v1.0.0...v1.1.0](https://github.com/mandiant/capa-rules/compare/v1.0.0...v1.1.0)
|
||||||
|
|||||||
@@ -187,7 +187,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc.
|
Copyright (C) 2020 Mandiant, Inc.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
40
README.md
40
README.md
@@ -1,10 +1,10 @@
|
|||||||

|

|
||||||
|
|
||||||
[](https://pypi.org/project/flare-capa)
|
[](https://pypi.org/project/flare-capa)
|
||||||
[](https://github.com/fireeye/capa/releases)
|
[](https://github.com/mandiant/capa/releases)
|
||||||
[](https://github.com/fireeye/capa-rules)
|
[](https://github.com/mandiant/capa-rules)
|
||||||
[](https://github.com/fireeye/capa/actions?query=workflow%3ACI+event%3Apush+branch%3Amaster)
|
[](https://github.com/mandiant/capa/actions?query=workflow%3ACI+event%3Apush+branch%3Amaster)
|
||||||
[](https://github.com/fireeye/capa/releases)
|
[](https://github.com/mandiant/capa/releases)
|
||||||
[](LICENSE.txt)
|
[](LICENSE.txt)
|
||||||
|
|
||||||
capa detects capabilities in executable files.
|
capa detects capabilities in executable files.
|
||||||
@@ -66,11 +66,11 @@ $ capa.exe suspicious.exe
|
|||||||
|
|
||||||
# download and usage
|
# download and usage
|
||||||
|
|
||||||
Download stable releases of the standalone capa binaries [here](https://github.com/fireeye/capa/releases). You can run the standalone binaries without installation. capa is a command line tool that should be run from the terminal.
|
Download stable releases of the standalone capa binaries [here](https://github.com/mandiant/capa/releases). You can run the standalone binaries without installation. capa is a command line tool that should be run from the terminal.
|
||||||
|
|
||||||
To use capa as a library or integrate with another tool, see [doc/installation.md](https://github.com/fireeye/capa/blob/master/doc/installation.md) for further setup instructions.
|
To use capa as a library or integrate with another tool, see [doc/installation.md](https://github.com/mandiant/capa/blob/master/doc/installation.md) for further setup instructions.
|
||||||
|
|
||||||
For more information about how to use capa, see [doc/usage.md](https://github.com/fireeye/capa/blob/master/doc/usage.md).
|
For more information about how to use capa, see [doc/usage.md](https://github.com/mandiant/capa/blob/master/doc/usage.md).
|
||||||
|
|
||||||
# example
|
# example
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ $ capa.exe suspicious.exe -vv
|
|||||||
...
|
...
|
||||||
execute shell command and capture output
|
execute shell command and capture output
|
||||||
namespace c2/shell
|
namespace c2/shell
|
||||||
author matthew.williams@fireeye.com
|
author matthew.williams@mandiant.com
|
||||||
scope function
|
scope function
|
||||||
att&ck Execution::Command and Scripting Interpreter::Windows Command Shell [T1059.003]
|
att&ck Execution::Command and Scripting Interpreter::Windows Command Shell [T1059.003]
|
||||||
references https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa
|
references https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa
|
||||||
@@ -127,7 +127,7 @@ rule:
|
|||||||
meta:
|
meta:
|
||||||
name: hash data with CRC32
|
name: hash data with CRC32
|
||||||
namespace: data-manipulation/checksum/crc32
|
namespace: data-manipulation/checksum/crc32
|
||||||
author: moritz.raabe@fireeye.com
|
author: moritz.raabe@mandiant.com
|
||||||
scope: function
|
scope: function
|
||||||
examples:
|
examples:
|
||||||
- 2D3EDC218A90F03089CC01715A9F047F:0x403CBD
|
- 2D3EDC218A90F03089CC01715A9F047F:0x403CBD
|
||||||
@@ -142,24 +142,24 @@ rule:
|
|||||||
- api: RtlComputeCrc32
|
- api: RtlComputeCrc32
|
||||||
```
|
```
|
||||||
|
|
||||||
The [github.com/fireeye/capa-rules](https://github.com/fireeye/capa-rules) repository contains hundreds of standard library rules that are distributed with capa.
|
The [github.com/mandiant/capa-rules](https://github.com/mandiant/capa-rules) repository contains hundreds of standard library rules that are distributed with capa.
|
||||||
Please learn to write rules and contribute new entries as you find interesting techniques in malware.
|
Please learn to write rules and contribute new entries as you find interesting techniques in malware.
|
||||||
|
|
||||||
If you use IDA Pro, then you can use the [capa explorer](https://github.com/fireeye/capa/tree/master/capa/ida/plugin) plugin.
|
If you use IDA Pro, then you can use the [capa explorer](https://github.com/mandiant/capa/tree/master/capa/ida/plugin) plugin.
|
||||||
capa explorer helps you identify interesting areas of a program and build new capa rules using features extracted directly from your IDA Pro database.
|
capa explorer helps you identify interesting areas of a program and build new capa rules using features extracted directly from your IDA Pro database.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# further information
|
# further information
|
||||||
## capa
|
## capa
|
||||||
- [Installation](https://github.com/fireeye/capa/blob/master/doc/installation.md)
|
- [Installation](https://github.com/mandiant/capa/blob/master/doc/installation.md)
|
||||||
- [Usage](https://github.com/fireeye/capa/blob/master/doc/usage.md)
|
- [Usage](https://github.com/mandiant/capa/blob/master/doc/usage.md)
|
||||||
- [Limitations](https://github.com/fireeye/capa/blob/master/doc/limitations.md)
|
- [Limitations](https://github.com/mandiant/capa/blob/master/doc/limitations.md)
|
||||||
- [Contributing Guide](https://github.com/fireeye/capa/blob/master/.github/CONTRIBUTING.md)
|
- [Contributing Guide](https://github.com/mandiant/capa/blob/master/.github/CONTRIBUTING.md)
|
||||||
|
|
||||||
## capa rules
|
## capa rules
|
||||||
- [capa-rules repository](https://github.com/fireeye/capa-rules)
|
- [capa-rules repository](https://github.com/mandiant/capa-rules)
|
||||||
- [capa-rules rule format](https://github.com/fireeye/capa-rules/blob/master/doc/format.md)
|
- [capa-rules rule format](https://github.com/mandiant/capa-rules/blob/master/doc/format.md)
|
||||||
|
|
||||||
## capa testfiles
|
## capa testfiles
|
||||||
The [capa-testfiles repository](https://github.com/fireeye/capa-testfiles) contains the data we use to test capa's code and rules
|
The [capa-testfiles repository](https://github.com/mandiant/capa-testfiles) contains the data we use to test capa's code and rules
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# strings code from FLOSS, https://github.com/fireeye/flare-floss
|
# strings code from FLOSS, https://github.com/mandiant/flare-floss
|
||||||
#
|
#
|
||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ json format:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -134,6 +134,12 @@ def collect_metadata():
|
|||||||
"format": idaapi.get_file_type_name(),
|
"format": idaapi.get_file_type_name(),
|
||||||
"extractor": "ida",
|
"extractor": "ida",
|
||||||
"base_address": idaapi.get_imagebase(),
|
"base_address": idaapi.get_imagebase(),
|
||||||
|
"layout": {
|
||||||
|
# this is updated after capabilities have been collected.
|
||||||
|
# will look like:
|
||||||
|
#
|
||||||
|
# "functions": { 0x401000: { "matched_basic_blocks": [ 0x401000, 0x401005, ... ] }, ... }
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"version": capa.version.__version__,
|
"version": capa.version.__version__,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ To use capa explorer with IDA 7.4 and Python 3.8.x you must follow the instructi
|
|||||||
|
|
||||||
To use capa explorer with IDA 7.5 and Python 3.9.x you must follow the instructions provided by hex-rays [here](https://hex-rays.com/blog/python-3-9-support-for-ida-7-5/).
|
To use capa explorer with IDA 7.5 and Python 3.9.x you must follow the instructions provided by hex-rays [here](https://hex-rays.com/blog/python-3-9-support-for-ida-7-5/).
|
||||||
|
|
||||||
If you encounter issues with your specific setup, please open a new [Issue](https://github.com/fireeye/capa/issues).
|
If you encounter issues with your specific setup, please open a new [Issue](https://github.com/mandiant/capa/issues).
|
||||||
|
|
||||||
#### IDA 7.6 caveat: IDA 7.6sp1 or patch required
|
#### IDA 7.6 caveat: IDA 7.6sp1 or patch required
|
||||||
|
|
||||||
@@ -86,8 +86,8 @@ You can install capa explorer using the following steps:
|
|||||||
```
|
```
|
||||||
$ pip install flare-capa
|
$ pip install flare-capa
|
||||||
```
|
```
|
||||||
3. Download the [standard collection of capa rules](https://github.com/fireeye/capa-rules) (capa explorer needs capa rules to analyze a database)
|
3. Download the [standard collection of capa rules](https://github.com/mandiant/capa-rules) (capa explorer needs capa rules to analyze a database)
|
||||||
4. Copy [capa_explorer.py](https://raw.githubusercontent.com/fireeye/capa/master/capa/ida/plugin/capa_explorer.py) to your IDA plugins directory
|
4. Copy [capa_explorer.py](https://raw.githubusercontent.com/mandiant/capa/master/capa/ida/plugin/capa_explorer.py) to your IDA plugins directory
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ You can install capa explorer using the following steps:
|
|||||||
|
|
||||||
When running capa explorer for the first time you are prompted to select a file directory containing capa rules. The plugin conveniently
|
When running capa explorer for the first time you are prompted to select a file directory containing capa rules. The plugin conveniently
|
||||||
remembers your selection for future runs; you can change this selection and other default settings by clicking `Settings`. We recommend
|
remembers your selection for future runs; you can change this selection and other default settings by clicking `Settings`. We recommend
|
||||||
downloading and using the [standard collection of capa rules](https://github.com/fireeye/capa-rules) when getting started with the plugin.
|
downloading and using the [standard collection of capa rules](https://github.com/mandiant/capa-rules) when getting started with the plugin.
|
||||||
|
|
||||||
#### Tips for Program Analysis
|
#### Tips for Program Analysis
|
||||||
|
|
||||||
@@ -125,15 +125,15 @@ downloading and using the [standard collection of capa rules](https://github.com
|
|||||||
## Development
|
## Development
|
||||||
|
|
||||||
capa explorer is packaged with capa so you will need to install capa locally for development. You can install capa locally by following the steps outlined in `Method 3: Inspecting the capa source code` of the [capa
|
capa explorer is packaged with capa so you will need to install capa locally for development. You can install capa locally by following the steps outlined in `Method 3: Inspecting the capa source code` of the [capa
|
||||||
installation guide](https://github.com/fireeye/capa/blob/master/doc/installation.md#method-3-inspecting-the-capa-source-code). Once installed, copy [capa_explorer.py](https://raw.githubusercontent.com/fireeye/capa/master/capa/ida/plugin/capa_explorer.py)
|
installation guide](https://github.com/mandiant/capa/blob/master/doc/installation.md#method-3-inspecting-the-capa-source-code). Once installed, copy [capa_explorer.py](https://raw.githubusercontent.com/mandiant/capa/master/capa/ida/plugin/capa_explorer.py)
|
||||||
to your plugins directory to install capa explorer in IDA.
|
to your plugins directory to install capa explorer in IDA.
|
||||||
|
|
||||||
### Components
|
### Components
|
||||||
|
|
||||||
capa explorer consists of two main components:
|
capa explorer consists of two main components:
|
||||||
|
|
||||||
* An [feature extractor](https://github.com/fireeye/capa/tree/master/capa/features/extractors/ida) built on top of IDA's binary analysis engine
|
* An [feature extractor](https://github.com/mandiant/capa/tree/master/capa/features/extractors/ida) built on top of IDA's binary analysis engine
|
||||||
* This component uses IDAPython to extract [capa features](https://github.com/fireeye/capa-rules/blob/master/doc/format.md#extracted-features) from your IDBs such as strings,
|
* This component uses IDAPython to extract [capa features](https://github.com/mandiant/capa-rules/blob/master/doc/format.md#extracted-features) from your IDBs such as strings,
|
||||||
disassembly, and control flow; these extracted features are used by capa to find feature combinations that result in a rule match
|
disassembly, and control flow; these extracted features are used by capa to find feature combinations that result in a rule match
|
||||||
* An [interactive user interface](https://github.com/fireeye/capa/tree/master/capa/ida/plugin) for displaying and exploring capa rule matches
|
* An [interactive user interface](https://github.com/mandiant/capa/tree/master/capa/ida/plugin) for displaying and exploring capa rule matches
|
||||||
* This component integrates the feature extractor and capa, providing an interactive user interface to dissect rule matches found by capa using features extracted directly from your IDBs
|
* This component integrates the feature extractor and capa, providing an interactive user interface to dissect rule matches found by capa using features extracted directly from your IDBs
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -27,8 +27,8 @@ class CapaExplorerPlugin(idaapi.plugin_t):
|
|||||||
wanted_name = PLUGIN_NAME
|
wanted_name = PLUGIN_NAME
|
||||||
wanted_hotkey = "ALT-F5"
|
wanted_hotkey = "ALT-F5"
|
||||||
comment = "IDA Pro plugin for the FLARE team's capa tool to identify capabilities in executable files."
|
comment = "IDA Pro plugin for the FLARE team's capa tool to identify capabilities in executable files."
|
||||||
website = "https://github.com/fireeye/capa"
|
website = "https://github.com/mandiant/capa"
|
||||||
help = "See https://github.com/fireeye/capa/blob/master/doc/usage.md"
|
help = "See https://github.com/mandiant/capa/blob/master/doc/usage.md"
|
||||||
version = ""
|
version = ""
|
||||||
flags = 0
|
flags = 0
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -627,7 +627,7 @@ class CapaExplorerForm(idaapi.PluginForm):
|
|||||||
path = self.ask_user_directory()
|
path = self.ask_user_directory()
|
||||||
if not path:
|
if not path:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
"You must select a file directory containing capa rules before analysis can be run. The standard collection of capa rules can be downloaded from https://github.com/fireeye/capa-rules."
|
"You must select a file directory containing capa rules before analysis can be run. The standard collection of capa rules can be downloaded from https://github.com/mandiant/capa-rules."
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
settings.user[CAPA_SETTINGS_RULE_PATH] = path
|
settings.user[CAPA_SETTINGS_RULE_PATH] = path
|
||||||
@@ -694,7 +694,7 @@ class CapaExplorerForm(idaapi.PluginForm):
|
|||||||
)
|
)
|
||||||
logger.error("Failed to load rules from %s (error: %s).", settings.user[CAPA_SETTINGS_RULE_PATH], e)
|
logger.error("Failed to load rules from %s (error: %s).", settings.user[CAPA_SETTINGS_RULE_PATH], e)
|
||||||
logger.error(
|
logger.error(
|
||||||
"Make sure your file directory contains properly formatted capa rules. You can download the standard collection of capa rules from https://github.com/fireeye/capa-rules."
|
"Make sure your file directory contains properly formatted capa rules. You can download the standard collection of capa rules from https://github.com/mandiant/capa-rules."
|
||||||
)
|
)
|
||||||
settings.user[CAPA_SETTINGS_RULE_PATH] = ""
|
settings.user[CAPA_SETTINGS_RULE_PATH] = ""
|
||||||
return False
|
return False
|
||||||
@@ -751,6 +751,7 @@ class CapaExplorerForm(idaapi.PluginForm):
|
|||||||
meta = capa.ida.helpers.collect_metadata()
|
meta = capa.ida.helpers.collect_metadata()
|
||||||
capabilities, counts = capa.main.find_capabilities(self.ruleset_cache, extractor, disable_progress=True)
|
capabilities, counts = capa.main.find_capabilities(self.ruleset_cache, extractor, disable_progress=True)
|
||||||
meta["analysis"].update(counts)
|
meta["analysis"].update(counts)
|
||||||
|
meta["analysis"]["layout"] = capa.main.compute_layout(self.ruleset_cache, extractor, capabilities)
|
||||||
except UserCancelledError:
|
except UserCancelledError:
|
||||||
logger.info("User cancelled analysis.")
|
logger.info("User cancelled analysis.")
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
98
capa/main.py
98
capa/main.py
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -51,6 +51,16 @@ BACKEND_SMDA = "smda"
|
|||||||
EXTENSIONS_SHELLCODE_32 = ("sc32", "raw32")
|
EXTENSIONS_SHELLCODE_32 = ("sc32", "raw32")
|
||||||
EXTENSIONS_SHELLCODE_64 = ("sc64", "raw64")
|
EXTENSIONS_SHELLCODE_64 = ("sc64", "raw64")
|
||||||
|
|
||||||
|
E_MISSING_RULES = -10
|
||||||
|
E_MISSING_FILE = -11
|
||||||
|
E_INVALID_RULE = -12
|
||||||
|
E_CORRUPT_FILE = -13
|
||||||
|
E_FILE_LIMITATION = -14
|
||||||
|
E_INVALID_SIG = -15
|
||||||
|
E_INVALID_FILE_TYPE = -16
|
||||||
|
E_INVALID_FILE_ARCH = -17
|
||||||
|
E_INVALID_FILE_OS = -18
|
||||||
|
E_UNSUPPORTED_IDA_VERSION = -19
|
||||||
|
|
||||||
logger = logging.getLogger("capa")
|
logger = logging.getLogger("capa")
|
||||||
|
|
||||||
@@ -582,10 +592,55 @@ def collect_metadata(argv, sample_path, rules_path, extractor):
|
|||||||
"extractor": extractor.__class__.__name__,
|
"extractor": extractor.__class__.__name__,
|
||||||
"rules": rules_path,
|
"rules": rules_path,
|
||||||
"base_address": extractor.get_base_address(),
|
"base_address": extractor.get_base_address(),
|
||||||
|
"layout": {
|
||||||
|
# this is updated after capabilities have been collected.
|
||||||
|
# will look like:
|
||||||
|
#
|
||||||
|
# "functions": { 0x401000: { "matched_basic_blocks": [ 0x401000, 0x401005, ... ] }, ... }
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def compute_layout(rules, extractor, capabilities):
|
||||||
|
"""
|
||||||
|
compute a metadata structure that links basic blocks
|
||||||
|
to the functions in which they're found.
|
||||||
|
|
||||||
|
only collect the basic blocks at which some rule matched.
|
||||||
|
otherwise, we may pollute the json document with
|
||||||
|
a large amount of un-referenced data.
|
||||||
|
"""
|
||||||
|
functions_by_bb = {}
|
||||||
|
bbs_by_function = {}
|
||||||
|
for f in extractor.get_functions():
|
||||||
|
bbs_by_function[int(f)] = []
|
||||||
|
for bb in extractor.get_basic_blocks(f):
|
||||||
|
functions_by_bb[int(bb)] = int(f)
|
||||||
|
bbs_by_function[int(f)].append(int(bb))
|
||||||
|
|
||||||
|
matched_bbs = set()
|
||||||
|
for rule_name, matches in capabilities.items():
|
||||||
|
rule = rules[rule_name]
|
||||||
|
if rule.meta.get("scope") == capa.rules.BASIC_BLOCK_SCOPE:
|
||||||
|
for (addr, match) in matches:
|
||||||
|
assert addr in functions_by_bb
|
||||||
|
matched_bbs.add(addr)
|
||||||
|
|
||||||
|
layout = {
|
||||||
|
"functions": {
|
||||||
|
f: {
|
||||||
|
"matched_basic_blocks": [bb for bb in bbs if bb in matched_bbs]
|
||||||
|
# this object is open to extension in the future,
|
||||||
|
# such as with the function name, etc.
|
||||||
|
}
|
||||||
|
for f, bbs in bbs_by_function.items()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return layout
|
||||||
|
|
||||||
|
|
||||||
def install_common_args(parser, wanted=None):
|
def install_common_args(parser, wanted=None):
|
||||||
"""
|
"""
|
||||||
register a common set of command line arguments for re-use by main & scripts.
|
register a common set of command line arguments for re-use by main & scripts.
|
||||||
@@ -744,7 +799,7 @@ def handle_common_args(args):
|
|||||||
logger.debug(" Using default embedded rules.")
|
logger.debug(" Using default embedded rules.")
|
||||||
logger.debug(" To provide your own rules, use the form `capa.exe -r ./path/to/rules/ /path/to/mal.exe`.")
|
logger.debug(" To provide your own rules, use the form `capa.exe -r ./path/to/rules/ /path/to/mal.exe`.")
|
||||||
logger.debug(" You can see the current default rule set here:")
|
logger.debug(" You can see the current default rule set here:")
|
||||||
logger.debug(" https://github.com/fireeye/capa-rules")
|
logger.debug(" https://github.com/mandiant/capa-rules")
|
||||||
logger.debug("-" * 80)
|
logger.debug("-" * 80)
|
||||||
|
|
||||||
rules_path = os.path.join(get_default_root(), "rules")
|
rules_path = os.path.join(get_default_root(), "rules")
|
||||||
@@ -756,7 +811,7 @@ def handle_common_args(args):
|
|||||||
# so in this case, we require the user to use -r to specify the rule directory.
|
# so in this case, we require the user to use -r to specify the rule directory.
|
||||||
logger.error("default embedded rules not found! (maybe you installed capa as a library?)")
|
logger.error("default embedded rules not found! (maybe you installed capa as a library?)")
|
||||||
logger.error("provide your own rule set via the `-r` option.")
|
logger.error("provide your own rule set via the `-r` option.")
|
||||||
return -1
|
return E_MISSING_RULES
|
||||||
else:
|
else:
|
||||||
rules_path = args.rules
|
rules_path = args.rules
|
||||||
logger.debug("using rules path: %s", rules_path)
|
logger.debug("using rules path: %s", rules_path)
|
||||||
@@ -792,7 +847,7 @@ def main(argv=None):
|
|||||||
"""
|
"""
|
||||||
By default, capa uses a default set of embedded rules.
|
By default, capa uses a default set of embedded rules.
|
||||||
You can see the rule set here:
|
You can see the rule set here:
|
||||||
https://github.com/fireeye/capa-rules
|
https://github.com/mandiant/capa-rules
|
||||||
|
|
||||||
To provide your own rule set, use the `-r` flag:
|
To provide your own rule set, use the `-r` flag:
|
||||||
capa --rules /path/to/rules suspicious.exe
|
capa --rules /path/to/rules suspicious.exe
|
||||||
@@ -822,7 +877,9 @@ def main(argv=None):
|
|||||||
install_common_args(parser, {"sample", "format", "backend", "signatures", "rules", "tag"})
|
install_common_args(parser, {"sample", "format", "backend", "signatures", "rules", "tag"})
|
||||||
parser.add_argument("-j", "--json", action="store_true", help="emit JSON instead of text")
|
parser.add_argument("-j", "--json", action="store_true", help="emit JSON instead of text")
|
||||||
args = parser.parse_args(args=argv)
|
args = parser.parse_args(args=argv)
|
||||||
handle_common_args(args)
|
ret = handle_common_args(args)
|
||||||
|
if ret is not None and ret != 0:
|
||||||
|
return ret
|
||||||
|
|
||||||
try:
|
try:
|
||||||
taste = get_file_taste(args.sample)
|
taste = get_file_taste(args.sample)
|
||||||
@@ -830,7 +887,7 @@ def main(argv=None):
|
|||||||
# per our research there's not a programmatic way to render the IOError with non-ASCII filename unless we
|
# per our research there's not a programmatic way to render the IOError with non-ASCII filename unless we
|
||||||
# handle the IOError separately and reach into the args
|
# handle the IOError separately and reach into the args
|
||||||
logger.error("%s", e.args[0])
|
logger.error("%s", e.args[0])
|
||||||
return -1
|
return E_MISSING_FILE
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rules = get_rules(args.rules, disable_progress=args.quiet)
|
rules = get_rules(args.rules, disable_progress=args.quiet)
|
||||||
@@ -850,7 +907,7 @@ def main(argv=None):
|
|||||||
logger.debug(" %d. %s", i, r)
|
logger.debug(" %d. %s", i, r)
|
||||||
except (IOError, capa.rules.InvalidRule, capa.rules.InvalidRuleSet) as e:
|
except (IOError, capa.rules.InvalidRule, capa.rules.InvalidRuleSet) as e:
|
||||||
logger.error("%s", str(e))
|
logger.error("%s", str(e))
|
||||||
return -1
|
return E_INVALID_RULE
|
||||||
|
|
||||||
file_extractor = None
|
file_extractor = None
|
||||||
if args.format == "pe" or (args.format == "auto" and taste.startswith(b"MZ")):
|
if args.format == "pe" or (args.format == "auto" and taste.startswith(b"MZ")):
|
||||||
@@ -862,24 +919,24 @@ def main(argv=None):
|
|||||||
file_extractor = capa.features.extractors.pefile.PefileFeatureExtractor(args.sample)
|
file_extractor = capa.features.extractors.pefile.PefileFeatureExtractor(args.sample)
|
||||||
except PEFormatError as e:
|
except PEFormatError as e:
|
||||||
logger.error("Input file '%s' is not a valid PE file: %s", args.sample, str(e))
|
logger.error("Input file '%s' is not a valid PE file: %s", args.sample, str(e))
|
||||||
return -1
|
return E_CORRUPT_FILE
|
||||||
|
|
||||||
elif args.format == "elf" or (args.format == "auto" and taste.startswith(b"\x7fELF")):
|
elif args.format == "elf" or (args.format == "auto" and taste.startswith(b"\x7fELF")):
|
||||||
try:
|
try:
|
||||||
file_extractor = capa.features.extractors.elffile.ElfFeatureExtractor(args.sample)
|
file_extractor = capa.features.extractors.elffile.ElfFeatureExtractor(args.sample)
|
||||||
except (ELFError, OverflowError) as e:
|
except (ELFError, OverflowError) as e:
|
||||||
logger.error("Input file '%s' is not a valid ELF file: %s", args.sample, str(e))
|
logger.error("Input file '%s' is not a valid ELF file: %s", args.sample, str(e))
|
||||||
return -1
|
return E_CORRUPT_FILE
|
||||||
|
|
||||||
if file_extractor:
|
if file_extractor:
|
||||||
try:
|
try:
|
||||||
pure_file_capabilities, _ = find_file_capabilities(rules, file_extractor, {})
|
pure_file_capabilities, _ = find_file_capabilities(rules, file_extractor, {})
|
||||||
except PEFormatError as e:
|
except PEFormatError as e:
|
||||||
logger.error("Input file '%s' is not a valid PE file: %s", args.sample, str(e))
|
logger.error("Input file '%s' is not a valid PE file: %s", args.sample, str(e))
|
||||||
return -1
|
return E_CORRUPT_FILE
|
||||||
except (ELFError, OverflowError) as e:
|
except (ELFError, OverflowError) as e:
|
||||||
logger.error("Input file '%s' is not a valid ELF file: %s", args.sample, str(e))
|
logger.error("Input file '%s' is not a valid ELF file: %s", args.sample, str(e))
|
||||||
return -1
|
return E_CORRUPT_FILE
|
||||||
|
|
||||||
# file limitations that rely on non-file scope won't be detected here.
|
# file limitations that rely on non-file scope won't be detected here.
|
||||||
# nor on FunctionName features, because pefile doesn't support this.
|
# nor on FunctionName features, because pefile doesn't support this.
|
||||||
@@ -888,7 +945,7 @@ def main(argv=None):
|
|||||||
# do show the output in verbose mode, though.
|
# do show the output in verbose mode, though.
|
||||||
if not (args.verbose or args.vverbose or args.json):
|
if not (args.verbose or args.vverbose or args.json):
|
||||||
logger.debug("file limitation short circuit, won't analyze fully.")
|
logger.debug("file limitation short circuit, won't analyze fully.")
|
||||||
return -1
|
return E_FILE_LIMITATION
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if args.format == "pe" or (args.format == "auto" and taste.startswith(b"MZ")):
|
if args.format == "pe" or (args.format == "auto" and taste.startswith(b"MZ")):
|
||||||
@@ -898,7 +955,7 @@ def main(argv=None):
|
|||||||
logger.debug("skipping library code matching: only have PE signatures")
|
logger.debug("skipping library code matching: only have PE signatures")
|
||||||
except (IOError) as e:
|
except (IOError) as e:
|
||||||
logger.error("%s", str(e))
|
logger.error("%s", str(e))
|
||||||
return -1
|
return E_INVALID_SIG
|
||||||
|
|
||||||
if (args.format == "freeze") or (args.format == "auto" and capa.features.freeze.is_freeze(taste)):
|
if (args.format == "freeze") or (args.format == "auto" and capa.features.freeze.is_freeze(taste)):
|
||||||
format = "freeze"
|
format = "freeze"
|
||||||
@@ -926,14 +983,14 @@ def main(argv=None):
|
|||||||
)
|
)
|
||||||
logger.error(" If you don't know the input file type, you can try using the `file` utility to guess it.")
|
logger.error(" If you don't know the input file type, you can try using the `file` utility to guess it.")
|
||||||
logger.error("-" * 80)
|
logger.error("-" * 80)
|
||||||
return -1
|
return E_INVALID_FILE_TYPE
|
||||||
except UnsupportedArchError:
|
except UnsupportedArchError:
|
||||||
logger.error("-" * 80)
|
logger.error("-" * 80)
|
||||||
logger.error(" Input file does not appear to target a supported architecture.")
|
logger.error(" Input file does not appear to target a supported architecture.")
|
||||||
logger.error(" ")
|
logger.error(" ")
|
||||||
logger.error(" capa currently only supports analyzing x86 (32- and 64-bit).")
|
logger.error(" capa currently only supports analyzing x86 (32- and 64-bit).")
|
||||||
logger.error("-" * 80)
|
logger.error("-" * 80)
|
||||||
return -1
|
return E_INVALID_FILE_ARCH
|
||||||
except UnsupportedOSError:
|
except UnsupportedOSError:
|
||||||
logger.error("-" * 80)
|
logger.error("-" * 80)
|
||||||
logger.error(" Input file does not appear to target a supported OS.")
|
logger.error(" Input file does not appear to target a supported OS.")
|
||||||
@@ -942,18 +999,19 @@ def main(argv=None):
|
|||||||
" capa currently only supports analyzing executables for some operating systems (including Windows and Linux)."
|
" capa currently only supports analyzing executables for some operating systems (including Windows and Linux)."
|
||||||
)
|
)
|
||||||
logger.error("-" * 80)
|
logger.error("-" * 80)
|
||||||
return -1
|
return E_INVALID_FILE_OS
|
||||||
|
|
||||||
meta = collect_metadata(argv, args.sample, args.rules, extractor)
|
meta = collect_metadata(argv, args.sample, args.rules, extractor)
|
||||||
|
|
||||||
capabilities, counts = find_capabilities(rules, extractor, disable_progress=args.quiet)
|
capabilities, counts = find_capabilities(rules, extractor, disable_progress=args.quiet)
|
||||||
meta["analysis"].update(counts)
|
meta["analysis"].update(counts)
|
||||||
|
meta["analysis"]["layout"] = compute_layout(rules, extractor, capabilities)
|
||||||
|
|
||||||
if has_file_limitation(rules, capabilities):
|
if has_file_limitation(rules, capabilities):
|
||||||
# bail if capa encountered file limitation e.g. a packed binary
|
# bail if capa encountered file limitation e.g. a packed binary
|
||||||
# do show the output in verbose mode, though.
|
# do show the output in verbose mode, though.
|
||||||
if not (args.verbose or args.vverbose or args.json):
|
if not (args.verbose or args.vverbose or args.json):
|
||||||
return -1
|
return E_FILE_LIMITATION
|
||||||
|
|
||||||
if args.json:
|
if args.json:
|
||||||
print(capa.render.json.render(meta, rules, capabilities))
|
print(capa.render.json.render(meta, rules, capabilities))
|
||||||
@@ -980,16 +1038,16 @@ def ida_main():
|
|||||||
logging.getLogger().setLevel(logging.INFO)
|
logging.getLogger().setLevel(logging.INFO)
|
||||||
|
|
||||||
if not capa.ida.helpers.is_supported_ida_version():
|
if not capa.ida.helpers.is_supported_ida_version():
|
||||||
return -1
|
return E_UNSUPPORTED_IDA_VERSION
|
||||||
|
|
||||||
if not capa.ida.helpers.is_supported_file_type():
|
if not capa.ida.helpers.is_supported_file_type():
|
||||||
return -1
|
return E_INVALID_FILE_TYPE
|
||||||
|
|
||||||
logger.debug("-" * 80)
|
logger.debug("-" * 80)
|
||||||
logger.debug(" Using default embedded rules.")
|
logger.debug(" Using default embedded rules.")
|
||||||
logger.debug(" ")
|
logger.debug(" ")
|
||||||
logger.debug(" You can see the current default rule set here:")
|
logger.debug(" You can see the current default rule set here:")
|
||||||
logger.debug(" https://github.com/fireeye/capa-rules")
|
logger.debug(" https://github.com/mandiant/capa-rules")
|
||||||
logger.debug("-" * 80)
|
logger.debug("-" * 80)
|
||||||
|
|
||||||
rules_path = os.path.join(get_default_root(), "rules")
|
rules_path = os.path.join(get_default_root(), "rules")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ example::
|
|||||||
|
|
||||||
send data
|
send data
|
||||||
namespace communication
|
namespace communication
|
||||||
author william.ballenthin@fireeye.com
|
author william.ballenthin@mandiant.com
|
||||||
description all known techniques for sending data to a potential C2 server
|
description all known techniques for sending data to a potential C2 server
|
||||||
scope function
|
scope function
|
||||||
examples BFB9B5391A13D0AFD787E87AB90F14F5:0x13145D60
|
examples BFB9B5391A13D0AFD787E87AB90F14F5:0x13145D60
|
||||||
@@ -14,7 +14,7 @@ example::
|
|||||||
0x10003415
|
0x10003415
|
||||||
0x10003797
|
0x10003797
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -193,7 +193,7 @@ def render_rules(ostream, doc):
|
|||||||
## rules
|
## rules
|
||||||
check for OutputDebugString error
|
check for OutputDebugString error
|
||||||
namespace anti-analysis/anti-debugging/debugger-detection
|
namespace anti-analysis/anti-debugging/debugger-detection
|
||||||
author michael.hunhoff@fireeye.com
|
author michael.hunhoff@mandiant.com
|
||||||
scope function
|
scope function
|
||||||
mbc Anti-Behavioral Analysis::Detect Debugger::OutputDebugString
|
mbc Anti-Behavioral Analysis::Detect Debugger::OutputDebugString
|
||||||
examples Practical Malware Analysis Lab 16-02.exe_:0x401020
|
examples Practical Malware Analysis Lab 16-02.exe_:0x401020
|
||||||
@@ -203,6 +203,11 @@ def render_rules(ostream, doc):
|
|||||||
api: kernel32.GetLastError @ 0x10004A87
|
api: kernel32.GetLastError @ 0x10004A87
|
||||||
api: kernel32.OutputDebugString @ 0x10004767, 0x10004787, 0x10004816, 0x10004895
|
api: kernel32.OutputDebugString @ 0x10004767, 0x10004787, 0x10004816, 0x10004895
|
||||||
"""
|
"""
|
||||||
|
functions_by_bb = {}
|
||||||
|
for function, info in doc["meta"]["analysis"]["layout"]["functions"].items():
|
||||||
|
for bb in info["matched_basic_blocks"]:
|
||||||
|
functions_by_bb[bb] = function
|
||||||
|
|
||||||
had_match = False
|
had_match = False
|
||||||
for rule in rutils.capability_rules(doc):
|
for rule in rutils.capability_rules(doc):
|
||||||
count = len(rule["matches"])
|
count = len(rule["matches"])
|
||||||
@@ -247,7 +252,12 @@ def render_rules(ostream, doc):
|
|||||||
for location, match in sorted(doc["rules"][rule["meta"]["name"]]["matches"].items()):
|
for location, match in sorted(doc["rules"][rule["meta"]["name"]]["matches"].items()):
|
||||||
ostream.write(rule["meta"]["scope"])
|
ostream.write(rule["meta"]["scope"])
|
||||||
ostream.write(" @ ")
|
ostream.write(" @ ")
|
||||||
ostream.writeln(rutils.hex(location))
|
ostream.write(rutils.hex(location))
|
||||||
|
|
||||||
|
if rule["meta"]["scope"] == capa.rules.BASIC_BLOCK_SCOPE:
|
||||||
|
ostream.write(" in function " + rutils.hex(functions_by_bb[location]))
|
||||||
|
|
||||||
|
ostream.write("\n")
|
||||||
render_match(ostream, match, indent=1)
|
render_match(ostream, match, indent=1)
|
||||||
ostream.write("\n")
|
ostream.write("\n")
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = "3.0.1"
|
__version__ = "3.0.3"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Installation
|
# Installation
|
||||||
You can install capa in a few different ways. First, if you simply want to use capa, just download the [standalone binary](https://github.com/fireeye/capa/releases). If you want to use capa as a Python library, you can install the package directly from GitHub using `pip`. If you'd like to contribute patches or features to capa, you can work with a local copy of the source code.
|
You can install capa in a few different ways. First, if you simply want to use capa, just download the [standalone binary](https://github.com/mandiant/capa/releases). If you want to use capa as a Python library, you can install the package directly from GitHub using `pip`. If you'd like to contribute patches or features to capa, you can work with a local copy of the source code.
|
||||||
|
|
||||||
## Method 1: Standalone installation
|
## Method 1: Standalone installation
|
||||||
If you simply want to use capa, use the standalone binaries we host on GitHub: https://github.com/fireeye/capa/releases. These binary executable files contain all the source code, Python interpreter, and associated resources needed to make capa run. This means you can run it without any installation! Just invoke the file using your terminal shell to see the help documentation.
|
If you simply want to use capa, use the standalone binaries we host on GitHub: https://github.com/mandiant/capa/releases. These binary executable files contain all the source code, Python interpreter, and associated resources needed to make capa run. This means you can run it without any installation! Just invoke the file using your terminal shell to see the help documentation.
|
||||||
|
|
||||||
We use PyInstaller to create these packages.
|
We use PyInstaller to create these packages.
|
||||||
|
|
||||||
@@ -26,8 +26,8 @@ To install capa as a Python library use `pip` to fetch the `flare-capa` module.
|
|||||||
|
|
||||||
#### *Note*:
|
#### *Note*:
|
||||||
This method is appropriate for integrating capa in an existing project.
|
This method is appropriate for integrating capa in an existing project.
|
||||||
This technique doesn't pull the default rule set, so you should check it out separately from [capa-rules](https://github.com/fireeye/capa-rules/) and pass the directory to the entrypoint using `-r` or set the rules path in the IDA Pro plugin.
|
This technique doesn't pull the default rule set, so you should check it out separately from [capa-rules](https://github.com/mandiant/capa-rules/) and pass the directory to the entrypoint using `-r` or set the rules path in the IDA Pro plugin.
|
||||||
This technique also doesn't set up the default library identification [signatures](https://github.com/fireeye/capa/tree/master/sigs). You can pass the signature directory using the `-s` argument.
|
This technique also doesn't set up the default library identification [signatures](https://github.com/mandiant/capa/tree/master/sigs). You can pass the signature directory using the `-s` argument.
|
||||||
For example, to run capa with both a rule path and a signature path:
|
For example, to run capa with both a rule path and a signature path:
|
||||||
|
|
||||||
capa -r /path/to/capa-rules -s /path/to/capa-sigs suspicious.exe
|
capa -r /path/to/capa-rules -s /path/to/capa-sigs suspicious.exe
|
||||||
@@ -44,16 +44,16 @@ If you'd like to review and modify the capa source code, you'll need to check it
|
|||||||
|
|
||||||
### 1. Check out source code
|
### 1. Check out source code
|
||||||
Next, clone the capa git repository.
|
Next, clone the capa git repository.
|
||||||
We use submodules to separate [code](https://github.com/fireeye/capa), [rules](https://github.com/fireeye/capa-rules), and [test data](https://github.com/fireeye/capa-testfiles).
|
We use submodules to separate [code](https://github.com/mandiant/capa), [rules](https://github.com/mandiant/capa-rules), and [test data](https://github.com/mandiant/capa-testfiles).
|
||||||
To clone everything use the `--recurse-submodules` option:
|
To clone everything use the `--recurse-submodules` option:
|
||||||
- CAUTION: The capa testfiles repository contains many malware samples. If you pull down everything using this method, you may want to install to a directory that won't trigger your anti-virus software.
|
- CAUTION: The capa testfiles repository contains many malware samples. If you pull down everything using this method, you may want to install to a directory that won't trigger your anti-virus software.
|
||||||
- `$ git clone --recurse-submodules https://github.com/fireeye/capa.git /local/path/to/src` (HTTPS)
|
- `$ git clone --recurse-submodules https://github.com/mandiant/capa.git /local/path/to/src` (HTTPS)
|
||||||
- `$ git clone --recurse-submodules git@github.com:fireeye/capa.git /local/path/to/src` (SSH)
|
- `$ git clone --recurse-submodules git@github.com:mandiant/capa.git /local/path/to/src` (SSH)
|
||||||
|
|
||||||
To only get the source code and our provided rules (common), follow these steps:
|
To only get the source code and our provided rules (common), follow these steps:
|
||||||
- clone repository
|
- clone repository
|
||||||
- `$ git clone https://github.com/fireeye/capa.git /local/path/to/src` (HTTPS)
|
- `$ git clone https://github.com/mandiant/capa.git /local/path/to/src` (HTTPS)
|
||||||
- `$ git clone git@github.com:fireeye/capa.git /local/path/to/src` (SSH)
|
- `$ git clone git@github.com:mandiant/capa.git /local/path/to/src` (SSH)
|
||||||
- `$ cd /local/path/to/src`
|
- `$ cd /local/path/to/src`
|
||||||
- `$ git submodule update --init rules`
|
- `$ git submodule update --init rules`
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ We use the following tools to ensure consistent code style and formatting:
|
|||||||
- [black](https://github.com/psf/black) code formatter, with `-l 120`
|
- [black](https://github.com/psf/black) code formatter, with `-l 120`
|
||||||
- [isort 5](https://pypi.org/project/isort/) code formatter, with `--profile black --length-sort --line-width 120`
|
- [isort 5](https://pypi.org/project/isort/) code formatter, with `--profile black --length-sort --line-width 120`
|
||||||
- [dos2unix](https://linux.die.net/man/1/dos2unix) for UNIX-style LF newlines
|
- [dos2unix](https://linux.die.net/man/1/dos2unix) for UNIX-style LF newlines
|
||||||
- [capafmt](https://github.com/fireeye/capa/blob/master/scripts/capafmt.py) rule formatter
|
- [capafmt](https://github.com/mandiant/capa/blob/master/scripts/capafmt.py) rule formatter
|
||||||
|
|
||||||
To install these development dependencies, run:
|
To install these development dependencies, run:
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,6 @@ We need more practical use cases and test samples to justify the additional work
|
|||||||
|
|
||||||
|
|
||||||
# ATT&CK, MAEC, MBC, and other capability tagging
|
# ATT&CK, MAEC, MBC, and other capability tagging
|
||||||
capa uses namespaces to group capabilities (see https://github.com/fireeye/capa-rules/tree/master#namespace-organization).
|
capa uses namespaces to group capabilities (see https://github.com/mandiant/capa-rules/tree/master#namespace-organization).
|
||||||
|
|
||||||
The `rule.meta` field also supports `att&ck`, `mbc`, and `maec` fields to associate rules with the respective taxonomy (see https://github.com/fireeye/capa-rules/blob/master/doc/format.md#meta-block).
|
The `rule.meta` field also supports `att&ck`, `mbc`, and `maec` fields to associate rules with the respective taxonomy (see https://github.com/mandiant/capa-rules/blob/master/doc/format.md#meta-block).
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# Release checklist
|
# Release checklist
|
||||||
|
|
||||||
- [ ] Ensure all [milestoned issues/PRs](https://github.com/fireeye/capa/milestones) are addressed, or reassign to a new milestone.
|
- [ ] Ensure all [milestoned issues/PRs](https://github.com/mandiant/capa/milestones) are addressed, or reassign to a new milestone.
|
||||||
- [ ] Add the `dont merge` label to all PRs that are close to be ready to merge (or merge them if they are ready) in [capa](https://github.com/fireeye/capa/pulls) and [capa-rules](https://github.com/fireeye/capa-rules/pulls).
|
- [ ] Add the `dont merge` label to all PRs that are close to be ready to merge (or merge them if they are ready) in [capa](https://github.com/mandiant/capa/pulls) and [capa-rules](https://github.com/mandiant/capa-rules/pulls).
|
||||||
- [ ] Ensure the [CI workflow succeeds in master](https://github.com/fireeye/capa/actions/workflows/tests.yml?query=branch%3Amaster).
|
- [ ] Ensure the [CI workflow succeeds in master](https://github.com/mandiant/capa/actions/workflows/tests.yml?query=branch%3Amaster).
|
||||||
- [ ] Ensure that `python scripts/lint.py rules/ --thorough` succeeds (only `missing examples` offenses are allowed in the nursery).
|
- [ ] Ensure that `python scripts/lint.py rules/ --thorough` succeeds (only `missing examples` offenses are allowed in the nursery).
|
||||||
- [ ] Review changes
|
- [ ] Review changes
|
||||||
- capa https://github.com/fireeye/capa/compare/\<last-release\>...master
|
- capa https://github.com/mandiant/capa/compare/\<last-release\>...master
|
||||||
- capa-rules https://github.com/fireeye/capa-rules/compare/\<last-release>\...master
|
- capa-rules https://github.com/mandiant/capa-rules/compare/\<last-release>\...master
|
||||||
- [ ] Update [CHANGELOG.md](https://github.com/fireeye/capa/blob/master/CHANGELOG.md)
|
- [ ] Update [CHANGELOG.md](https://github.com/mandiant/capa/blob/master/CHANGELOG.md)
|
||||||
- Do not forget to add a nice introduction thanking contributors
|
- Do not forget to add a nice introduction thanking contributors
|
||||||
- Remember that we need a major release if we introduce breaking changes
|
- Remember that we need a major release if we introduce breaking changes
|
||||||
- Sections: see template below
|
- Sections: see template below
|
||||||
@@ -31,13 +31,13 @@
|
|||||||
### Development
|
### Development
|
||||||
|
|
||||||
### Raw diffs
|
### Raw diffs
|
||||||
- [capa <release>...master](https://github.com/fireeye/capa/compare/<release>...master)
|
- [capa <release>...master](https://github.com/mandiant/capa/compare/<release>...master)
|
||||||
- [capa-rules <release>...master](https://github.com/fireeye/capa-rules/compare/<release>...master)
|
- [capa-rules <release>...master](https://github.com/mandiant/capa-rules/compare/<release>...master)
|
||||||
```
|
```
|
||||||
- [ ] Update [capa/version.py](https://github.com/fireeye/capa/blob/master/capa/version.py)
|
- [ ] Update [capa/version.py](https://github.com/mandiant/capa/blob/master/capa/version.py)
|
||||||
- [ ] Create a PR with the updated [CHANGELOG.md](https://github.com/fireeye/capa/blob/master/CHANGELOG.md) and [capa/version.py](https://github.com/fireeye/capa/blob/master/capa/version.py). Copy this checklist in the PR description.
|
- [ ] Create a PR with the updated [CHANGELOG.md](https://github.com/mandiant/capa/blob/master/CHANGELOG.md) and [capa/version.py](https://github.com/mandiant/capa/blob/master/capa/version.py). Copy this checklist in the PR description.
|
||||||
- [ ] After PR review, merge the PR and [create the release in GH](https://github.com/fireeye/capa/releases/new) using text from the [CHANGELOG.md](https://github.com/fireeye/capa/blob/master/CHANGELOG.md).
|
- [ ] After PR review, merge the PR and [create the release in GH](https://github.com/mandiant/capa/releases/new) using text from the [CHANGELOG.md](https://github.com/mandiant/capa/blob/master/CHANGELOG.md).
|
||||||
- [ ] Verify GH actions [upload artifacts](https://github.com/fireeye/capa/releases), [publish to PyPI](https://pypi.org/project/flare-capa) and [create a tag in capa rules](https://github.com/fireeye/capa-rules/tags) upon completion.
|
- [ ] Verify GH actions [upload artifacts](https://github.com/mandiant/capa/releases), [publish to PyPI](https://pypi.org/project/flare-capa) and [create a tag in capa rules](https://github.com/mandiant/capa-rules/tags) upon completion.
|
||||||
- [ ] [Spread the word](https://twitter.com)
|
- [ ] [Spread the word](https://twitter.com)
|
||||||
- [ ] Update internal service
|
- [ ] Update internal service
|
||||||
|
|
||||||
|
|||||||
2
rules
2
rules
Submodule rules updated: f04491001d...6481a5e82f
@@ -47,7 +47,7 @@ usage:
|
|||||||
parallelism factor
|
parallelism factor
|
||||||
--no-mp disable subprocesses
|
--no-mp disable subprocesses
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -129,6 +129,7 @@ def get_capa_results(args):
|
|||||||
meta = capa.main.collect_metadata("", path, "", extractor)
|
meta = capa.main.collect_metadata("", path, "", extractor)
|
||||||
capabilities, counts = capa.main.find_capabilities(rules, extractor, disable_progress=True)
|
capabilities, counts = capa.main.find_capabilities(rules, extractor, disable_progress=True)
|
||||||
meta["analysis"].update(counts)
|
meta["analysis"].update(counts)
|
||||||
|
meta["analysis"]["layout"] = capa.main.compute_layout(rules, extractor, capabilities)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"path": path,
|
"path": path,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ optional arguments:
|
|||||||
-t TAG, --tag TAG filter on rule meta field values
|
-t TAG, --tag TAG filter on rule meta field values
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) 2020, 2021 Arnim Rupp (@ruppde) and FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020, 2021 Arnim Rupp (@ruppde) and Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -57,8 +57,8 @@ var_names = ["".join(letters) for letters in itertools.product(string.ascii_lowe
|
|||||||
unsupported = ["characteristic", "mnemonic", "offset", "subscope", "Range"]
|
unsupported = ["characteristic", "mnemonic", "offset", "subscope", "Range"]
|
||||||
# TODO shorten this list, possible stuff:
|
# TODO shorten this list, possible stuff:
|
||||||
# - 2 or more strings: e.g.
|
# - 2 or more strings: e.g.
|
||||||
# -- https://github.com/fireeye/capa-rules/blob/master/collection/file-managers/gather-direct-ftp-information.yml
|
# -- https://github.com/mandiant/capa-rules/blob/master/collection/file-managers/gather-direct-ftp-information.yml
|
||||||
# -- https://github.com/fireeye/capa-rules/blob/master/collection/browser/gather-firefox-profile-information.yml
|
# -- https://github.com/mandiant/capa-rules/blob/master/collection/browser/gather-firefox-profile-information.yml
|
||||||
# - count(string (1 rule: /executable/subfile/pe/contain-an-embedded-pe-file.yml)
|
# - count(string (1 rule: /executable/subfile/pe/contain-an-embedded-pe-file.yml)
|
||||||
# - count(match( could be done by creating the referenced rule a 2nd time with the condition, that it hits x times (only 1 rule: ./anti-analysis/anti-disasm/contain-anti-disasm-techniques.yml)
|
# - count(match( could be done by creating the referenced rule a 2nd time with the condition, that it hits x times (only 1 rule: ./anti-analysis/anti-disasm/contain-anti-disasm-techniques.yml)
|
||||||
# - it would be technically possible to get the "basic blocks" working, but the rules contain mostly other non supported statements in there => not worth the effort.
|
# - it would be technically possible to get the "basic blocks" working, but the rules contain mostly other non supported statements in there => not worth the effort.
|
||||||
@@ -104,7 +104,7 @@ def check_feature(statement, rulename):
|
|||||||
def get_rule_url(path):
|
def get_rule_url(path):
|
||||||
path = re.sub(r"\.\.\/", "", path)
|
path = re.sub(r"\.\.\/", "", path)
|
||||||
path = re.sub(r"capa-rules\/", "", path)
|
path = re.sub(r"capa-rules\/", "", path)
|
||||||
return "https://github.com/fireeye/capa-rules/blob/master/" + path
|
return "https://github.com/mandiant/capa-rules/blob/master/" + path
|
||||||
|
|
||||||
|
|
||||||
def convert_capa_number_to_yara_bytes(number):
|
def convert_capa_number_to_yara_bytes(number):
|
||||||
@@ -176,7 +176,7 @@ def convert_rule(rule, rulename, cround, depth):
|
|||||||
elif s_type == "api" or s_type == "import":
|
elif s_type == "api" or s_type == "import":
|
||||||
# TODO: is it possible in YARA to make a difference between api & import?
|
# TODO: is it possible in YARA to make a difference between api & import?
|
||||||
|
|
||||||
# https://github.com/fireeye/capa-rules/blob/master/doc/format.md#api
|
# https://github.com/mandiant/capa-rules/blob/master/doc/format.md#api
|
||||||
api = kid.value
|
api = kid.value
|
||||||
logger.info("doing api: " + repr(api))
|
logger.info("doing api: " + repr(api))
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ def convert_rule(rule, rulename, cround, depth):
|
|||||||
yara_condition += '\tpe.exports("' + export + '") '
|
yara_condition += '\tpe.exports("' + export + '") '
|
||||||
|
|
||||||
elif s_type == "section":
|
elif s_type == "section":
|
||||||
# https://github.com/fireeye/capa-rules/blob/master/doc/format.md#section
|
# https://github.com/mandiant/capa-rules/blob/master/doc/format.md#section
|
||||||
section = kid.value
|
section = kid.value
|
||||||
logger.info("doing section: " + repr(section))
|
logger.info("doing section: " + repr(section))
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ def convert_rule(rule, rulename, cround, depth):
|
|||||||
)
|
)
|
||||||
|
|
||||||
elif s_type == "match":
|
elif s_type == "match":
|
||||||
# https://github.com/fireeye/capa-rules/blob/master/doc/format.md#matching-prior-rule-matches-and-namespaces
|
# https://github.com/mandiant/capa-rules/blob/master/doc/format.md#matching-prior-rule-matches-and-namespaces
|
||||||
match = kid.value
|
match = kid.value
|
||||||
logger.info("doing match: " + repr(match))
|
logger.info("doing match: " + repr(match))
|
||||||
|
|
||||||
@@ -717,7 +717,7 @@ def main(argv=None):
|
|||||||
return -1
|
return -1
|
||||||
|
|
||||||
output_yar(
|
output_yar(
|
||||||
"// Rules from FireEye's https://github.com/fireeye/capa-rules converted to YARA using https://github.com/fireeye/capa/blob/master/scripts/capa2yara.py by Arnim Rupp"
|
"// Rules from Mandiant's https://github.com/mandiant/capa-rules converted to YARA using https://github.com/mandiant/capa/blob/master/scripts/capa2yara.py by Arnim Rupp"
|
||||||
)
|
)
|
||||||
output_yar(
|
output_yar(
|
||||||
"// Beware: These are less rules than capa (because not all fit into YARA, stats at EOF) and is less precise because e.g. capas function scopes are applied to the whole file"
|
"// Beware: These are less rules than capa (because not all fit into YARA, stats at EOF) and is less precise because e.g. capas function scopes are applied to the whole file"
|
||||||
|
|||||||
@@ -163,14 +163,15 @@ def render_dictionary(doc):
|
|||||||
|
|
||||||
# ==== render dictionary helpers
|
# ==== render dictionary helpers
|
||||||
def capa_details(file_path, output_format="dictionary"):
|
def capa_details(file_path, output_format="dictionary"):
|
||||||
|
# collect metadata (used only to make rendering more complete)
|
||||||
|
meta = capa.main.collect_metadata("", file_path, RULES_PATH, extractor)
|
||||||
|
|
||||||
# extract features and find capabilities
|
# extract features and find capabilities
|
||||||
extractor = capa.main.get_extractor(file_path, "auto", capa.main.BACKEND_VIV, [], False, disable_progress=True)
|
extractor = capa.main.get_extractor(file_path, "auto", capa.main.BACKEND_VIV, [], False, disable_progress=True)
|
||||||
capabilities, counts = capa.main.find_capabilities(rules, extractor, disable_progress=True)
|
capabilities, counts = capa.main.find_capabilities(rules, extractor, disable_progress=True)
|
||||||
|
|
||||||
# collect metadata (used only to make rendering more complete)
|
|
||||||
meta = capa.main.collect_metadata("", file_path, RULES_PATH, extractor)
|
|
||||||
meta["analysis"].update(counts)
|
meta["analysis"].update(counts)
|
||||||
|
meta["analysis"]["layout"] = capa.main.compute_layout(rules, extractor, capabilities)
|
||||||
|
|
||||||
capa_output = False
|
capa_output = False
|
||||||
if output_format == "dictionary":
|
if output_format == "dictionary":
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Usage:
|
|||||||
|
|
||||||
$ python capafmt.py -i foo.yml
|
$ python capafmt.py -i foo.yml
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2021 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Adapted for Binary Ninja by @psifertex
|
|||||||
This script will verify that the report matches the workspace.
|
This script will verify that the report matches the workspace.
|
||||||
Check the log window for any errors, and/or the summary of changes.
|
Check the log window for any errors, and/or the summary of changes.
|
||||||
|
|
||||||
Derived from: https://github.com/fireeye/capa/blob/master/scripts/import-to-ida.py
|
Derived from: https://github.com/mandiant/capa/blob/master/scripts/import-to-ida.py
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ and then select the existing capa report from the file system.
|
|||||||
This script will verify that the report matches the workspace.
|
This script will verify that the report matches the workspace.
|
||||||
Check the output window for any errors, and/or the summary of changes.
|
Check the output window for any errors, and/or the summary of changes.
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Usage:
|
|||||||
|
|
||||||
$ python scripts/lint.py rules/
|
$ python scripts/lint.py rules/
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2021 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2021 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Example::
|
|||||||
- connect TCP socket
|
- connect TCP socket
|
||||||
...
|
...
|
||||||
|
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -87,22 +87,34 @@ def render_matches_by_function(doc):
|
|||||||
- send HTTP request
|
- send HTTP request
|
||||||
- connect to HTTP server
|
- connect to HTTP server
|
||||||
"""
|
"""
|
||||||
|
functions_by_bb = {}
|
||||||
|
for function, info in doc["meta"]["analysis"]["layout"]["functions"].items():
|
||||||
|
for bb in info["matched_basic_blocks"]:
|
||||||
|
functions_by_bb[bb] = function
|
||||||
|
|
||||||
ostream = rutils.StringIO()
|
ostream = rutils.StringIO()
|
||||||
|
|
||||||
matches_by_function = collections.defaultdict(set)
|
matches_by_function = collections.defaultdict(set)
|
||||||
for rule in rutils.capability_rules(doc):
|
for rule in rutils.capability_rules(doc):
|
||||||
for va in rule["matches"].keys():
|
if rule["meta"]["scope"] == capa.rules.FUNCTION_SCOPE:
|
||||||
matches_by_function[va].add(rule["meta"]["name"])
|
for va in rule["matches"].keys():
|
||||||
|
matches_by_function[va].add(rule["meta"]["name"])
|
||||||
|
elif rule["meta"]["scope"] == capa.rules.BASIC_BLOCK_SCOPE:
|
||||||
|
for va in rule["matches"].keys():
|
||||||
|
function = functions_by_bb[va]
|
||||||
|
matches_by_function[function].add(rule["meta"]["name"])
|
||||||
|
else:
|
||||||
|
# file scope
|
||||||
|
pass
|
||||||
|
|
||||||
for va, feature_count in sorted(doc["meta"]["analysis"]["feature_counts"]["functions"].items()):
|
for va, feature_count in sorted(doc["meta"]["analysis"]["feature_counts"]["functions"].items()):
|
||||||
va = int(va)
|
va = int(va)
|
||||||
if not matches_by_function.get(va, {}):
|
if not matches_by_function.get(va, {}):
|
||||||
continue
|
continue
|
||||||
ostream.writeln("function at 0x%X with %d features: " % (va, feature_count))
|
ostream.writeln("function at 0x%X with %d features: " % (va, feature_count))
|
||||||
for rule_name in matches_by_function[va]:
|
for rule_name in sorted(matches_by_function[va]):
|
||||||
ostream.writeln(" - " + rule_name)
|
ostream.writeln(" - " + rule_name)
|
||||||
|
|
||||||
ostream.write("\n")
|
|
||||||
return ostream.getvalue()
|
return ostream.getvalue()
|
||||||
|
|
||||||
|
|
||||||
@@ -174,6 +186,7 @@ def main(argv=None):
|
|||||||
meta = capa.main.collect_metadata(argv, args.sample, args.rules, extractor)
|
meta = capa.main.collect_metadata(argv, args.sample, args.rules, extractor)
|
||||||
capabilities, counts = capa.main.find_capabilities(rules, extractor)
|
capabilities, counts = capa.main.find_capabilities(rules, extractor)
|
||||||
meta["analysis"].update(counts)
|
meta["analysis"].update(counts)
|
||||||
|
meta["analysis"]["layout"] = capa.main.compute_layout(rules, extractor, capabilities)
|
||||||
|
|
||||||
if capa.main.has_file_limitation(rules, capabilities):
|
if capa.main.has_file_limitation(rules, capabilities):
|
||||||
# bail if capa encountered file limitation e.g. a packed binary
|
# bail if capa encountered file limitation e.g. a packed binary
|
||||||
@@ -190,8 +203,6 @@ def main(argv=None):
|
|||||||
print(render_matches_by_function(doc))
|
print(render_matches_by_function(doc))
|
||||||
colorama.deinit()
|
colorama.deinit()
|
||||||
|
|
||||||
logger.info("done.")
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
"""
|
"""
|
||||||
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
|
|||||||
28
setup.py
28
setup.py
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
|
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved.
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
# You may obtain a copy of the License at: [package root]/LICENSE.txt
|
||||||
@@ -12,13 +12,13 @@ import setuptools
|
|||||||
|
|
||||||
requirements = [
|
requirements = [
|
||||||
"tqdm==4.62.3",
|
"tqdm==4.62.3",
|
||||||
"pyyaml==5.4.1",
|
"pyyaml==6.0",
|
||||||
"tabulate==0.8.9",
|
"tabulate==0.8.9",
|
||||||
"colorama==0.4.4",
|
"colorama==0.4.4",
|
||||||
"termcolor==1.1.0",
|
"termcolor==1.1.0",
|
||||||
"wcwidth==0.2.5",
|
"wcwidth==0.2.5",
|
||||||
"ida-settings==2.1.0",
|
"ida-settings==2.1.0",
|
||||||
"viv-utils[flirt]==0.6.6",
|
"viv-utils[flirt]==0.6.7",
|
||||||
"halo==0.0.31",
|
"halo==0.0.31",
|
||||||
"networkx==2.5.1",
|
"networkx==2.5.1",
|
||||||
"ruamel.yaml==0.17.16",
|
"ruamel.yaml==0.17.16",
|
||||||
@@ -50,11 +50,11 @@ setuptools.setup(
|
|||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
author="Willi Ballenthin, Moritz Raabe",
|
author="Willi Ballenthin, Moritz Raabe",
|
||||||
author_email="william.ballenthin@mandiant.com, moritz.raabe@mandiant.com",
|
author_email="william.ballenthin@mandiant.com, moritz.raabe@mandiant.com",
|
||||||
url="https://www.github.com/fireeye/capa",
|
url="https://www.github.com/mandiant/capa",
|
||||||
project_urls={
|
project_urls={
|
||||||
"Documentation": "https://github.com/fireeye/capa/tree/master/doc",
|
"Documentation": "https://github.com/mandiant/capa/tree/master/doc",
|
||||||
"Rules": "https://github.com/fireeye/capa-rules",
|
"Rules": "https://github.com/mandiant/capa-rules",
|
||||||
"Rules Documentation": "https://github.com/fireeye/capa-rules/tree/master/doc",
|
"Rules Documentation": "https://github.com/mandiant/capa-rules/tree/master/doc",
|
||||||
},
|
},
|
||||||
packages=setuptools.find_packages(exclude=["tests"]),
|
packages=setuptools.find_packages(exclude=["tests"]),
|
||||||
package_dir={"capa": "capa"},
|
package_dir={"capa": "capa"},
|
||||||
@@ -70,19 +70,19 @@ setuptools.setup(
|
|||||||
"pytest==6.2.5",
|
"pytest==6.2.5",
|
||||||
"pytest-sugar==0.9.4",
|
"pytest-sugar==0.9.4",
|
||||||
"pytest-instafail==0.4.2",
|
"pytest-instafail==0.4.2",
|
||||||
"pytest-cov==2.12.1",
|
"pytest-cov==3.0.0",
|
||||||
"pycodestyle==2.7.0",
|
"pycodestyle==2.8.0",
|
||||||
"black==21.9b0",
|
"black==21.9b0",
|
||||||
"isort==5.9.3",
|
"isort==5.9.3",
|
||||||
"mypy==0.910",
|
"mypy==0.910",
|
||||||
"psutil==5.8.0",
|
"psutil==5.8.0",
|
||||||
# type stubs for mypy
|
# type stubs for mypy
|
||||||
"types-backports==0.1.3",
|
"types-backports==0.1.3",
|
||||||
"types-colorama==0.4.3",
|
"types-colorama==0.4.4",
|
||||||
"types-PyYAML==5.4.10",
|
"types-PyYAML==6.0.0",
|
||||||
"types-tabulate==0.8.2",
|
"types-tabulate==0.8.3",
|
||||||
"types-termcolor==1.1.1",
|
"types-termcolor==1.1.2",
|
||||||
"types-psutil==5.8.8",
|
"types-psutil==5.8.13",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
This directory contains FLIRT signatures that capa uses to identify library functions.
|
This directory contains FLIRT signatures that capa uses to identify library functions.
|
||||||
Typically, capa will ignore library functions, which reduces false positives and improves runtime.
|
Typically, capa will ignore library functions, which reduces false positives and improves runtime.
|
||||||
|
|
||||||
These FLIRT signatures were generated by FireEye using the Hex-Rays FLAIR tools such as `pcf` and `sigmake`.
|
These FLIRT signatures were generated by Mandiant using the Hex-Rays FLAIR tools such as `pcf` and `sigmake`.
|
||||||
FireEye generated the signatures from source data that they collected; these signatures are not derived from the FLIRT signatures distributed with IDA Pro.
|
Mandiant generated the signatures from source data that they collected; these signatures are not derived from the FLIRT signatures distributed with IDA Pro.
|
||||||
|
|
||||||
The signatures in this directory have the same license as capa: Apache 2.0.
|
The signatures in this directory have the same license as capa: Apache 2.0.
|
||||||
|
|||||||
Submodule tests/data updated: 2ae9357e0d...3e8e54af45
@@ -182,6 +182,8 @@ def get_data_path_by_name(name):
|
|||||||
return os.path.join(CD, "data", "kernel32.dll_")
|
return os.path.join(CD, "data", "kernel32.dll_")
|
||||||
elif name == "kernel32-64":
|
elif name == "kernel32-64":
|
||||||
return os.path.join(CD, "data", "kernel32-64.dll_")
|
return os.path.join(CD, "data", "kernel32-64.dll_")
|
||||||
|
elif name == "pma01-01":
|
||||||
|
return os.path.join(CD, "data", "Practical Malware Analysis Lab 01-01.dll_")
|
||||||
elif name == "pma12-04":
|
elif name == "pma12-04":
|
||||||
return os.path.join(CD, "data", "Practical Malware Analysis Lab 12-04.exe_")
|
return os.path.join(CD, "data", "Practical Malware Analysis Lab 12-04.exe_")
|
||||||
elif name == "pma16-01":
|
elif name == "pma16-01":
|
||||||
@@ -234,6 +236,8 @@ def get_sample_md5_by_name(name):
|
|||||||
return "56bed8249e7c2982a90e54e1e55391a2"
|
return "56bed8249e7c2982a90e54e1e55391a2"
|
||||||
elif name == "pma16-01":
|
elif name == "pma16-01":
|
||||||
return "7faafc7e4a5c736ebfee6abbbc812d80"
|
return "7faafc7e4a5c736ebfee6abbbc812d80"
|
||||||
|
elif name == "pma01-01":
|
||||||
|
return "290934c61de9176ad682ffdd65f0a669"
|
||||||
elif name == "pma21-01":
|
elif name == "pma21-01":
|
||||||
return "c8403fb05244e23a7931c766409b5e22"
|
return "c8403fb05244e23a7931c766409b5e22"
|
||||||
elif name == "al-khaser x86":
|
elif name == "al-khaser x86":
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ def test_main_non_ascii_filename(pingtaest_extractor, tmpdir, capsys):
|
|||||||
|
|
||||||
def test_main_non_ascii_filename_nonexistent(tmpdir, caplog):
|
def test_main_non_ascii_filename_nonexistent(tmpdir, caplog):
|
||||||
NON_ASCII_FILENAME = "täst_not_there.exe"
|
NON_ASCII_FILENAME = "täst_not_there.exe"
|
||||||
assert capa.main.main(["-q", NON_ASCII_FILENAME]) == -1
|
assert capa.main.main(["-q", NON_ASCII_FILENAME]) == capa.main.E_MISSING_FILE
|
||||||
|
|
||||||
assert NON_ASCII_FILENAME in caplog.text
|
assert NON_ASCII_FILENAME in caplog.text
|
||||||
|
|
||||||
@@ -375,3 +375,13 @@ def test_backend_option(capsys):
|
|||||||
std_json = json.loads(std.out)
|
std_json = json.loads(std.out)
|
||||||
assert std_json["meta"]["analysis"]["extractor"] == "SmdaFeatureExtractor"
|
assert std_json["meta"]["analysis"]["extractor"] == "SmdaFeatureExtractor"
|
||||||
assert len(std_json["rules"]) > 0
|
assert len(std_json["rules"]) > 0
|
||||||
|
|
||||||
|
|
||||||
|
def test_json_meta(capsys):
|
||||||
|
path = fixtures.get_data_path_by_name("pma01-01")
|
||||||
|
assert capa.main.main([path, "-j"]) == 0
|
||||||
|
std = capsys.readouterr()
|
||||||
|
std_json = json.loads(std.out)
|
||||||
|
# remember: json can't have integer keys :-(
|
||||||
|
assert str(0x10001010) in std_json["meta"]["analysis"]["layout"]["functions"]
|
||||||
|
assert 0x10001179 in std_json["meta"]["analysis"]["layout"]["functions"][str(0x10001010)]["matched_basic_blocks"]
|
||||||
|
|||||||
Reference in New Issue
Block a user