Giter Site home page Giter Site logo

anthrax3 / mettle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from busterb/mettle

0.0 1.0 0.0 14.2 MB

Mettle is a new portable POSIX meterpreter implementation

Ruby 1.19% Makefile 0.49% Shell 0.01% M4 1.42% C 94.42% Objective-C 2.38% C++ 0.09%

mettle's Introduction

Mettle

This repo has submodules! Remember to run

git submodule init; git submodule update

after cloning.

OSX requirements

On OSX you will need the following:

# Install brew (if you have not already)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install command line tools
xcode-select --install

# Dependencies
brew install coreutils m4 automake

Make Targets

For general development, there are a few make targets defined:

Running make will build for the local environment. E.g. if you're on macOS, it will build for macOS using your native compiler and tools.

make TARGET=triple will build for a specific host triple. See below for some common ones.

make clean will clean the 'mettle' directory for the current build target

make distclean will clean the entire build target`

make all-parallel will build for every known target, useful with '-j' to build multiple targets at once.

make clean-parallel and make distclean-parallel do similar for all targets.

Packaging

To build the gem for distribution (currently requires Linux or macOS):

rake build

To check the resulting binaries:

rake check

To completely reset your dev environment and delete all binary artifacts:

rake mettle:ultraclean

Gem API

To generate a payload with Mettle:

mettle = MetasploitPayloads::Mettle.new(platform_triple, config={})

The available platform triples for Linux targets are:

  • aarch64-linux-musl
  • armv5l-linux-musleabi
  • armv5b-linux-musleabi
  • i486-linux-musl
  • x86_64-linux-musl
  • powerpc-linux-muslsf
  • powerpc64le-linux-musl
  • mips-linux-muslsf
  • mipsel-linux-muslsf
  • mips64-linux-muslsf
  • s390x-linux-musl

For Mingw32-64 Windows targets, the following triples are added. On up-to-date Debian / Ubuntu systems, the mingw-w64 package will install both toolchains.

  • x86_64-w64-mingw32
  • i686-w64-mingw32

For macOS/iOS builds, the following triples are added. To target older MacOSX versions, see https://github.com/phracker/MacOSX-SDKs to get the appropriate SDK folder.

  • arm-iphone-darwin
  • aarch64-iphone-darwin
  • i386-apple-darwin
  • x86_64-apple-darwin

Available config options are:

  • :background - fork to background as a daemon
  • :debug - to turn on debug messages
  • :log_file - the file to send debug messages to instead of stderr
  • :uri - the uri to connect back to
  • :uuid - the UUID to identify the payload

Config options can also be set with:

mettle.config[:key] = val

To get a binary with installed options call:

mettle.to_binary(format=:process_image)

The formats are:

  • :exec - a standalone executable that can take command-line arguments (see mettle -h) or use pre-set ones
  • :process_image - a process image that must be started with a custom stack (see doc/stack_requirements.md)

Using with Metasploit

To pull your local changes of mettle into your Metasploit install:

  1. Add -dev to the version in lib/metasploit-payloads/mettle/version.rb
  2. Build the gem as above
  3. Copy pkg/metasploit-payloads-mettle-X.X.X.pre.dev.gem to the box you are using for Metasploit if it is different
  4. Change the version in your metasploit-framework.gemspec to match the one you just build
  5. gem install <path to new gem>
  6. Run bundle install in your Framework directory
  7. Congrats, you are now done!

mettle's People

Contributors

acammack-r7 avatar busterb avatar bwatters-r7 avatar dmohanty-r7 avatar egypt avatar jacob-baines avatar jmartin-r7 avatar msjenkins-r7 avatar oj avatar pbarry-r7 avatar timwr avatar wchen-r7 avatar wwebb-r7 avatar

Watchers

 avatar

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.