integrated everything into provision

This commit is contained in:
2026-08-23 23:18:05 +02:00
parent 36b88cd17d
commit 5bb2b86887
2 changed files with 31 additions and 48 deletions

View File

@@ -95,6 +95,35 @@ def downloaded_program_lines(name: str, destination: str) -> list[str]:
]
def metaxploit_lines() -> list[str]:
return [
'metaxploit_lib = cp.File(home + "/metaxploit.so")',
"if not metaxploit_lib then",
'\tprint("Missing metaxploit.so")',
"else",
'\tmetaxploit_lib.copy(home + "/guest", "metaxploit.so")',
'\tmetaxploit_guest = cp.File(home + "/guest/metaxploit.so")',
"\tif not metaxploit_guest then",
'\t\tprint("Failed to copy metaxploit.so to guest")',
"\telse",
'\t\tmetaxploit_guest.set_group("guest")',
'\t\tmetaxploit_guest.set_owner("guest")',
'\t\tmetaxploit_guest.chmod("u+rwx,g+rx,o+rx")',
"\tend if",
'\tmetaxploit_lib.move("/lib", "metaxploit.so")',
'\tmetaxploit_lib = cp.File("/lib/metaxploit.so")',
"\tif not metaxploit_lib then",
'\t\tprint("Failed to install metaxploit.so")',
"\telse",
'\t\tmetaxploit_lib.set_group("root")',
'\t\tmetaxploit_lib.set_owner("root")',
'\t\tmetaxploit_lib.chmod("u+rw,g+rw,o+rw")',
"\tend if",
"end if",
"",
]
def build_provision() -> str:
sources = source_files()
if not sources:
@@ -127,6 +156,8 @@ def build_provision() -> str:
for name in DOWNLOADED_EXECUTABLES:
output.extend(downloaded_program_lines(name, "/usr/bin"))
output.extend(metaxploit_lines())
bbuild = sources[0]
bbuild_var = variable_name(bbuild)
output.extend(