Module: Msf::Exploit::Remote::Kerberos::Ticket::Storage::WriteMixin
- Defined in:
- lib/msf/core/exploit/remote/kerberos/ticket/storage/write_mixin.rb
Overview
A mixin providing the ability to store new and delete existing tickets.
Instance Method Summary collapse
-
#activate_ccache(ids:) ⇒ Array<StoredTicket>
Mark ccache(s) as active.
-
#deactivate_ccache(ids:) ⇒ Array<StoredTicket>
Mark ccache(s) as inactive.
-
#delete_tickets(options = {}) ⇒ Array<StoredTicket>
Delete tickets matching the options query.
-
#store_ccache(ccache, options = {}) ⇒ Hash
Store the specified object.
Instance Method Details
#activate_ccache(ids:) ⇒ Array<StoredTicket>
Mark ccache(s) as active
50 51 52 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/write_mixin.rb', line 50 def activate_ccache(ids:) set_ccache_status(ids: ids, status: 'active') end |
#deactivate_ccache(ids:) ⇒ Array<StoredTicket>
Mark ccache(s) as inactive
45 46 47 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/write_mixin.rb', line 45 def deactivate_ccache(ids:) set_ccache_status(ids: ids, status: 'inactive') end |
#delete_tickets(options = {}) ⇒ Array<StoredTicket>
Delete tickets matching the options query.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/write_mixin.rb', line 5 def delete_tickets( = {}) if .keys == [:ids] # skip calling #objects which issues a query when the IDs are specified ids = [:ids] else ids = objects().map(&:id) end framework.db.delete_loot(ids: ids).map do |stored_loot| StoredTicket.new(stored_loot) end end |
#store_ccache(ccache, options = {}) ⇒ Hash
Store the specified object.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/msf/core/exploit/remote/kerberos/ticket/storage/write_mixin.rb', line 19 def store_ccache(ccache, = {}) realm = .fetch(:realm) { ccache.default_principal.realm } # use #components.to_a.join('/') to omit the realm that #to_s includes client = .fetch(:client) { ccache.credentials.first&.client&.components.to_a.join('/') } server = .fetch(:server) { ccache.credentials.first&.server&.components.to_a.join('/') } info = generate_info_string(realm: realm, client: client, server: server) loot = nil path = store_loot('mit.kerberos.ccache', 'application/octet-stream', [:host], ccache.encode, nil, info) do |mdm_loot| loot = mdm_loot end = '' if @framework_module.respond_to?(:peer) && @framework_module.peer.present? && @framework_module.peer != ':' << "#{@framework_module.peer} - " end if server && server.to_s.downcase.start_with?('krbtgt/') << 'TGT ' else << 'TGS ' end << "MIT Credential Cache ticket saved to #{path}" print_status() { path: path, loot: loot } end |