Giter Club home page Giter Club logo

objcshellcodeloader's Introduction

ObjCShellcodeLoader

Allocate memory with mach_vm_allocate, change memory protections with mach_vm_protect, write shellcode with mach_vm_write, and execute shellcode as a function pointer.

objcshellcodeloader's People

Contributors

slyd0g avatar

Stargazers

 avatar Lav avatar godfriedt avatar  avatar Nathan Jester avatar Tobias Zittlau avatar  avatar Carlos Ortigoza avatar  avatar Daniel Stinson-Diess avatar Minoru Kobayashi avatar  avatar  avatar Noah avatar  avatar  avatar r3d avatar  avatar  avatar DeMarcus Williams avatar GKDshell avatar  avatar  avatar Devin Casadey avatar clod avatar  avatar  avatar jjan X avatar Ceramicskate0 avatar Yeah9782 avatar  avatar  avatar beerandgin avatar  avatar  avatar Yuuki Ebihara avatar Preston Thornburg avatar Jon avatar  avatar  avatar Ryota Sakai avatar  avatar Solomon Sklash avatar B0y1n4o4 avatar  avatar Boschko avatar Cedric Owens avatar  avatar

Watchers

 avatar  avatar Tobias Zittlau avatar

objcshellcodeloader's Issues

build error

❯ clang main.m
main.m:19:32: error: implicit declaration of function 'mach_vm_allocate' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kern_return_t kernReturn = mach_vm_allocate(mach_task_self(), &address, shellcodeLength, VM_FLAGS_ANYWHERE);
^
main.m:19:32: note: did you mean 'mach_port_allocate'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h:131:15: note: 'mach_port_allocate' declared here
kern_return_t mach_port_allocate
^
main.m:23:42: warning: format specifies type 'void *' but the argument has type 'mach_vm_address_t' (aka 'unsigned long long') [-Wformat]
printf(" |-> Address: %p\n", address);
~~ ^~~~~~~
%llu
main.m:31:18: error: implicit declaration of function 'mach_vm_protect' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_protect(mach_task_self(), address, shellcodeLength, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
^
main.m:31:18: note: did you mean 'vm_protect'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h:119:15: note: 'vm_protect' declared here
kern_return_t vm_protect
^
main.m:42:18: error: implicit declaration of function 'mach_vm_write' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_write(mach_task_self(), address, shellcode, shellcodeLength);
^
main.m:42:18: note: did you mean 'mach_vm_wire'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h:315:15: note: 'mach_vm_wire' declared here
kern_return_t mach_vm_wire
^
1 warning and 3 errors generated.

===================================
❯ clang main.m -std=c89
main.m:19:32: error: implicit declaration of function 'mach_vm_allocate' [-Werror,-Wimplicit-function-declaration]
kern_return_t kernReturn = mach_vm_allocate(mach_task_self(), &address, shellcodeLength, VM_FLAGS_ANYWHERE);
^
main.m:19:32: note: did you mean 'mach_port_allocate'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h:131:15: note: 'mach_port_allocate' declared here
kern_return_t mach_port_allocate
^
main.m:23:42: warning: format specifies type 'void *' but the argument has type 'mach_vm_address_t' (aka 'unsigned long long') [-Wformat]
printf(" |-> Address: %p\n", address);
~~ ^~~~~~~
%llu
main.m:31:18: error: implicit declaration of function 'mach_vm_protect' [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_protect(mach_task_self(), address, shellcodeLength, false, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE);
^
main.m:31:18: note: did you mean 'vm_protect'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h:119:15: note: 'vm_protect' declared here
kern_return_t vm_protect
^
main.m:42:18: error: implicit declaration of function 'mach_vm_write' [-Werror,-Wimplicit-function-declaration]
kernReturn = mach_vm_write(mach_task_self(), address, shellcode, shellcodeLength);
^
main.m:42:18: note: did you mean 'mach_vm_wire'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h:315:15: note: 'mach_vm_wire' declared here
kern_return_t mach_vm_wire
^
1 warning and 3 errors generated.

======================================

so, how can i build it?

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.