/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
spec/acceptance/ssh_spec.rb
51 строка
1 KB
adfoster-r7
Reduce boileplate in session protocol acceptance tests
01 июл 2026, 16:19
01 июл 2026, 16:19
0b33e84
Код
Авторство
О чём код?
# frozen_string_literal: true require 'acceptance_spec_helper' RSpec.describe 'SSH sessions and SSH modules' do include_context 'protocol_session_acceptance' tests = { ssh: { target: { session_module: 'auxiliary/scanner/ssh/ssh_login', type: 'SSH', platforms: %i[linux osx windows], session_info_pattern: /SSH #{Regexp.escape(ENV.fetch('SSH_USERNAME', 'acceptance_tests_user'))} @ \d+\.\d+\.\d+\.\d+/, datastore: { global: {}, module: { username: ENV.fetch('SSH_USERNAME', 'acceptance_tests_user'), password: ENV.fetch('SSH_PASSWORD', 'acceptance_tests_password'), rhost: ENV.fetch('SSH_RHOST', '127.0.0.1'), rport: ENV.fetch('SSH_RPORT', '2222'), } } }, module_tests: [ { name: 'post/test/unix', platforms: %i[linux osx], targets: [:session], skipped: false, }, { name: 'auxiliary/scanner/ssh/ssh_version', platforms: %i[linux osx windows], targets: [:rhost], skipped: false, lines: { all: { required: [ /SSH server version: SSH-\d+\.\d+-/, ] }, } }, ] } } # SSH shell sessions don't require a feature flag run_protocol_session_tests(tests) end