Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
certcc-ghbot committed Sep 5, 2024
2 parents d1cbcc3 + 6f1acf4 commit 3651344
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
metasploit-framework (6.4.25)
metasploit-framework (6.4.26)
aarch64
abbrev
actionpack (~> 7.0.0)
Expand Down
22 changes: 11 additions & 11 deletions LICENSE_GEMS
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ bigdecimal, 3.1.8, "ruby, Simplified BSD"
bindata, 2.4.15, "Simplified BSD"
bootsnap, 1.18.3, MIT
bson, 5.0.0, "Apache 2.0"
builder, 3.2.4, MIT
bundler, 2.1.4, MIT
builder, 3.3.0, MIT
bundler, 2.2.3, MIT
byebug, 11.1.3, "Simplified BSD"
chunky_png, 1.4.0, MIT
coderay, 1.1.3, MIT
concurrent-ruby, 1.3.1, MIT
concurrent-ruby, 1.3.4, MIT
cookiejar, 0.3.4, "Simplified BSD"
crass, 1.0.6, MIT
csv, 3.3.0, "ruby, Simplified BSD"
Expand All @@ -50,7 +50,7 @@ drb, 2.2.1, "ruby, Simplified BSD"
ed25519, 1.3.0, MIT
em-http-request, 1.1.7, MIT
em-socksify, 0.3.2, MIT
erubi, 1.12.0, MIT
erubi, 1.13.0, MIT
eventmachine, 1.2.7, "ruby, GPL-2.0"
factory_bot, 6.4.6, MIT
factory_bot_rails, 6.4.3, MIT
Expand Down Expand Up @@ -86,7 +86,7 @@ memory_profiler, 1.0.1, MIT
metasm, 1.0.5, LGPL-2.1
metasploit-concern, 5.0.2, "New BSD"
metasploit-credential, 6.0.9, "New BSD"
metasploit-framework, 6.4.25, "New BSD"
metasploit-framework, 6.4.26, "New BSD"
metasploit-model, 5.0.2, "New BSD"
metasploit-payloads, 2.0.166, "3-clause (or ""modified"") BSD"
metasploit_data_models, 6.0.3, "New BSD"
Expand All @@ -95,7 +95,7 @@ method_source, 1.1.0, MIT
mime-types, 3.5.2, MIT
mime-types-data, 3.2024.0604, MIT
mini_portile2, 2.8.7, MIT
minitest, 5.23.1, MIT
minitest, 5.25.1, MIT
mqtt, 0.6.0, MIT
msgpack, 1.6.1, "Apache 2.0"
multi_json, 1.15.0, MIT
Expand All @@ -111,7 +111,7 @@ net-ssh, 7.2.3, MIT
network_interface, 0.0.4, MIT
nexpose, 7.3.0, "New BSD"
nio4r, 2.7.3, "MIT, Simplified BSD"
nokogiri, 1.16.5, MIT
nokogiri, 1.16.7, MIT
nori, 2.7.0, MIT
octokit, 4.25.1, MIT
openssl-ccm, 1.2.3, MIT
Expand All @@ -128,7 +128,7 @@ pry, 0.14.2, MIT
pry-byebug, 3.10.1, MIT
public_suffix, 5.0.5, MIT
puma, 6.4.2, "New BSD"
racc, 1.8.0, "ruby, Simplified BSD"
racc, 1.8.1, "ruby, Simplified BSD"
rack, 2.2.9, MIT
rack-protection, 3.2.0, MIT
rack-test, 2.1.0, MIT
Expand Down Expand Up @@ -166,9 +166,9 @@ rexml, 3.3.6, "Simplified BSD"
rkelly-remix, 0.0.7, MIT
rspec, 3.13.0, MIT
rspec-core, 3.13.0, MIT
rspec-expectations, 3.13.0, MIT
rspec-expectations, 3.13.2, MIT
rspec-mocks, 3.13.1, MIT
rspec-rails, 6.1.2, MIT
rspec-rails, 6.1.4, MIT
rspec-rerun, 1.1.0, MIT
rspec-support, 3.13.1, MIT
rubocop, 1.64.1, MIT
Expand Down Expand Up @@ -215,4 +215,4 @@ winrm, 2.3.6, "Apache 2.0"
xdr, 3.0.3, "Apache 2.0"
xmlrpc, 0.3.3, "ruby, Simplified BSD"
yard, 0.9.36, MIT
zeitwerk, 2.6.15, MIT
zeitwerk, 2.6.17, MIT
34 changes: 34 additions & 0 deletions db/modules_metadata_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -63737,6 +63737,40 @@
"session_types": false,
"needs_cleanup": false
},
"encoder_php/minify": {
"name": "PHP Minify Encoder",
"fullname": "encoder/php/minify",
"aliases": [

],
"rank": 500,
"disclosure_date": null,
"type": "encoder",
"author": [
"Julien Voisin"
],
"description": "This encoder minifies a PHP payload by removing leasing spaces, trailing\n new lines, comments, …",
"references": [

],
"platform": "All",
"arch": "php",
"rport": null,
"autofilter_ports": null,
"autofilter_services": null,
"targets": null,
"mod_time": "2024-09-01 22:53:17 +0000",
"path": "/modules/encoders/php/minify.rb",
"is_install_path": true,
"ref_name": "php/minify",
"check": false,
"post_auth": false,
"default_credential": false,
"notes": {
},
"session_types": false,
"needs_cleanup": false
},
"encoder_ppc/longxor": {
"name": "PPC LongXOR Encoder",
"fullname": "encoder/ppc/longxor",
Expand Down
2 changes: 1 addition & 1 deletion lib/metasploit/framework/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.get_hash
end
end

VERSION = "6.4.25"
VERSION = "6.4.26"
MAJOR, MINOR, PATCH = VERSION.split('.').map { |x| x.to_i }
PRERELEASE = 'dev'
HASH = get_hash
Expand Down
42 changes: 42 additions & 0 deletions modules/encoders/php/minify.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Encoder
Rank = GreatRanking

def initialize
super(
'Name' => 'PHP Minify Encoder',
'Description' => %q{
This encoder minifies a PHP payload by removing leasing spaces, trailing
new lines, comments, …
},
'Author' => 'Julien Voisin',
'License' => BSD_LICENSE,
'Arch' => ARCH_PHP)
end

def encode_block(_, buf)
# Remove comments
buf.gsub!(/^\s*#.*$/, '')

# Remove spaces after keywords
buf.gsub!(/^\s*(if|else|elsif|while|for|foreach)\s*\(/, '\1(')

# Remove spaces before block opening
buf.gsub!(/\s*{$/, '{')

# Remove empty lines
buf.squeeze!("\n")

# Remove leading/trailing spaces
buf.gsub!(/^[ \t]+/, '')

# Remove new lines
buf.gsub!(/([;{}])\n/, '\1')

return buf
end
end

0 comments on commit 3651344

Please sign in to comment.