Commit Graph

197 Commits

Author SHA1 Message Date
adfoster-r7 89cd524acb Update osx templates makefile and compile binaries 2023-08-02 01:26:18 +01:00
usiegl00 c028d33cae Update OSX AARCH64 Stager
This fixes an issue with the stager size in the osx aarch64 payloads. It
also adds the source and Makefile for template_aarch64_darwin.bin
2023-07-31 20:30:30 -07:00
usiegl00 9019b51eaa Update AARCH64 Shellcode Generation
This updates the aarch64 payloads to include comments with the
corresponding instructions for each little-endian integer. It also fixes
the debug output for x64 payloads under rosetta.
2023-07-29 08:26:56 -07:00
usiegl00 b8068bc781 Cleanup for Sonoma Dyld
This adds support for the dyld changes incorperated into Sonoma and
cleans up the existing support for Ventura. This does not break
compatibility with previous versions.
2023-06-19 10:57:37 +02:00
usiegl00 0415565396 Fix for Ventura Dyld
This adds support for the dyld changes incorperated into Ventura which
includes changes to the symbols used. This does not break compatibility
with previous versions.
2023-06-19 10:57:37 +02:00
usiegl00 44762f18e8 Increase Stack Space for Loader
This increases the stack stack space mmap'd for the 2nd stage loader and
should fix the invalid stack memory access crash on the staged payload.
2023-06-19 10:57:37 +02:00
usiegl00 8a5442f7f0 Fix AARCH64 MachO Generation
This updates the exe util to properly generate stageless aarch64 macho
payloads. I've also added comments on how to assemble the aarch64
stages.
2023-06-19 10:57:37 +02:00
usiegl00 5f8767f4cf M1ssion Dyld Mettle: Aarch64 Payloads
This builds on Back from the dyld by adding the required aarch64
assembly code to enable the OSX loader to run on the m1. This enables
the use of native payloads on M1 or M2 devices that do not have Rosetta
installed.
2023-06-19 10:57:37 +02:00
usiegl00 bceaf5cd70 Back from the dyld: clean up mmap.
The mmap permissions prior to mprotect during the region mapping should
be write only. I also added a few more comments detailing the usage of
structs in dyld4.
2022-10-07 09:57:53 +09:00
usiegl00 8aa01bfbcd Back from the dyld: fix addr_main assignment.
When using the legacy technique, addr_main was being redifined. This
caused the access to addr_main outside the if statement to segfault.
2022-09-30 06:46:45 +09:00
usiegl00 ce75cb2afc Back from the dyld: clean up source code.
This fixes a floating `\t` in a struct definition. This also adds more
clarity to a set of dprintf statements regarding the region. This fixes
the indentation for a comment as well.
2022-09-29 07:58:23 +09:00
usiegl00 64231dad67 Back from the dyld: vm_allocate to fix corruption.
This fixes the corruption incidentally resolved by assigning to an
unused variable by properly allocating memory for structs before
assigning to them. This will resolve the segfault on return issue, as
the saved return address is no longer clobbered.
2022-09-28 20:58:48 +09:00
usiegl00 2833f504d4 Back from the dyld: a fileless loader. (Again.)
By replicating the functionality of APIs::dlopen_from, we can bypass the
temporary file created when calling NSCreateObjectFileImageFromMemory on
macOS 12 and above. Constructing a custom JustInTimeLoader and running
through all the dyld calls required to fix it up manually results in
fileless MachO execution.
2022-09-22 17:50:04 +09:00
usiegl00 b9052be102 Use libdyld locator to fix osx stager on monterey
We locate the dyld_shared_cache in memory to find and resolve the
functions we need in libdyld.dylib. We retain the original dyld location
method on osx versions before Sierra.

Explicitly set length for osx x64 initial stage

The rdx register, used for passing the payload length, is being
clobbered by a system call in the new MacOS version. Instead of relying
on the register being untouched, we set it equal to the payload length.
2022-04-12 11:27:23 +09:00
Spencer McIntyre e8ce6cf2f3 Fix up some comments in the x64 block_api source code 2020-07-09 14:02:12 -04:00
Spencer McIntyre 1537d3f193 Update the block_api assembly source files
This changes the x86 version to the (10 bytes) larger variant that can
handle full 32-bit jumps which is necesary for maximum compatibility
within the framwork.

Additionally, numeric literals are expressed in hex for compatibility
with the keystone assembler allowing these files to be compatitble with
external tools.
2020-07-08 15:28:41 -04:00
Tim W bba9b76d25 fix infinite loop in find_macho
fix osx loader to work within python macho
2020-04-24 15:13:57 +08:00
Brent Cook d50058cbc6 update to python standards 2019-12-19 09:22:48 -06:00
Brent Cook e8bbf2f117 fix remaining python3 compat bugs 2019-12-19 09:21:24 -06:00
Brent Cook 0a846aaeb6 convert to standard python format 2019-12-19 08:59:36 -06:00
Brent Cook 3cc6b8f8fd update to standard python formatting 2019-12-19 08:58:40 -06:00
Brent Cook d64f53e462 don't hide exception data 2019-12-19 08:56:23 -06:00
Brent Cook ce69efcfa2 python3 fixes, don't hide exception data 2019-12-19 08:56:00 -06:00
Brent Cook 3a1a576747 remove nasm ignored keyword 2019-12-19 08:44:13 -06:00
Brent Cook 25ce890d36 fix remaining python3 compat issues, add #! 2019-12-19 08:44:02 -06:00
Cristina Muñoz e804745766 Bugfix: correct reference to asm file 2019-11-12 09:30:27 -08:00
Cristina Muñoz 311b03af93 Action remainder of code review changes.
- Revert files that will only run as python2.
- Remove superfluous calls to list()
- Other minor cleanup
2019-11-01 19:24:22 -07:00
Cristina Muñoz 8563a29003 Convert all python code to python3. Fixes #12506. 2019-10-31 14:16:14 -07:00
Tim W 861c286739 fix osx stager compatibility with PluginProcessShim 2018-12-24 19:26:10 +08:00
Tim W d04070c528 fix osx stager when run under debugger 2018-12-18 14:12:36 +08:00
Tim W a01f0f3023 fix #9366, fix osx x64 stage location 2018-02-20 13:50:44 +08:00
Adam Cammack 64c725164a Add macOS reverse stager binary 2018-01-31 14:27:44 -06:00
Tim W 0ce125ec55 more fixes 2018-01-30 17:54:10 +08:00
Tim W 39c07e2289 add references 2018-01-30 17:52:01 +08:00
Tim W 9aaf93ff3b fix fix for older osx versions 2018-01-29 03:50:39 +08:00
Tim W 82fde6b1d1 fix for older osx versions 2018-01-21 08:04:26 +08:00
Tim W 46a45550fd add osx x64 stager 2018-01-03 14:04:14 +08:00
Tim 358aca9435 apple_ios/aarch64/shell_reverse_tcp 2017-12-19 15:42:21 +08:00
Tim ffbf21cb1c cleanup 2017-08-31 18:35:18 +08:00
Tim 7b71f60ea1 fix the stack 2017-08-31 18:35:18 +08:00
Tim 26f4fa3b09 setup stack 2017-08-31 18:35:17 +08:00
Tim a2396991f0 stager not setting up stack 2017-08-31 18:35:17 +08:00
Tim 6dbe00158f fix stager 2017-08-31 18:35:17 +08:00
Tim d6d6c67f33 add stage_shell.s and cleanup 2017-08-21 14:42:30 +08:00
Tim ac6495a7eb formatting 2017-08-21 12:35:13 +08:00
Tim 9768a89bcd aarch64 staged shell 2017-08-21 11:14:42 +08:00
Tim 8b4ccc66c7 add linux/aarch64/shell_reverse_tcp 2017-08-17 18:55:37 +08:00
Brent Cook 59086af261 Land #8771, rewrite linux x64 stagers with Metasm 2017-08-14 02:32:29 -04:00
tkmru f961d7da13 update src 2017-07-29 21:08:52 +09:00
tkmru 6c5d8279ca change to generate payload from metasm 2017-07-16 19:21:09 +09:00