All Projects → peperunas → Injectopi

peperunas / Injectopi

Licence: mit
A set of tutorials about code injection for Windows.

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Injectopi

Vac Hooks
Hook WinAPI functions used by Valve Anti-Cheat. Log calls and intercept arguments & return values. DLL written in C.
Stars: ✭ 103 (-56.54%)
Mutual labels:  winapi, reverse-engineering
Medfusion 4000 Research
Medfusion 4000 security research & a MQX RCE.
Stars: ✭ 331 (+39.66%)
Mutual labels:  exploitation, reverse-engineering
Idacyber
Data Visualization Plugin for IDA Pro
Stars: ✭ 244 (+2.95%)
Mutual labels:  exploitation, reverse-engineering
Subaru Starlink Research
Subaru StarLink persistent root code execution.
Stars: ✭ 432 (+82.28%)
Mutual labels:  exploitation, reverse-engineering
Write Ups
📚 VoidHack CTF write-ups
Stars: ✭ 45 (-81.01%)
Mutual labels:  exploitation, reverse-engineering
Rizin
UNIX-like reverse engineering framework and command-line toolset.
Stars: ✭ 673 (+183.97%)
Mutual labels:  exploitation, reverse-engineering
Pwndra
A collection of pwn/CTF related utilities for Ghidra
Stars: ✭ 417 (+75.95%)
Mutual labels:  exploitation, reverse-engineering
Samsung Trustzone Research
Reverse-engineering tools and exploits for Samsung's implementation of TrustZone
Stars: ✭ 85 (-64.14%)
Mutual labels:  exploitation, reverse-engineering
Magisk Frida
🔐 Run frida-server on boot with Magisk, always up-to-date
Stars: ✭ 144 (-39.24%)
Mutual labels:  exploitation, reverse-engineering
Awesome Reverse Engineering
Reverse Engineering Resources About All Platforms(Windows/Linux/macOS/Android/iOS/IoT) And Every Aspect! (More than 3500 open source tools and 2300 posts&videos)
Stars: ✭ 2,954 (+1146.41%)
Mutual labels:  reverse-engineering
Uofw
The unofficial Official FirmWare, a complete latest PSP firmware reverse engineering project
Stars: ✭ 230 (-2.95%)
Mutual labels:  reverse-engineering
Librw
A re-implementation of the RenderWare Graphics engine
Stars: ✭ 223 (-5.91%)
Mutual labels:  reverse-engineering
Fhex
A Full-Featured HexEditor compatible with Linux/Windows/MacOS
Stars: ✭ 225 (-5.06%)
Mutual labels:  reverse-engineering
Dmg Cpu Inside
Reverse-engineered schematics for DMG-CPU-B
Stars: ✭ 230 (-2.95%)
Mutual labels:  reverse-engineering
Shellab
Linux and Windows shellcode enrichment utility
Stars: ✭ 225 (-5.06%)
Mutual labels:  exploitation
Commix
Automated All-in-One OS Command Injection Exploitation Tool.
Stars: ✭ 3,016 (+1172.57%)
Mutual labels:  exploitation
Vscode Frida
Unofficial frida extension for VSCode
Stars: ✭ 221 (-6.75%)
Mutual labels:  reverse-engineering
Kaitai struct
Kaitai Struct: declarative language to generate binary data parsers in C++ / C# / Go / Java / JavaScript / Lua / Perl / PHP / Python / Ruby
Stars: ✭ 2,736 (+1054.43%)
Mutual labels:  reverse-engineering
Sniffrom
A tool for passive data capture and reconnaissance of serial flash chips. It is used in conjunction with a Saleae logic analyzer to reconstruct flash memory contents and extract contextual information about device operations.
Stars: ✭ 234 (-1.27%)
Mutual labels:  reverse-engineering
Senseye
Dynamic Visual Debugging / Reverse Engineering Toolsuite
Stars: ✭ 234 (-1.27%)
Mutual labels:  reverse-engineering

Say Thanks!

What is this?

Injectopi is a set of tutorials that I've decided to write down in order to learn about various injection techniques in the Windows' environment. The idea came to my mind when I noticed these awesome sources by Hasherezade.

Why "Injectopi"?

Here is what I thought:

"Is there anything better than a mighty animal with multiple arms swinging poisonous pointy weapons?"

Getting Started

This tutorial shows how you can create a program that, when run, will inject code into an existing process. We will show multiple techniques of increasing complexity discovered by security researchers and malware coders. It has to be noted that these list is not complete as it only shows the main techniques!

Techniques overview

Name Description Main WINAPI
CreatePatched Spawns a benign process with its Entrypoint patched with a shellcode CreateProcess, VirtualProtectEx, ReadProcessMemory
CreateSection Creates a new executable section, containing a shellcode, in an existing process CreateProcess, ZwCreateSection, NtMapViewOfSection, ZwCreateThreadEx
CreateSectionAPC Same as CreateSection: this time asynchronous procedure calls will be used. CreateProcess, ZwCreateSection, NtMapViewOfSection, NtQueueApcThread
FullCopy Allocates an executable memory region in an existing process and copies itself in that region ZwCreateSection, NtMapViewOfSection

Requisites

If you want to compile each binary it is suggested to use:

  • Visual Studio 2017 (Community will suffice)
  • Windows 7+

Building

Just open Injectopi.sln with Visual Studio!

Visual Studio 2017

Make sure to have the Desktop C++ x86 and x64 components enabled with your Visual Studio installation!

You should be ready to go!

What are you running with that shellcode?

I have commented what the shellcode does in the file SHELLCODE.md.

Further reading

Here below you can find a list of interesting articles / websites / papers which I found useful while writing down Injectopi!

ReactOS

From their website:

Imagine running your favorite Windows applications and drivers in an open-source environment you can trust. That's ReactOS. Not just an Open but also a Free operating system.

ReactOS is an awesome project which aims at open-sourcing the Windows OS by reverse engineering it. The documentation you find on their website is pure gold.

Windows shellcoding

skape's "Understanding Windows Shellcode" paper is a great resource that will surely help you understand how Windows' internals work and how to use them to write shellcode.

The shellcode I use in these examples uses some techniques shown in the paper!

Contributions

Any contribution is very welcome! Feel free to open issues and pull requests!

Credits

This project idea was born thanks to Hasherezade's demo repository and the constant support of my instructor Federico Maggi.

Special thanks to my friends Francesco and Giancarlo that helped me review everything!

License

Copyright 2017 Giulio De Pasquale

Permission is hereby granted, free of charge, to any person obtaining a copy of this 
software and associated documentation files (the "Software"), to deal in the Software 
without restriction, including without limitation the rights to use, copy, modify, merge, 
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or 
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
DEALINGS IN THE SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].