Files
beef/extensions/requester/models/http.rb
2022-01-22 11:16:12 +00:00

32 lines
858 B
Ruby

#
# Copyright (c) 2006-2022 Wade Alcorn - wade@bindshell.net
# Browser Exploitation Framework (BeEF) - http://beefproject.com
# See the file 'doc/COPYING' for copying permission
#
module BeEF
module Core
module Models
#
# Table stores the http requests and responses from the requester.
#
class Http < BeEF::Core::Model
#
# Removes a request/response from the data store
#
def self.delete(id)
if id.to_s !~ /\A\d+\z/
(print_error 'Failed to remove response. Invalid response ID.'
return)
end
r = BeEF::Core::Models::Http.find(id.to_i)
if r.nil?
(print_error "Failed to remove response [id: #{id}]. Response does not exist."
return)
end
r.destroy
end
end
end
end
end