Giter VIP home page Giter VIP logo

pichichih0ll0wer's Introduction

PichichiH0ll0wer

Pichichi

About

--== Process hollowing loader written in Nim for PEs only ==--

I built PichichiH0ll0wer to learn and contribute, sure. but also because I'm quite tired of shellcodes everywhere. Loading PEs might be less evasive, I know, but it's still efficient and more convenient than fighting to turn your PE payload into a shellcode each time (which not always works smoothly). Also, PichichiH0ll0wer has some features to protect your payload. Supports only x64 EXEs.

Features

  • Configurable builder
  • Payload encrypted and compressed (and optionally splitted) in the hollow loader
  • Supports splitted injection using multiple processes
  • Supports direct and indirect system calls
  • Hollower does not use the very suspicious call Nt/ZwUnmapViewOfSection
  • Can build EXE / DLL hollow loaders
  • Can block unsigned microsoft DLLs from being loaded to the hollowed process
  • Supports anti-debug techniques with the ability to die or to execute useless calculations ('troll' mode)
  • Obfuscated sleep using useless calculations
  • Supports execution within VEH
  • Supports command line Rc4 key to decrypt the payload

Injection methods

  1. Simple hollowing: just the usual stuff: VirtualAlloc -> WriteProcessMemory -> GetThreadContext -> SetThreadContext -> ResumeThread.
  2. Direct syscalls hollowing: using the great NimlineWhispers2.
  3. Indirect syscalls hollowing: using the great NimlineWhispers3.
  4. Splitted hollowing: each step of method (1) is occurring in a separate process with inherited handles.
  5. Splitted hollowing: each step of method (2) is occurring in a separate process with inherited handles.
  6. Splitted hollowing: each step of method (3) is occurring in a separate process with inherited handles.

Example of splitted hollowing of cscript.exe with cmd.exe that spawns whoami.exe:

Installation

Built with Nim 1.6.12, should be run on Windows only.

nimble install winim ptr_math nimprotect supersnappy argparse

Usage

Usage:
   [options] exe_file injection_method

Arguments:
  exe_file         Exe file to load
  injection_method Injection method

        1 - Simple hollowing
        2 - Direct syscalls hollowing
        3 - Indirect syscalls hollowing
        4 - Splitted hollowing using multiple processes
        5 - Splitted hollowing using multiple processes and direct syscalls
        6 - Splitted hollowing using multiple processes and indirect syscalls

Options:
  -h, --help
  -s, --sponsor=SPONSOR      Sponsor path to hollow (default: self hollowing)
  -a, --args=ARGS            Command line arguments to append to the hollowed process
  -f, --format=FORMAT        PE hollower format Possible values: [exe, dll] (default: exe)
  -e, --export=EXPORT        DLL export name (relevant only for Dll format) (default: DllRegisterServer)
  -b, --block                Block unsigned Microsoft Dlls in the hollowed process
  -p, --split                Split and hide the payload blob in hollower (takes long to compile!)
  -t, --sleep=SLEEP          Number of seconds to sleep before hollowing (default: 0)
  -g, --anti-debug=ANTI_DEBUG
                             Action to perform upon debugger detection Possible values: [none, die, troll] (default: none)
  -k, --key=KEY              RC4 key to [en/de]crypt the payload (supplied as a command line argument to the hollower)
  -v, --veh                  Hollow will occur within VEH
  -d, --debug                Compile as debug instead of release (loader is verbose)

Also, check the examples.

Credits

pichichih0ll0wer's People

Contributors

itaymigdal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pichichih0ll0wer's Issues

Error while running

Well, I get the following error (I used a metasploit exe, and all kind of injections. Same error.
What could be?)

Nim Compiler Version 2.0.0 [Windows: amd64]

{*] Compiling Loader: nim compile --app:console --cpu=amd64 -d:release -d:strip --opt:none --passL:-Wl,--dynamicbase --benchmarkVM:on --maxLoopIterationsVM:100000000 -d:hollow1 -o:PichichiH0ll0wer.exe Loader/main.nim
[-] Error compiling. compilation output:

Hint: used config file 'C:\nim-2.0.0\config\nim.cfg' [Conf]
Hint: used config file 'C:\nim-2.0.0\config\config.nims' [Conf]
........................................................................................................................................................................................................
C:\TOOLZ\__REVERSING\__AV-Bypass_mitigation\PichichiH0ll0wer-main\PichichiH0ll0wer\Loader\utils.nim(84, 7) template/generic instantiation of `!=` from here
C:\TOOLZ\__REVERSING\__AV-Bypass_mitigation\PichichiH0ll0wer-main\PichichiH0ll0wer\Loader\utils.nim(73, 21) Error: type mismatch
Expression: CreateProcess(nil, newWideCString(processCmd), ps, ts, 0, 524292, nil, nil,
              addr si.StartupInfo, addr pi)
  [1] nil: typeof(nil)
  [2] newWideCString(processCmd): WideCStringObj
  [3] ps: SECURITY_ATTRIBUTES
  [4] ts: SECURITY_ATTRIBUTES
  [5] 0: int literal(0)
  [6] 524292: int literal(524292)
  [7] nil: typeof(nil)
  [8] nil: typeof(nil)
  [9] addr si.StartupInfo: ptr STARTUPINFOW
  [10] addr pi: ptr PROCESS_INFORMATION

Expected one of (first mismatch at [position]):
[3] proc CreateProcess(lpApplicationName: LPCWSTR; lpCommandLine: LPWSTR;
                   lpProcessAttributes: LPSECURITY_ATTRIBUTES;
                   lpThreadAttributes: LPSECURITY_ATTRIBUTES;
                   bInheritHandles: WINBOOL; dwCreationFlags: DWORD;
                   lpEnvironment: LPVOID; lpCurrentDirectory: LPCWSTR;
                   lpStartupInfo: LPSTARTUPINFOW;
                   lpProcessInformation: LPPROCESS_INFORMATION): WINBOOL

Maybe a version issue. Nim compiler version 1.6 is working fine!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.