Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process Injection Tasks #253

Merged
merged 3 commits into from
Feb 24, 2021
Merged

Process Injection Tasks #253

merged 3 commits into from
Feb 24, 2021

Conversation

salu90
Copy link

@salu90 salu90 commented Sep 30, 2020

Adds three new Tasks that leverage the SharpsSploit.Execution.Injection namespace. Tasks names include "ProcessInjection" because otherwise they just don't work properly (#252).

  • ProcessInjectionRemote: Uses the SectionMapAlloc allocation technique to copy the payload into the user-specified PID and executes it using any of the available options in the RemoteThreadCreate execution technique (NtCreateThreadEx, RtlCreateUserThread, CreateRemoteThread).

ProcessInjectionRemote [ExecutionTechnique] [ProcessID] [PICpayload]
ProcessInjectionRemote CreateRemoteThread 1234 grunt.bin

  • ProcessInjectionLocal: Uses the SectionMapAlloc allocation technique to copy the payload into the current process and executes it using a delegate (like the Shellcode task but using SectionMapAlloc :P)

ProcessInjectionLocal [PICpayload]
ProcessInjectionLocal meterpreterx64.bin

meterpreter

  • ProcessInjectionSpawn: Spawns a new user-specified process and uses the SectionMapAlloc allocation technique to copy the payload. The payload is then executed using any of the available options in the RemoteThreadCreate execution technique (NtCreateThreadEx, RtlCreateUserThread, CreateRemoteThread). Supports Parent Process Spoofing (PPID) and the BlockDLLs attribute.

ProcessInjectionSpawn [ExecutionTechnique] [Binary] [PICpayload] (ParentPID) (BlockDLL)
ProcessInjectionSpawn CreateRemoteThread C:\windows\system32\notepad.exe beaconx64.bin
ProcessInjectionSpawn CreateRemoteThread C:\windows\system32\notepad.exe beaconx64.bin 5523 true

blockDLL

PPID

Tasks code has been adapted from the workshop Ryan Cobb did at Black Hat Arsenal USA 2020.
Thanks to @fuzzysec and @TheRealWover for the process injection additions.

These tasks require cobbr/SharpSploit#64 to be merged.

@cobbr cobbr changed the base branch from master to dev February 23, 2021 19:42
@cobbr cobbr merged commit c653aa8 into cobbr:dev Feb 24, 2021
@cobbr
Copy link
Owner

cobbr commented Feb 24, 2021

Thanks for getting the ball rolling on this @salu90 . For now, I've combined a couple of these tasks into one "Inject" task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants