Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 GitHub - clayne/wrappem: A small tool to inject PE files import address table with an external payload DLL.
Nothing Special   »   [go: up one dir, main page]

Skip to content
/ wrappem Public
forked from oAGoulart/wrappem

A small tool to inject PE files import address table with an external payload DLL.

License

Notifications You must be signed in to change notification settings

clayne/wrappem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WrappEm

Platform GitHub release (latest by date) License

WARNING: This version can only work if there's enough empty space on idata section. Two more methods are being worked on to allow for cases where not enough space is available.

From old version:

This is a small tool that can generate a hooked PE file which will import your custom DLL into its process. With this you can inject a payload into a process using a DLL. I took inspiration to make this tool from Michael Chourdakis' article, but his implementation was not suited for my needs, so after some research and testing I created this tool. The first implementation I made used the same method described in the article to create a proxy DLL, this version however modifies a DLL/Exe imports table to force Windows to import your payload DLL into the process. If you're interested in this method you can learn more about PE Format and the Import Table (it's a lot of stuff tho, so get some coffee first). Also, consider checking my brief explanation on how this tool works here: Injecting payloads in DLLs.

Method I: import table relocation

Requirements:

  1. Enough padding space for import table size plus one entry;
  2. Import table size bigger or equal to payload data size.
 standard idata section structure               after relocation
────────┬──────────────────┬──────    ────────┬──────────────────┬──────
 .idata │                  │ start     .idata │                  │ start
section │  address tables  │          section │  address tables  │
        │     (thunk)      │                  │     (thunk)      │
     ┌──┼                  ◄─┐           ┌────►                  ┼─┐
     │  ├──────────────────┤ │           │    ├──────────────────┤ │
     │  │                  ┼─┘           │    +                  + │
     │  │   import table   ┼──┐          │    +   payload data   + │
     │  │                  ┼─┐│          │┌───►                  + │
     │  ├──────────────────┤ ││          ││   ├──────────────────┤ │
     │  │                  ◄─┘│          ││   │                  │ │
     │  │   lookup tables  │  │          ││   │   lookup tables  │ │
     │  │      (32/64)     │  │          ││┌──►      (32/64)     │ │
     │┌─┼                  │  │          │││┌─┼                  │ │
     ││ ├──────────────────┤  │          ││││ ├──────────────────┤ │
     │└─►                  ◄──┘          │││└─►                  ◄─┘
     │  │names and ordinals│             │││  │names and ordinals│
     └──►                  │             │││  │                  ◄─┐
        └──────────────────┘             │││  ├──────────────────┤ │
        :                  :             ││└──┼                  ┼─┘
        :     padding      :             │└───┼   import table   │
        :                  : end         └────┼                  │ end 
──────────────────────────────────    ────────┴──────────────────┴──────

Method II: import table expansion

NOT IMPLEMENTED YET

Requirements:

  1. Enough padding space for one table entry plus data;
  2. All relative virtual addresses (RVAs) in idata must be re-calculated.

After import table expansion and re-building:

────────┬──────────────────┬──────
 .idata │  address tables  │ start
section │     (thunk)      │
        │- - - - - - - - - │
     ┌──┼     payload      ◄─┐
     │  ├──────────────────┤ │
     │  │   import table   ┼─┘
     │  │- - - - - - - - - ┼──┐
     │  │     payload      ┼─┐│
     │  ├──────────────────┤ ││
     │  │   lookup tables  ◄─┘│
     │┌─┼      (32/64)     │  │
     ││ │- - - - - - - - - │  │
     ││ │     payload      │  │
     ││ ├──────────────────┤  │
     │└─►                  ◄──┘
     │  │names and ordinals│
     │  │- - - - - - - - - │
     │  │     payload      │
     └──►                  │
        └──────────────────┘
        :     padding      : end
──────────────────────────────────

Method III: import data section relocation

NOT IMPLEMENTED YET

Requirements:

  1. Offset of new section entry must be less than section alignment;
  2. All RVAs must be incremented by virtual offset.
            before append                           after append
         ┌──────────────────┐                   ┌──────────────────┐
 PE file │      headers     │           PE file │      headers     │
         │                  │                   │                  │
─────────┼──────────────────┼──────    ─────────┼──────────────────┼──────
sections │                  │ start    sections │                  │ start
         │      .rsrc       │                   │      .rsrc       │
         ├──────────────────┤                   ├──────────────────┤
         │                  │                   │                  │
         │      .data       │                   │      .data       │
         ├──────────────────┤                   ├──────────────────┤
         │                  │                   │                  │
         │      .idata      │                   │     (empty)      │
         ├──────────────────┤                   ├──────────────────┤
         :                  :                   :                  :
         :       ...        :                   :       ...        :
         :                  :                   :                  :
         ├──────────────────┤                   ├──────────────────┤
         │                  │                   │                  │
         │                  │                   │             
5865
     │
         │      .text       │                   │      .text       │
         │                  │                   │                  │
         │                  │ end               │                  │
 ────────┴──────────────────┴──────     - - - - ┼──────────────────┼ - - -
                                                │                  │
                                                │      .idata      │ end
                                        ────────┴──────────────────┴──────

About

A small tool to inject PE files import address table with an external payload DLL.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 98.1%
  • C 1.9%
0