2014-08-15 11:33:31 -05:00
# coding: utf-8
# During build, the Gemfile is temporarily moved and
# we must manually define the project root
if ENV [ 'MSF_ROOT' ]
lib = File . realpath ( File . expand_path ( 'lib' , ENV [ 'MSF_ROOT' ] ) )
2024-05-24 00:30:52 +01:00
$LOAD_PATH . unshift ( lib ) unless $LOAD_PATH . include? ( lib )
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
require 'msf/util/helper'
2014-08-15 11:33:31 -05:00
else
2024-05-24 00:30:52 +01:00
# XXX: Use explicit calls to require_relative to ensure that static analysis tools such as dependabot work
require_relative 'lib/metasploit/framework/version'
require_relative 'lib/metasploit/framework/rails_version_constraint'
require_relative 'lib/msf/util/helper'
2014-08-15 11:33:31 -05:00
end
Gem :: Specification . new do | spec |
spec . name = 'metasploit-framework'
spec . version = Metasploit :: Framework :: GEM_VERSION
spec . authors = [ 'Metasploit Hackers' ]
2017-08-20 13:23:54 -05:00
spec . email = [ 'msfdev@metasploit.com' ]
2014-08-15 11:33:31 -05:00
spec . summary = 'metasploit-framework'
spec . description = 'metasploit-framework'
spec . homepage = 'https://www.metasploit.com'
spec . license = 'BSD-3-clause'
2017-07-10 16:38:10 +02:00
# only do a git ls-files if the .git folder exists and we have a git binary in PATH
2017-07-17 09:58:20 +02:00
if File . directory? ( File . join ( File . dirname ( __FILE__ ) , " .git " ) ) && Msf :: Util :: Helper . which ( " git " )
2017-05-26 10:07:49 -05:00
spec . files = ` git ls-files ` . split ( $/ ) . reject { | file |
2023-05-22 08:28:23 -05:00
file =~ / ^external|^docs|^ \ .solargraph \ .yml /
2017-05-26 10:07:49 -05:00
}
end
2014-08-15 11:33:31 -05:00
spec . bindir = '.'
2015-12-30 11:00:45 -06:00
if ENV [ 'CREATE_BINSTUBS' ]
spec . executables = [
2014-08-15 11:33:31 -05:00
'msfconsole' ,
'msfd' ,
'msfrpc' ,
'msfrpcd' ,
'msfvenom'
2015-12-30 11:00:45 -06:00
]
end
2014-08-15 11:33:31 -05:00
spec . test_files = spec . files . grep ( %r{ ^spec/ } )
spec . require_paths = [ " lib " ]
2024-12-09 18:17:08 +00:00
spec . required_ruby_version = '>= 3.1'
2019-11-03 09:46:47 -05:00
2015-11-09 13:03:26 -06:00
# Database support
spec . add_runtime_dependency 'activerecord' , * Metasploit :: Framework :: RailsVersionConstraint :: RAILS_VERSION
2014-08-15 11:33:31 -05:00
# Need 3+ for ActiveSupport::Concern
2014-12-19 13:54:13 -06:00
spec . add_runtime_dependency 'activesupport' , * Metasploit :: Framework :: RailsVersionConstraint :: RAILS_VERSION
2014-08-15 11:33:31 -05:00
# Needed for config.action_view for view plugin compatibility for Pro
2014-12-19 13:54:13 -06:00
spec . add_runtime_dependency 'actionpack' , * Metasploit :: Framework :: RailsVersionConstraint :: RAILS_VERSION
2014-08-15 11:33:31 -05:00
# Needed for some admin modules (cfme_manageiq_evm_pass_reset.rb)
2020-07-23 16:33:45 -05:00
spec . add_runtime_dependency 'bcrypt'
2023-03-13 11:20:39 +00:00
# Improves bootup performance by caching expensive computations
spec . add_runtime_dependency 'bootsnap'
2014-09-19 19:10:39 -05:00
# Needed for Javascript obfuscation
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'jsobfu'
2014-08-15 11:33:31 -05:00
# Needed for some admin modules (scrutinizer_add_user.rb)
2025-07-24 14:58:13 +01:00
spec . add_runtime_dependency 'json'
2014-12-22 20:26:30 -06:00
# Metasm compiler/decompiler/assembler
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'metasm'
2023-12-30 16:26:31 +00:00
# Needed for aarch64 assembler support - as Metasm does not currently support Aarch64 fully
spec . add_runtime_dependency 'aarch64'
2014-09-18 09:33:57 -05:00
# Metasploit::Concern hooks
2021-03-19 15:02:12 -05:00
spec . add_runtime_dependency 'metasploit-concern'
2015-11-09 13:03:26 -06:00
# Metasploit::Credential database models
2026-04-13 09:20:26 -04:00
spec . add_runtime_dependency 'metasploit-credential' , '>= 6.0.21'
2015-11-09 13:03:26 -06:00
# Database models shared between framework and Pro.
2026-03-05 17:16:02 +00:00
spec . add_runtime_dependency 'metasploit_data_models' , '>= 6.0.15'
2014-08-15 11:33:31 -05:00
# Things that would normally be part of the database model, but which
# are needed when there's no database
2021-03-19 15:02:12 -05:00
spec . add_runtime_dependency 'metasploit-model'
2015-06-22 16:56:54 -05:00
# Needed for Meterpreter
2026-04-06 09:29:02 -05:00
spec . add_runtime_dependency 'metasploit-payloads' , '2.0.245'
2016-05-26 16:17:43 -05:00
# Needed for the next-generation POSIX Meterpreter
2026-01-16 11:00:03 +00:00
spec . add_runtime_dependency 'metasploit_payloads-mettle' , '1.0.46'
2014-08-15 11:33:31 -05:00
# Needed by msfgui and other rpc components
2023-05-02 15:53:26 -05:00
# Locked until build env can handle newer version. See: https://github.com/msgpack/msgpack-ruby/issues/334
spec . add_runtime_dependency 'msgpack' , '~> 1.6.0'
2015-11-09 13:03:26 -06:00
# get list of network interfaces, like eth* from OS.
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'network_interface'
2016-07-05 17:05:42 -05:00
# NTLM authentication
spec . add_runtime_dependency 'rubyntlm'
2024-05-22 12:33:11 +01:00
# Needed by for XML parsing
spec . add_runtime_dependency 'nokogiri'
2014-08-15 11:33:31 -05:00
# Needed by db.rb and Msf::Exploit::Capture
2017-05-09 11:03:32 -05:00
spec . add_runtime_dependency 'packetfu'
2015-11-09 13:03:26 -06:00
# For sniffer and raw socket modules
2021-12-23 12:58:25 -06:00
spec . add_runtime_dependency 'pcaprub'
2017-06-21 03:13:43 -05:00
# Used by the Metasploit data model, etc.
2019-02-11 12:59:51 -05:00
# bound to 0.2x for Activerecord 4.2.8 deprecation warnings:
2017-06-21 03:13:43 -05:00
# https://github.com/ged/ruby-pg/commit/c90ac644e861857ae75638eb6954b1cb49617090
2020-07-09 15:03:40 -05:00
spec . add_runtime_dependency 'pg'
2014-08-15 11:33:31 -05:00
# Run initializers for metasploit-concern, metasploit-credential, metasploit_data_models Rails::Engines
spec . add_runtime_dependency 'railties'
2014-10-29 16:26:36 -05:00
# required for OS fingerprinting
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'recog'
2015-10-07 11:16:49 +02:00
# required for bitlocker fvek extraction
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'openssl-ccm'
2025-10-07 18:08:30 +01:00
spec . add_runtime_dependency 'octokit'
2016-03-24 20:43:51 -05:00
spec . add_runtime_dependency 'redcarpet'
2016-03-29 23:21:01 -05:00
# Needed for Microsoft patch finding tool (msu_finder)
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'patch_finder'
2019-01-09 23:40:02 -05:00
# Required for Metasploit Web Services
2020-12-01 18:16:26 +00:00
spec . add_runtime_dependency 'puma'
2023-08-10 13:29:10 +02:00
spec . add_runtime_dependency 'ruby-mysql'
2025-10-13 16:03:28 +01:00
# webserver - pinned due to: https://github.com/github/secure_headers/issues/514
spec . add_runtime_dependency 'thin' , '~> 1.x'
# rack pinned due to authlogic warnings when setting cookie keys with a / char present: https://github.com/binarylogic/authlogic/issues/779
spec . add_runtime_dependency 'rack' , '~> 2.2'
# 4.x needs tested and verified for JSON RPC service
spec . add_runtime_dependency 'sinatra' , '~> 3.2'
2018-06-22 15:09:36 -04:00
spec . add_runtime_dependency 'warden'
2021-05-10 13:21:55 +01:00
spec . add_runtime_dependency 'swagger-blocks'
2018-10-25 22:30:54 -04:00
# Required for JSON-RPC client
spec . add_runtime_dependency 'em-http-request'
2016-05-17 11:40:25 -05:00
# TimeZone info
spec . add_runtime_dependency 'tzinfo-data'
2016-06-28 16:10:48 -05:00
# Gem for dealing with SSHKeys
spec . add_runtime_dependency 'sshkey'
2016-07-26 16:59:13 -05:00
# Library for interpreting Windows error codes and strings
spec . add_runtime_dependency 'windows_error'
2017-04-13 07:12:38 -05:00
# This used to be depended on by nokogiri, depended on by wmap
2017-04-13 17:33:29 -05:00
if Gem :: Version . new ( RUBY_VERSION ) > = Gem :: Version . new ( '2.3.0' )
spec . add_runtime_dependency 'xmlrpc'
end
2021-02-24 17:01:57 +00:00
# Gem for handling Cookies
spec . add_runtime_dependency 'http-cookie'
2022-09-29 23:00:15 +10:00
# Needed for some modules (polkit_auth_bypass.rb)
2021-06-23 10:58:02 -04:00
spec . add_runtime_dependency 'unix-crypt'
2024-10-30 20:21:02 +00:00
# Needed for Kerberos structure parsing; Pinned to ensure a security review is performed on updates
2025-02-28 14:00:50 -08:00
spec . add_runtime_dependency 'rasn1' , '0.14.0'
2016-05-13 19:00:52 -05:00
2017-07-07 11:19:06 +00:00
#
# File Parsing Libraries
#
# Needed by auxiliary/gather/http_pdf_authors module
spec . add_runtime_dependency 'pdf-reader'
2017-12-29 11:13:25 +08:00
spec . add_runtime_dependency 'ruby-macho'
2019-07-09 20:12:19 -04:00
# Needed for mongodb/bson
spec . add_runtime_dependency 'bson'
2017-07-07 11:19:06 +00:00
2016-07-05 11:08:57 -05:00
#
# Protocol Libraries
#
2016-10-09 02:34:44 +03:00
spec . add_runtime_dependency 'dnsruby'
2017-12-20 12:28:02 -08:00
spec . add_runtime_dependency 'mqtt'
2016-07-05 11:08:57 -05:00
spec . add_runtime_dependency 'net-ssh'
2018-09-28 16:20:11 -05:00
spec . add_runtime_dependency 'ed25519' # Adds ed25519 keys for net-ssh
2017-08-01 15:26:50 -05:00
spec . add_runtime_dependency 'bcrypt_pbkdf'
2026-03-24 08:25:06 -07:00
spec . add_runtime_dependency 'ruby_smb' , '~> 3.3.17'
2023-08-04 11:56:17 +01:00
spec . add_runtime_dependency 'net-imap' # Used in Postgres auth for its SASL stringprep implementation
2025-11-03 17:30:47 +00:00
spec . add_runtime_dependency 'date' , '3.4.1' # Temporarily pinned until 3.5 can be tested
2020-04-14 10:53:07 -05:00
spec . add_runtime_dependency 'net-ldap'
2022-03-23 13:05:42 +00:00
spec . add_runtime_dependency 'net-smtp'
2024-06-27 09:32:15 +01:00
spec . add_runtime_dependency 'net-sftp'
2025-11-24 12:15:55 +00:00
spec . add_runtime_dependency 'rest-client'
2021-08-11 09:41:11 -04:00
spec . add_runtime_dependency 'winrm'
2025-11-24 12:15:55 +00:00
# Pinned to avoid WinRM warnings: https://github.com/WinRb/WinRM/issues/355 - if bumping verify windows/winrm/winrm_script_exec works against metasploitable with vagrant/vagrant creds
2025-10-24 10:18:15 +01:00
spec . add_runtime_dependency 'rexml' , '3.4.1'
2024-07-23 13:16:59 +01:00
spec . add_runtime_dependency 'ffi' , '< 1.17.0'
2016-07-05 11:08:57 -05:00
2016-06-21 13:56:36 -05:00
#
# REX Libraries
#
2016-08-26 14:00:13 -05:00
# Core of the Ruby Exploitation Library
spec . add_runtime_dependency 'rex-core'
2016-06-21 13:56:36 -05:00
# Text manipulation library for things like generating random string
2018-04-18 10:38:01 -05:00
spec . add_runtime_dependency 'rex-text'
2016-06-21 13:56:36 -05:00
# Library for Generating Randomized strings valid as Identifiers such as variable names
spec . add_runtime_dependency 'rex-random_identifier'
# library for creating Powershell scripts for exploitation purposes
2018-06-21 11:41:16 -05:00
spec . add_runtime_dependency 'rex-powershell'
2016-06-21 13:56:36 -05:00
# Library for processing and creating Zip compatbile archives
spec . add_runtime_dependency 'rex-zip'
# Library for parsing offline Windows Registry files
spec . add_runtime_dependency 'rex-registry'
2016-06-27 14:52:49 -05:00
# Library for parsing Java serialized streams
spec . add_runtime_dependency 'rex-java'
2016-07-15 16:01:21 -05:00
# Library for C-style structs
spec . add_runtime_dependency 'rex-struct2'
2016-09-27 04:01:05 -05:00
# Library which contains architecture specific information such as registers, opcodes,
2016-07-20 16:42:41 -05:00
# and stack manipulation routines.
2017-05-29 23:41:10 -05:00
spec . add_runtime_dependency 'rex-arch'
2016-07-21 18:07:23 -05:00
# Library for working with OLE.
spec . add_runtime_dependency 'rex-ole'
2016-09-01 11:38:07 -05:00
# Library for creating and/or parsing MIME messages.
spec . add_runtime_dependency 'rex-mime'
2016-09-06 11:27:06 -05:00
# Library for Dynamic Multi-byte x86 NOP generation
spec . add_runtime_dependency 'rex-nop'
2016-08-15 14:01:43 -05:00
# Library for parsing and manipulating executable binaries
spec . add_runtime_dependency 'rex-bin_tools'
2016-08-26 14:00:13 -05:00
# Rex Socket Abstraction Layer
2019-08-30 00:01:55 -05:00
spec . add_runtime_dependency 'rex-socket'
2016-08-30 10:43:47 -05:00
# Library for scanning a server's SSL/TLS capabilities
spec . add_runtime_dependency 'rex-sslscan'
2016-09-12 16:06:53 -05:00
# Library and tool for finding ROP gadgets in a supplied binary
spec . add_runtime_dependency 'rex-rop_builder'
2016-09-14 12:07:26 -05:00
# Library for polymorphic encoders; used for payload encoding
spec . add_runtime_dependency 'rex-encoder'
2016-10-11 17:40:43 -05:00
# Library for exploit development helpers
spec . add_runtime_dependency 'rex-exploitation'
2017-01-18 08:20:16 -06:00
# Command line editing, history, and tab completion in msfconsole
spec . add_runtime_dependency 'rb-readline'
2014-08-15 11:33:31 -05:00
# Needed by some modules
2016-04-15 11:45:43 -05:00
spec . add_runtime_dependency 'rubyzip'
2014-08-15 11:33:31 -05:00
# Needed for some post modules
2024-05-23 15:39:15 +01:00
spec . add_runtime_dependency 'sqlite3' , '1.7.3'
2014-08-15 11:33:31 -05:00
# required for Time::TZInfo in ActiveSupport
spec . add_runtime_dependency 'tzinfo'
2015-10-29 07:28:33 +10:00
# Needed so that disk size output isn't horrible
spec . add_runtime_dependency 'filesize'
2016-08-18 17:02:46 -05:00
# Needed for openvas plugin
spec . add_runtime_dependency 'openvas-omp'
2016-08-14 17:57:33 +02:00
# Needed by metasploit nessus bridge
spec . add_runtime_dependency 'nessus_rest'
2017-01-25 10:13:28 -06:00
# Nexpose Gem
spec . add_runtime_dependency 'nexpose'
2017-05-24 00:11:06 +12:00
# Needed for NDMP sockets
spec . add_runtime_dependency 'xdr'
2017-12-28 21:00:03 -05:00
# Needed for ::Msf...CertProvider
spec . add_runtime_dependency 'faker'
2021-06-23 12:17:01 -05:00
# SSH server library with ed25519
spec . add_runtime_dependency 'hrr_rb_ssh-ed25519'
2020-05-24 16:26:23 +02:00
# Needed for irb internal command
2024-12-09 18:17:08 +00:00
spec . add_runtime_dependency 'irb'
2019-06-11 19:01:22 -05:00
# AWS enumeration modules
spec . add_runtime_dependency 'aws-sdk-s3'
spec . add_runtime_dependency 'aws-sdk-ec2'
spec . add_runtime_dependency 'aws-sdk-iam'
2022-12-30 21:50:15 -05:00
spec . add_runtime_dependency 'aws-sdk-ssm'
2019-12-05 17:24:29 -06:00
2023-02-09 11:42:29 -06:00
# AWS session support
spec . add_runtime_dependency 'aws-sdk-ec2instanceconnect'
2019-09-25 15:58:34 -05:00
# Needed for WebSocket Support
spec . add_runtime_dependency 'faye-websocket'
spec . add_runtime_dependency 'eventmachine'
2019-12-12 10:13:51 -06:00
2025-10-08 13:35:00 +01:00
spec . add_runtime_dependency 'faraday'
2022-06-09 02:09:28 +01:00
spec . add_runtime_dependency 'faraday-retry'
2019-12-03 17:40:36 +00:00
2021-10-06 09:37:14 -05:00
# Required for windows terminal colors as of Ruby 3.0
spec . add_runtime_dependency 'win32api'
2020-09-22 02:56:51 +01:00
spec . add_runtime_dependency 'zeitwerk'
2023-02-20 13:04:47 +00:00
2023-03-02 12:47:48 -06:00
# Required for PNG payload support.
# WARNING: Chunky_PNG is vulnerable to decompression bomb attacks.
# Do not use this to process untrusted PNG files! This is only to be used
# to generate PNG files, not to parse untrusted PNG files.
2023-02-20 13:04:47 +00:00
spec . add_runtime_dependency 'chunky_png'
2023-09-19 10:35:51 +01:00
2024-10-02 13:15:12 +01:00
# Needed for multiline REPL support for interactive SQL sessions
spec . add_runtime_dependency 'reline'
2024-09-16 16:27:47 -07:00
# Needed to parse sections of ELF files in order to retrieve symbols
spec . add_runtime_dependency 'elftools'
2025-06-17 15:21:27 -04:00
# Needed for generic in-memory cachine
spec . add_runtime_dependency 'lru_redux'
2025-07-16 17:55:56 +01:00
# Pinned on 3.1.1 as it is the version supported by our Ruby 3.3.8 dependency to avoid this issue https://github.com/rubygems/rubygems/issues/7657#issuecomment-2521083323
# When Ruby ships with `gem --version` 3.6.0 or higher by default this can be removed
spec . add_runtime_dependency 'stringio' , '3.1.1'
2025-08-21 11:47:42 +02:00
# Needed for caching validation
spec . add_runtime_dependency 'parallel'
2026-04-16 11:07:28 +02:00
spec . add_runtime_dependency 'mcp' , '0.13.0'
2024-05-23 12:23:27 +01:00
# Standard libraries: https://www.ruby-lang.org/en/news/2023/12/25/ruby-3-3-0-released/
%w[
abbrev
base64
2025-01-06 16:41:23 +00:00
benchmark
2024-05-23 12:23:27 +01:00
bigdecimal
csv
drb
2025-01-06 16:41:23 +00:00
fiddle
2024-05-23 12:23:27 +01:00
getoptlong
mutex_m
2025-01-06 16:41:23 +00:00
ostruct
2025-04-02 15:48:42 +01:00
rinda
2025-06-29 15:57:53 +01:00
syslog
2024-05-23 12:23:27 +01:00
] . each do | library |
spec . add_runtime_dependency library
end
2014-08-15 11:33:31 -05:00
end