Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/tools/modules/generate_mettle_payloads.rb
Views: 11767
#!/usr/bin/env ruby12#3# This script generates Mettle payload wrappers4#56require 'erb'78schemes = [9'tcp',10'http',11'https'12]1314arches = [15['aarch64', 'Linux', 'aarch64-linux-musl'],16['armbe', 'Linux', 'armv5b-linux-musleabi'],17['armle', 'Linux', 'armv5l-linux-musleabi'],18['mips64', 'Linux', 'mips64-linux-muslsf'],19['mipsbe', 'Linux', 'mips-linux-muslsf'],20['mipsle', 'Linux', 'mipsel-linux-muslsf'],21['ppc', 'Linux', 'powerpc-linux-muslsf'],22['ppce500v2', 'Linux', 'powerpc-e500v2-linux-musl'],23['ppc64le', 'Linux', 'powerpc64le-linux-musl'],24['x64', 'Linux', 'x86_64-linux-musl'],25['x86', 'Linux', 'i486-linux-musl'],26['zarch', 'Linux', 's390x-linux-musl'],27['x64', 'OSX', 'x86_64-apple-darwin'],28['aarch64', 'OSX', 'aarch64-apple-darwin'],29['aarch64', 'Apple_iOS', 'aarch64-iphone-darwin'],30['armle', 'Apple_iOS', 'arm-iphone-darwin'],31]3233arch = ''34payload = ''35platform = ''36scheme = ''37cwd = File::dirname(__FILE__)3839arches.each do |a, pl, pa|40schemes.each do |s|41arch = a42platform = pl43payload = pa44scheme = s4546template = File::read(File::join(cwd, "meterpreter_reverse.erb"))47renderer = ERB.new(template)48filename = File::join('modules', 'payloads', 'singles', platform.downcase, arch, "meterpreter_reverse_#{scheme}.rb")49File::write(filename, renderer.result())50end51end5253`bundle exec #{File::join(cwd, 'update_payload_cached_sizes.rb')}`545556