Module: Rex::Proto::Kademlia

Included in:
Msf::Auxiliary::Kademlia
Defined in:
lib/rex/proto/kademlia/message.rb,
lib/rex/proto/kademlia.rb,
lib/rex/proto/kademlia/ping.rb,
lib/rex/proto/kademlia/pong.rb,
lib/rex/proto/kademlia/bootstrap_request.rb,
lib/rex/proto/kademlia/bootstrap_response.rb

Overview

Minimal support for the newer Kademlia protocol, referred to here and often elsewhere as Kademlia2. It is unclear how this differs from the old protocol.

Protocol details are hard to come by because most documentation is academic in nature and glosses over the low-level network details. The best documents I found on the protocol are:

gbmaster.wordpress.com/2013/05/05/botnets-surrounding-us-an-initial-focus-on-kad/ gbmaster.wordpress.com/2013/06/16/botnets-surrounding-us-sending-kademlia2_bootstrap_req-kademlia2_hello_req-and-their-strict-cousins/ gbmaster.wordpress.com/2013/11/23/botnets-surrounding-us-performing-requests-sending-out-kademlia2_req-and-asking-contact-where-art-thou/

Defined Under Namespace

Modules: Util Classes: BootstrapRequest, BootstrapResponse, Message, Ping, Pong

Constant Summary collapse

PING =

Opcode for a PING request

0x60
PONG =

Opcode for a PING response

0x61
BOOTSTRAP_REQUEST =

Opcode for a BOOTSTRAP request

0x01
BOOTSTRAP_RESPONSE =

Opcode for a bootstrap response

0x09

Class Method Summary collapse

Class Method Details

.decode_peer_id(bytes) ⇒ String

Deprecated.

Access via Rex::Proto::Kademlia::Util

Decodes an on-the-wire representation of a Kademlia peer to its 16-character hex equivalent

Parameters:

  • bytes (String)

    the on-the-wire representation of a Kademlia peer

Returns:

  • (String)

    the peer ID if valid, nil otherwise


9
10
11
# File 'lib/rex/proto/kademlia.rb', line 9

def self.decode_peer_id(bytes)
  Util.decode_peer_id(bytes)
end