this program injects a binary payload into a given process, identified by its (you guessed it) Process ID which needs to be passed to the program as an argument. quick rundown of how the program functions:
- open a handle to the provided process using the PID (with all_access, i know it's a huge red flag but i thought it was good enough for a demonstration)
- open a handle to wininet
- open a handle with the URL of the specified payload
- allocate memory for a temporary buffer (1024 bytes)
- read the payload
- save read data to the temporary buffer (max of 1024 bytes)
- record the amount of bytes read
- set size value for the final buffer
- allocate memory for the final buffer, the amount of memory allocated to the final buffer is determined by the amount of bytes read by InternetReadFile()
- Decrypt the downloaded payload
- write contents of the temporary buffer to the final buffer
- copy the final payload buffer to a new variable *
- copy the size of the payload buffer to a new variable as well *
- clean up
- allocate memory in the memory space of the specified process
- write the payload to the previously allocated memory
- create a thread to run the payload
- wait until created thread completes execution
- clean up and exit
to be able to compile this you will need to add wininet.lib to your build configuration:
- open your solution's properties
- go to Linker -> input
- append this
;wininet.lib
to the end of theAdditional Dependencies
field
this lets the application build properly, though who knows maybe it's included in the .sln file and this works as long as you clone this repo. Visual Studio is weird.
wininet.lib
also needs to be imported if you are using CLion, however if you use CLion I assume I don't need to tell you how to do this.
discord: notsido
telegram: notsido
you can shit on my programming skills here