mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
feature: createfile shellcode verification
This commit is contained in:
+37
-4
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user