posixath


Nameposixath JSON
Version 0.0.5 PyPI version JSON
download
home_page
SummaryA suite of tools for simulating MITRE ATT&CK techniques for Linux and macOS
upload_time2024-01-16 22:37:25
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords att&ck mitre atomic posix
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Install instructions
To install the Posix Atomic Test Harness simply run
```python
pipenv install posixath
```

or 

```python
pip install posixath
```
then follow the instructions below for how to run the tests

# Running the tests (simple)
The `posixath` package contains all the code necessary to run myriad attack techniques for both Linux and macOS. Below are a few examples of how to run the various tests. For more information run. If you want more examples of how to run very specific tests please refer to the documentation for that specific technique.
```python
python -m posixath --help
```

## Viewing available tests
To view the available tests run 
```python
python -m posixath [linux|macos] --list
```

## Running a specific attack technique
To run a specific attack technique you need to specify the platform and the technique as follows
```python
python -m posixath linux -t T1018
```
or for macOS
```python
python -m posixath macos -t T1059
```

# Documentation
We use a variation on `mkdocs` for our documentation. All of the documentation is housed in the docs folder of the repo. They are markdown files and so can be easily viewed in github or in any standard markdown viewer. You can also use the python library `mkdocs-material` to generate a more friendly local web view of the documentation. To do so make sure you have the dev dependencies listed in the Pipfile installed. Then run `mkdocs serve` from the root directly. This will create a web server that listens on localhost and provides a nice web UI for viewing the documenation.

# Dependencies
## Linux
Some test require that the user be `root` in order to run. 

Below is a list of packages required for being able to run the posix tests
### Ubuntu
```bash
$ sudo apt-get install libcap-dev
```

### Fedora
```bash
$ sudo dnf install libcap-devel
```

# Advanced Usage
You can use the Posix Atomic Test Harnesses directly from the code base as well. The following instructions will walk you through
how to setup your environment so that you can run the tests directly from the source. Running tests this way allows you to use any
tools that operate with `pytest` itself.

## pytest runner
Pytest is used as our test runner to execute various Atomic Test Harness tests. In order to prepare your environment please run:

```python
pipenv install
pipenv shell
pytest -k [linux|macos] -v
```
> NOTE: If you don't have `pipenv` installed please see the guide [here](https://pipenv.pypa.io/en/latest/install/)

### Running the tests
The tests can be run two different ways. The first is by cloning the repo and calling directly into pytest. The second is by installing the code base from PyPi.

### Enumerate the different types of tests that can be run
`pytest --co`

### Enumerate the various command line parameters
`pytest --help` and look for the custom options section

or

`pytest --fixtures`

### Enumerate the different types of linux tests
`pytest -v -m linux --co`

### Enumerate the different types of macOS tests
`pytest -v -m macos --co`

### Enumerate attack variations for a given technique
`pytest -v -m linux -k T1548_001 --co`

### Run all linux tests
`pytest -v tests/linux`

or

`pytest -v -m linux`

### Run all macOS tests
`pytest -v tests/macos`

or

`pytest -v -m macos`

### Run a specific attack type for linux
`pytest -v -m linux -k T1548_001`

### Run a specific attack type variation for linux
`pytest -v -m linux -k T1548_001 -k chmod`

### Run a specific attack type for macOS
`pytest -v -m macos -k T1018`

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "posixath",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "ATT&CK,MITRE,atomic,posix",
    "author": "",
    "author_email": "Redcanary <research@redcanary.com>",
    "download_url": "https://files.pythonhosted.org/packages/c4/92/27d69a221bf5768becda96ab237056a5b683b062ca0748119f0ea6845908/posixath-0.0.5.tar.gz",
    "platform": null,
    "description": "# Install instructions\nTo install the Posix Atomic Test Harness simply run\n```python\npipenv install posixath\n```\n\nor \n\n```python\npip install posixath\n```\nthen follow the instructions below for how to run the tests\n\n# Running the tests (simple)\nThe `posixath` package contains all the code necessary to run myriad attack techniques for both Linux and macOS. Below are a few examples of how to run the various tests. For more information run. If you want more examples of how to run very specific tests please refer to the documentation for that specific technique.\n```python\npython -m posixath --help\n```\n\n## Viewing available tests\nTo view the available tests run \n```python\npython -m posixath [linux|macos] --list\n```\n\n## Running a specific attack technique\nTo run a specific attack technique you need to specify the platform and the technique as follows\n```python\npython -m posixath linux -t T1018\n```\nor for macOS\n```python\npython -m posixath macos -t T1059\n```\n\n# Documentation\nWe use a variation on `mkdocs` for our documentation. All of the documentation is housed in the docs folder of the repo. They are markdown files and so can be easily viewed in github or in any standard markdown viewer. You can also use the python library `mkdocs-material` to generate a more friendly local web view of the documentation. To do so make sure you have the dev dependencies listed in the Pipfile installed. Then run `mkdocs serve` from the root directly. This will create a web server that listens on localhost and provides a nice web UI for viewing the documenation.\n\n# Dependencies\n## Linux\nSome test require that the user be `root` in order to run. \n\nBelow is a list of packages required for being able to run the posix tests\n### Ubuntu\n```bash\n$ sudo apt-get install libcap-dev\n```\n\n### Fedora\n```bash\n$ sudo dnf install libcap-devel\n```\n\n# Advanced Usage\nYou can use the Posix Atomic Test Harnesses directly from the code base as well. The following instructions will walk you through\nhow to setup your environment so that you can run the tests directly from the source. Running tests this way allows you to use any\ntools that operate with `pytest` itself.\n\n## pytest runner\nPytest is used as our test runner to execute various Atomic Test Harness tests. In order to prepare your environment please run:\n\n```python\npipenv install\npipenv shell\npytest -k [linux|macos] -v\n```\n> NOTE: If you don't have `pipenv` installed please see the guide [here](https://pipenv.pypa.io/en/latest/install/)\n\n### Running the tests\nThe tests can be run two different ways. The first is by cloning the repo and calling directly into pytest. The second is by installing the code base from PyPi.\n\n### Enumerate the different types of tests that can be run\n`pytest --co`\n\n### Enumerate the various command line parameters\n`pytest --help` and look for the custom options section\n\nor\n\n`pytest --fixtures`\n\n### Enumerate the different types of linux tests\n`pytest -v -m linux --co`\n\n### Enumerate the different types of macOS tests\n`pytest -v -m macos --co`\n\n### Enumerate attack variations for a given technique\n`pytest -v -m linux -k T1548_001 --co`\n\n### Run all linux tests\n`pytest -v tests/linux`\n\nor\n\n`pytest -v -m linux`\n\n### Run all macOS tests\n`pytest -v tests/macos`\n\nor\n\n`pytest -v -m macos`\n\n### Run a specific attack type for linux\n`pytest -v -m linux -k T1548_001`\n\n### Run a specific attack type variation for linux\n`pytest -v -m linux -k T1548_001 -k chmod`\n\n### Run a specific attack type for macOS\n`pytest -v -m macos -k T1018`\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A suite of tools for simulating MITRE ATT&CK techniques for Linux and macOS",
    "version": "0.0.5",
    "project_urls": {
        "Documentation": "https://github.com/redcanaryco/AtomicTestHarnesses/wiki/Getting-started-on-MacOS-and-Linux",
        "Issues": "https://github.com/redcanaryco/AtomicTestHarnesses/issues",
        "Source": "https://github.com/redcanaryco/AtomicTestHarnesses/tree/master/posix"
    },
    "split_keywords": [
        "att&ck",
        "mitre",
        "atomic",
        "posix"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95b767eb62e710388a961f50a6165ad48fbc91ae497c8b520540fe41b631a7f2",
                "md5": "f239f50d37b6d903dd5de0585a3486ab",
                "sha256": "ad08f7ef234cc306d3e24c4814c4802b6c4f6606bfbc69b472be5e991f6ae89f"
            },
            "downloads": -1,
            "filename": "posixath-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f239f50d37b6d903dd5de0585a3486ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 42406,
            "upload_time": "2024-01-16T22:37:23",
            "upload_time_iso_8601": "2024-01-16T22:37:23.932789Z",
            "url": "https://files.pythonhosted.org/packages/95/b7/67eb62e710388a961f50a6165ad48fbc91ae497c8b520540fe41b631a7f2/posixath-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c49227d69a221bf5768becda96ab237056a5b683b062ca0748119f0ea6845908",
                "md5": "b06b61e42079e9ab9bc78e06f7a4bdc9",
                "sha256": "2465d8d773f1f3b8d8a2eead386af083db50bf6b859992abd819f62eacdca1ce"
            },
            "downloads": -1,
            "filename": "posixath-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b06b61e42079e9ab9bc78e06f7a4bdc9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 68858,
            "upload_time": "2024-01-16T22:37:25",
            "upload_time_iso_8601": "2024-01-16T22:37:25.381110Z",
            "url": "https://files.pythonhosted.org/packages/c4/92/27d69a221bf5768becda96ab237056a5b683b062ca0748119f0ea6845908/posixath-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 22:37:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "redcanaryco",
    "github_project": "AtomicTestHarnesses",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "posixath"
}
        
Elapsed time: 0.17233s