refactor: small fix

This commit is contained in:
Dobin
2024-02-03 22:38:44 +00:00
parent 466cf11d82
commit ae859766c1
+10 -7
View File
@@ -39,11 +39,12 @@ options_default = {
} }
# VERIFY
# This will verify if our loader works # This will verify if our loader works
# - Use it on a "target" machine # - Use it on a "target" machine
# - payload shellcode will create a file c:\temp\a # - payload shellcode will create a file c:\temp\a
# - set: verify=True # - set: verify=True
options_test = { options_verify = {
"payload": "shellcodes/createfile.bin", "payload": "shellcodes/createfile.bin",
"verify": True, "verify": True,
@@ -66,7 +67,7 @@ options_test = {
} }
options = options_test options = options_verify
def main(): def main():
@@ -89,14 +90,15 @@ def main():
# SGN seems buggy atm # SGN seems buggy atm
#if options["obfuscate_shc_loader"]: #if options["obfuscate_shc_loader"]:
# obfuscate_shc_loader("main-clean.bin", "main-clean-sgn.bin") # obfuscate_shc_loader("main-clean.bin", "main-clean.bin")
# #
# if options["test_obfuscated_shc"]: # if options["verify"]:
# test_shellcode("main-clean-sgn.bin") # if not verify_shellcode("main-clean.bin"):
# return
if options["dataref_style"] == DataRefStyle.APPEND: if options["dataref_style"] == DataRefStyle.APPEND:
with open("main-clean.bin", 'rb') as input1: with open("main-clean.bin", 'rb') as input1:
data_stager = remove_trailing_null_bytes(input1.read()) data_stager = input1.read()
with open(options["payload"], 'rb') as input2: with open(options["payload"], 'rb') as input2:
data_payload = input2.read() data_payload = input2.read()
@@ -112,7 +114,8 @@ def main():
if options["verify"]: if options["verify"]:
print("--[ Verify final shellcode ]") print("--[ Verify final shellcode ]")
verify_shellcode("main-clean-append.bin") if not verify_shellcode("main-clean-append.bin"):
return
if options["exec_final_shellcode"]: if options["exec_final_shellcode"]:
print("--[ Test Append shellcode ]") print("--[ Test Append shellcode ]")