Skip to content

Commit

Permalink
Add Ruby 3.3.0-preview1 to test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Jun 28, 2023
1 parent 0c8dff1 commit da0ff24
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/verify.yml
Expand Up @@ -64,10 +64,10 @@ jobs:
fail-fast: true
matrix:
ruby:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3.0-preview1'
os:
- ubuntu-20.04
- ubuntu-latest
Expand Down Expand Up @@ -99,6 +99,8 @@ jobs:
- name: Setup Ruby
env:
BUNDLE_WITHOUT: "coverage development pcap"
# Nokogiri doesn't release pre-compiled binaries for preview versions of Ruby; So force compilation with BUNDLE_FORCE_RUBY_PLATFORM
BUNDLE_FORCE_RUBY_PLATFORM: "${{ contains(matrix.ruby, 'preview') && 'true' || 'false' }}"
uses: ruby/setup-ruby@v1
with:
ruby-version: '${{ matrix.ruby }}'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -298,8 +298,8 @@ GEM
openssl-ccm (1.2.3)
openssl-cmac (2.0.2)
openvas-omp (0.0.4)
packetfu (1.1.13)
pcaprub
packetfu (2.0.0)
pcaprub (~> 0.13.1)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/msf/util/windows_crypto_helpers.rb
Expand Up @@ -79,7 +79,7 @@ def decrypt_secret_data(secret, key)
j = key[j..j+7].length
end
end
dec_data_len = decrypted_data[0,4].unpack('<L').first
dec_data_len = decrypted_data[0,4].unpack('L<').first

return decrypted_data[8, dec_data_len]

Expand Down
2 changes: 1 addition & 1 deletion lib/net/dns/rr.rb
Expand Up @@ -75,7 +75,7 @@ class RR
Net::DNS::RR::Classes.regexp +
"|CLASS\\d+)?\\s*(" +
Net::DNS::RR::Types.regexp +
"|TYPE\\d+)?\\s*(.*)$", Regexp::IGNORECASE, 'n')
"|TYPE\\d+)?\\s*(.*)$", Regexp::IGNORECASE | Regexp::NOENCODING)

# Dimension of the sum of class, type, TTL and rdlength fields in a
# RR portion of the packet, in bytes
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/proto/dcerpc/handle.rb
Expand Up @@ -24,7 +24,7 @@ def self.parse (handle)
uuid_re = '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'
rev_re = '\d+.\d+'
proto_re = '(?:' + @@protocols.join('|') + ')'
re = Regexp.new("(#{uuid_re}):(#{rev_re})\@(#{proto_re}):(.*?)\\[(.*)\\]$", true, 'n')
re = Regexp.new("(#{uuid_re}):(#{rev_re})\@(#{proto_re}):(.*?)\\[(.*)\\]$", Regexp::IGNORECASE | Regexp::NOENCODING)
match = re.match(handle)
raise ArgumentError if !match

Expand Down
6 changes: 3 additions & 3 deletions modules/auxiliary/scanner/http/soap_xml.rb
Expand Up @@ -119,9 +119,9 @@ def run_host(ip)

# regular expressions for common rejection messages
reject_regexen = []
reject_regexen << Regexp.new('method \\S+ is not valid', true)
reject_regexen << Regexp.new('Method \\S+ not implemented', true)
reject_regexen << Regexp.new('unable to resolve WSDL method name', true)
reject_regexen << Regexp.new('method \\S+ is not valid', Regexp::IGNORECASE)
reject_regexen << Regexp.new('Method \\S+ not implemented', Regexp::IGNORECASE)
reject_regexen << Regexp.new('unable to resolve WSDL method name', Regexp::IGNORECASE)

print_status("Starting scan with #{datastore['SLEEP']}ms delay between requests")
verbs.each do |v|
Expand Down
Expand Up @@ -113,7 +113,7 @@ def getprocparam(rhost)
)
print_good("#{rhost}:#{rport} [SAP] Process Parameters: Entries extracted to #{loot}")
else
name_match = Regexp.new(datastore['MATCH'], [Regexp::EXTENDED, 'n'])
name_match = Regexp.new(datastore['MATCH'], Regexp::EXTENDED | Regexp::NOENCODING)
print_status("[SAP] Regex match selected, skipping loot storage")
print_status("#{rhost}:#{rport} [SAP] Attempting to display configuration matches for #{name_match}")

Expand Down
Expand Up @@ -106,7 +106,7 @@ def process_get(cli, request)
webdav_loc = "\\\\#{@my_host}\\#{@random_dir}\\#{@payload}"
@url_base = "http://" + @my_host

if (Regexp.new(Regexp.escape(@payload)+'$', true).match(request.uri))
if (Regexp.new(Regexp.escape(@payload)+'$', Regexp::IGNORECASE).match(request.uri))
print_status "Sending payload executable to target ..."
return if ((p = regenerate_payload(cli)) == nil)
data = generate_payload_exe({ :code => p.encoded })
Expand Down Expand Up @@ -252,7 +252,7 @@ def process_options(cli, request)
end

def convert_to_char_code(str)
return str.unpack('H*')[0].gsub(Regexp.new(".{#{2}}", nil, 'n')) { |s| s.hex.to_s + "," }.chop
return str.unpack('H*')[0].gsub(Regexp.new(".{#{2}}", Regexp::NOENCODING)) { |s| s.hex.to_s + "," }.chop
end
#
# PROPFIND requests sent by the WebDav Mini-Redirector
Expand All @@ -262,7 +262,7 @@ def process_propfind(cli, request)
print_status("Received WebDAV PROPFIND request")
body = ''

if (Regexp.new(Regexp.escape(@payload)+'$', true).match(path))
if Regexp.new(Regexp.escape(@payload)+'$', Regexp::IGNORECASE).match(path)
# Response for the EXE
print_status("Sending EXE multistatus for #{path} ...")
#<lp1:getcontentlength>45056</lp1:getcontentlength>
Expand Down
2 changes: 1 addition & 1 deletion modules/exploits/windows/http/httpdx_tolog_format.rb
Expand Up @@ -161,7 +161,7 @@ def exploit
fail_with(Failure::Unknown, "The server doesn't appear to be running a vulnerable version of HTTPDX")
end

re = Regexp.new(Regexp.escape(version)+' - ', true)
re = Regexp.new(Regexp.escape(version)+' - ', Regexp::IGNORECASE)
self.targets.each do |t|
if (re.match(t.name))
mytarget = t
Expand Down
5 changes: 2 additions & 3 deletions spec/api/json_rpc_spec.rb
Expand Up @@ -294,8 +294,7 @@ def mock_rack_env(mock_rack_env_value)

before(:each) do
allow_any_instance_of(::Msf::Auxiliary::Scanner).to receive(:check) do
res = nil
res.body
raise 'Unexpected module error'
end
end

Expand All @@ -316,7 +315,7 @@ def mock_rack_env(mock_rack_env_value)
expected_error_response = {
result: {
status: 'errored',
error: "undefined method `body' for nil:NilClass"
error: "Unexpected module error"
}
}
expect(last_json_response).to include(expected_error_response)
Expand Down

0 comments on commit da0ff24

Please sign in to comment.