/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/rex/proto/http/server_client.rb
64 строки
1 KB
OJ Reeves
Add C2 custom header support in responses
16 июл 2026, 19:56
16 июл 2026, 19:56
25dd709
Код
Авторство
О чём код?
# -*- coding: binary -*- require 'rex/socket' module Rex module Proto module Http ### # # Runtime extension of the HTTP clients that connect to the server. # ### module ServerClient # # Initialize a new request instance. # def init_cli(server) self.request = Request.new self.server = server self.keepalive = false end # # Resets the parsing state. # def reset_cli self.request.reset end # # Transmits a response and adds the appropriate headers. # def send_response(response) # Set the connection to close or keep-alive depending on what the client # can support. response['Connection'] = (keepalive) ? 'Keep-Alive' : 'close' # Add any other standard response headers. server.add_response_headers(self.request, response) # Send it off. put(response.to_s) end # # The current request context. # attr_accessor :request # # Boolean that indicates whether or not the connection supports keep-alive. # attr_accessor :keepalive # # A reference to the server the client is associated with. # attr_accessor :server end end end end