what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Gather Kademlia Server Information

Gather Kademlia Server Information
Posted Aug 31, 2024
Authored by Jon Hart | Site metasploit.com

This Metasploit module uses the Kademlia BOOTSTRAP and PING messages to identify and extract information from Kademlia speaking UDP endpoints, typically belonging to eMule/eDonkey/BitTorrent servers or other P2P applications.

tags | exploit, udp
SHA-256 | eba8248b7c5e0ccdd26ca05535b352545a47360c55fc0541e56ac36a0e461848

Gather Kademlia Server Information

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Auxiliary::UDPScanner
include Msf::Auxiliary::Kademlia

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Gather Kademlia Server Information',
'Description' => %q(
This module uses the Kademlia BOOTSTRAP and PING messages to identify
and extract information from Kademlia speaking UDP endpoints,
typically belonging to eMule/eDonkey/BitTorrent servers or other P2P
applications.
),
'Author' => 'Jon Hart <jon_hart[at]rapid7.com>',
'References' =>
[
# There are lots of academic papers on the protocol but they tend to lack usable
# protocol details. This is the best I've found
['URL', 'https://gbmaster.wordpress.com/2013/06/16/botnets-surrounding-us-sending-kademlia2_bootstrap_req-kademlia2_hello_req-and-their-strict-cousins/#more-125']
],
'License' => MSF_LICENSE,
'Actions' => [
['BOOTSTRAP', 'Description' => 'Use a Kademlia2 BOOTSTRAP'],
['PING', 'Description' => 'Use a Kademlia2 PING']
],
'DefaultAction' => 'BOOTSTRAP'
)
)

register_options(
[
Opt::RPORT(4672)
])
end

def build_probe
@probe ||= case action.name
when 'BOOTSTRAP'
BootstrapRequest.new
when 'PING'
Ping.new
end
end

def scanner_process(response, src_host, src_port)
return if response.blank?
peer = "#{src_host}:#{src_port}"

case action.name
when 'BOOTSTRAP'
if bootstrap_res = BootstrapResponse.from_data(response)
info = {
peer_id: bootstrap_res.peer_id,
tcp_port: bootstrap_res.tcp_port,
version: bootstrap_res.version,
peers: bootstrap_res.peers
}
print_good("#{peer} ID #{bootstrap_res.peer_id}, TCP port #{bootstrap_res.tcp_port}," +
" version #{bootstrap_res.version}, #{bootstrap_res.peers.size} peers")
end
when 'PING'
if pong = Pong.from_data(response)
print_good("#{peer} PONG port #{pong.port}")
# port should match the port we contacted it from. TODO: validate this?
info = { udp_port: pong.port }
end
end

return unless info
@results[src_host] ||= []
@results[src_host] << info
end

def scanner_postscan(_batch)
@results.each_pair do |host, info|
report_host(host: host)
report_service(
host: host,
proto: 'udp',
port: rport,
name: 'kademlia',
info: info
)
end
end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close