Coder Social home page Coder Social logo

atompepacker's Introduction

AtomPePacker : A Highly Capable Pe Packer


Features :

  • the packer only support x64 exe's (altho planning to make x32 version but idk when it'll be done)
  • no crt imports
  • api hashing library ( custom getmodulehandle and getprocaddress )
  • direct syscalls ( for the part that i do the ntdll unhooking )
  • ntdll unhooking from \KnownDlls\
  • support tls callbacks
  • support reallocation in case of needed ( the image is mapped to the preferable address first )
  • no rwx section allocation
  • support exception handling
  • uses elzma compression algorithm to do the compression (reducing the final file size)
  • its local run pe, so it support arguments
  • fake imported functions to add more friendly look to the iat

Builder :

  • you can download from here or compile the code manually
  • supports only 1 input: x64 native exe files.
  • supports 3 outputs:
    • dll :
      • Example "rundll32.exe DllPP64.dll Atom" (Using "Atom" is a must to run your payload - this is the name if the exported function in the dll)
      • can be hijacked / injected into other process
    • exe :
      • this output is the default (with console - for binaries like mimikatz)
    • no console exe
      • for binaries like a c2 agent

Usage :


[#] Usage  : PePacker.exe <Input x64 exe> <*Output*> <*Optional Features*>
[#] Output :
              -d : Output The Packed Pe As A x64 Dll File
              -e : Output The Packed Pe As A x64 Exe File (Default)
[#] Features :
              -h : Hide The Console - /SUBSYSTEM:WINDOWS



Example:


PePacker.exe mimikatz.exe			: generate exe packed file
PePacker.exe mimikatz.exe -e			: generate exe packed file
PePacker.exe mimikatz.exe -e	-h		: generate hidden exe packed file
PePacker.exe mimikatz.exe -d			: generate dll output


Demo - Builder :

Screenshot 2022-10-12 073947 Screenshot 2022-10-12 074128



Demo - Profit :

photo_2022-10-12_07-08-33 photo_2022-10-12_07-08-38



Thanks for :

TODO :

  • x32 support
  • reduce the entropy

atompepacker's People

Contributors

inndy avatar nul0x4c 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

atompepacker's Issues

"CopyFileA" [ FAILED ]

[i] Reading " mimi.exe " ...
[i] 64-PE Input Detected ... [ SUPPORTED ]
[i] Generating Exe Output ...
[!] "CopyFileA" [ FAILED ] 3

Static local variable are not supported

Static variable cannot be initialized:

class Test {
public:
	Test() {
		printf("Test:Test\n");
	}
	~Test() {
		printf("Test:~Test\n");
	}
};

int main()
{
	static Test tt;
	std::cout << "Hello World!\n";
	return 0;
}

output: Hello World!,doesn't have "Test:Test"

CopyFileA Failed Error

I receive the following error with any 64bit binary I try to pack. I have tried both the dll and exe with the same error. Any idea what is going on here?

C:\Users\Dev\PePacker.exe Loader.exe -d
[i] Reading " Loader.exe " ...
[i] 64-PE Input Detected ... [ SUPPORTED ]
[i] Generating Dll Output ...
[!] "CopyFileA" [ FAILED ] 3

Error when running the packed executable

I'm trying to pack benign executable files to test if the packer works before trying it on my beacons. Currently I'm just getting errors no matter what options or executable (x64) I pass.

The following is an attempt with whoami.exe on a 64-bit windows 10 machine.

$ file /mnt/c/windows/system32/whoami.exe
/mnt/c/windows/system32/whoami.exe: PE32+ executable (console) x86-64, for MS Windows

PS C:\Safe\AtomPePacker\Pre-Compiled> .\PePacker.exe 'C:\Windows\System32\whoami.exe' -e
[i] Reading " C:\Windows\System32\whoami.exe " ...
[i] 64-PE Input Detected ... [ SUPPORTED ]
[i] Generating Exe Output ...
[i] Reading The Loader "PP64Stub.exe" ... [ DONE ]
[i] Packing ...  [ DONE ]
[+] Compressed Ratio : 43%
[+] Final Pe Size : 32172
[+] Section .ATOM is Created Containing The Input Packed Pe
PS C:\Safe\AtomPePacker\Pre-Compiled> .\PP64Stub.exe
 The specified resource type cannot be found in the image file.
PS C:\Safe\AtomPePacker\Pre-Compiled> C:\Windows\System32\whoami.exe
redacted\aphilbert

Here's an attempt with a simple binary that opens calc.exe:

PS C:\Safe\AtomPePacker\Pre-Compiled> .\PePacker.exe C:\Safe\open_calc.exe
[i] Reading " C:\Safe\open_calc.exe " ...
[i] 64-PE Input Detected ... [ SUPPORTED ]
[i] Generating Exe Output ...
[i] Reading The Loader "PP64Stub.exe" ... [ DONE ]
[i] Packing ...  [ DONE ]
[+] Compressed Ratio : 22%
[+] Final Pe Size : 12644
[+] Section .ATOM is Created Containing The Input Packed Pe
PS C:\Safe\AtomPePacker\Pre-Compiled> .\PP64Stub.exe
Mingw-w64 runtime failure:
Address 0000000140005370 has no image-section

Any idea what is going on?

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.