feature: createfile shellcode verification

This commit is contained in:
Dobin
2024-02-03 14:43:21 +00:00
parent c37e4a577b
commit 508799cdc9
7 changed files with 160 additions and 22 deletions
+37 -4
View File
@@ -20,8 +20,9 @@ class DataRefStyle(Enum):
APPEND = 1
options = {
options_default = {
"payload": "shellcodes/calc64.bin",
"verify": False,
"cleanup_files_on_start": True,
"generate_asm_from_c": True,
@@ -29,6 +30,7 @@ options = {
"test_loader_shellcode": False,
"obfuscate_shc_loader": False,
"test_obfuscated_shc": False,
"exec_final_shellcode": True,
"alloc_style": AllocStyle.RWX,
"exec_style": ExecStyle.CALL,
@@ -37,6 +39,31 @@ options = {
}
# This will verify if our loader works
# - Use it on a "target" machine
# - payload shellcode will create a file c:\temp\a
# - set: verify=True
options_test = {
"payload": "shellcodes/createfile.bin",
"verify": True,
"cleanup_files_on_start": True,
"generate_asm_from_c": True,
"generate_shc_from_asm": True,
"test_loader_shellcode": False,
"obfuscate_shc_loader": False,
"test_obfuscated_shc": False,
"exec_final_shellcode": False,
"alloc_style": AllocStyle.RWX,
"exec_style": ExecStyle.CALL,
"copy_style": CopyStyle.SIMPLE,
"dataref_style": DataRefStyle.APPEND
}
options = options_test
def main():
print("Super Mega")
@@ -67,14 +94,20 @@ def main():
with open(options["payload"], 'rb') as input2:
data_payload = input2.read()
print("---[ Stager: {} Shellcode: {} ]".format(len(data_stager), len(data_payload)))
print("--[ Stager: {} Shellcode: {} (both: {})]".format(
len(data_stager), len(data_payload), len(data_stager)+len(data_payload)))
with open("main-clean-append.bin", 'wb') as output:
output.write(data_stager)
output.write(data_payload)
print("--[ Test Append shellcode ]")
test_shellcode("main-clean-append.bin")
if options["verify"]:
print("--[ Verify final shellcode ]")
verify_shellcode("main-clean-append.bin")
if options["exec_final_shellcode"]:
print("--[ Test Append shellcode ]")
test_shellcode("main-clean-append.bin")
if __name__ == "__main__":