/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/msf/core/payload/custom.rb
30 строк
794 B
bwatters
Add custom session types and minor cleanups
07 сен 2022, 23:43
Не верифицирован
07 сен 2022, 23:43
07aa024
Код
Авторство
О чём код?
# -*- coding => binary -*- # module Msf::Payload::Custom def stage_payload(_opts = {}) return nil if datastore['SHELLCODE_FILE'].blank? File.binread(datastore['SHELLCODE_FILE']) end def setup_handler if datastore['SHELLCODE_FILE'].blank? fail_with(Msf::Module::Failure::BadConfig, "No SHELLCODE_FILE provided") end begin # read the file before we start the handler to make sure that it is valid test = File.binread(datastore['SHELLCODE_FILE']) rescue => e print_error("Unable to read #{datastore['SHELLCODE_FILE']}:") elog("Unable to read #{datastore['SHELLCODE_FILE']}:", error: e) fail_with(Msf::Module::Failure::BadConfig, "Bad SHELLCODE_FILE provided") end super end def read_stage_size? true end end