forked from EmpireProject/Empire
-
-
Notifications
You must be signed in to change notification settings - Fork 595
/
Copy pathpyproject.toml
160 lines (145 loc) · 4.91 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[tool.poetry]
name = "empire-bc-security-fork"
version = "6.0.0"
description = ""
authors = ["BC Security <[email protected]>"]
readme = "README.md"
homepage = "https://github.com/BC-SECURITY/Empire"
repository = "https://github.com/BC-SECURITY/Empire.git"
packages = [
{ include = "empire.py" },
{ include = "empire/server/**/*.py" },
]
[tool.poetry.dependencies]
python = ">=3.13,<3.14"
urllib3 = "^2.3.0"
requests = "^2.32.3"
macholib = "^1.16.3"
pyOpenSSL = "^25.0.0"
zlib_wrapper = "^0.1.3"
jinja2 = "^3.1.6"
pyparsing = "^3.2.1"
PyMySQL = "^1.1.1"
SQLAlchemy = "^2.0.39"
PyYAML = "^6.0.2"
SQLAlchemy-Utc = "^0.14.0"
terminaltables = "^3.1.10"
pycryptodome = "^3.22.0"
cryptography = "^44.0.2"
fastapi = "^0.115.11"
uvicorn = "^0.34.0"
jq = "^1.8.0"
aiofiles = "^24.1.0"
python-multipart = "^0.0.20"
python-jose = {version = "^3.4.0", extras = ["cryptography"]}
passlib = {version = "^1.7.4", extras = ["bcrypt"]}
python-socketio = "^5.12.1"
Flask = "^3.1.0"
pysecretsocks = {git = "https://github.com/BC-SECURITY/PySecretSOCKS.git", rev = "da5be0e"}
donut-shellcode = { version = "^1.1", markers = "platform_machine == 'x86_64' or platform_machine == 'amd64'" }
python-obfuscator = "^0.0.2"
pyinstaller = "^6.12.0"
packaging = "^24.2"
netaddr = "^1.3.0"
bcrypt = "4.0.1" # Locked to 4.0.1 due to passlib no longer being updated https://github.com/pyca/bcrypt/issues/684
requests-file = "^2.1.0"
[tool.poetry.group.dev.dependencies]
httpx = "^0.28.1" # For starlette TestClient
pytest = "^8.3.5"
pytest-timeout = "^2.3.1"
ruff = "^0.11.2"
pytest-cov = "^6.0.0"
coverage = {version = "^7.7.1", extras = ["toml"]}
pytest-env = "^1.1.5"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
extend-exclude = [
'empire/server/data',
'empire/server/downloads',
# This file is a pain to untangle for some of the linting rules
# it is from a 3rd party library, and its mostly untested.
'empire/server/common/malleable',
"empire/server/Empire-Compiler"
]
target-version = "py313"
[tool.ruff.lint]
# Will revisit line lengths later. Black won't format the strings and comments
# by default. And the experimental flag still has some issues.
# fixes right now: https://github.com/psf/black/issues/2188
extend-ignore = ["E501"]
select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
# "C90", # mccabe
"I", # isort
"UP", # pyupgrade
# "S", # flake8-bandit
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"PT", # flake8-pytest-style
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TC", # flake8-type-checking
# "ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
# "ERA", # eradicate
"PLC", # pylint-convention
"PLE", # pylint-error
"PLW", # pylint-warning
"PLR", # pylint-refactor
# "TRY", # tryceratops
"FAST", # fastapi
# "PERF", # perflint
"FURB", # refurb
"RUF", # ruff
]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = ["fastapi.Depends", "fastapi.params.Depends", "fastapi.Query", "fastapi.params.Query", "fastapi.File"]
[tool.ruff.lint.per-file-ignores]
# PLR, PLW: Each individual stager, listener, and module lacks tests, so it is not worth the
# risk to manually refactor them until there are tests in place for them.
# PTH: Excluded some files with lower test coverage for PTH so we can enable it for
# the rest of the files and incrementally increase the coverage.
"empire/server/listeners/*" = ["PTH", "PLR0911", "PLR0912", "PLR0913", "PLR0915", "PLR2004", "PLW2901"]
"empire/server/stagers/*" = ["PTH", "PLR0911", "PLR0912", "PLR0915"]
"empire/server/modules/*" = ["PTH", "PLR0911", "PLR0912", "PLR0913", "PLR0915"]
"empire/server/utils/bof_packer.py" = ["PTH"]
"empire/server/core/stager_generation_service.py" = ["PTH"]
"empire/server/core/agent_communication_service.py" = ["PTH"]
"empire/server/core/go.py" = ["PTH"]
# It's hard to limit arguments on the endpoint functions.
"empire/server/api/*" = ["PLR0913"]
"empire/server/listeners/http_malleable.py" = ["SLF"]
# Can't control how many fixtures are needed for the tests.
"empire/test/*" = ["PLR0913", "S", "SLF"]
"empire/server/modules/powershell/persistence/elevated/schtasks.py" = ["PLR2004"]
"empire/server/modules/powershell/persistence/elevated/wmi.py" = ["PLR2004"]
"empire/server/modules/powershell/persistence/elevated/wmi_updater.py" = ["PLR2004"]
[tool.coverage.run]
omit = [
"empire/server/data/**",
"empire/test/**",
]
[tool.coverage.report]
# https://coverage.readthedocs.io/en/latest/config.html
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
omit = [
"empire/server/data/**",
"empire/test/**",
]
ignore_errors = true