Merge branch 'master' of https://github.com/rapid7/metasploit-framework
commit
b8ce98b896
1
Gemfile
1
Gemfile
|
@ -23,6 +23,7 @@ group :db do
|
|||
end
|
||||
|
||||
group :pcap do
|
||||
gem 'network_interface', '~> 0.0.1'
|
||||
# For sniffer and raw socket modules
|
||||
gem 'pcaprub'
|
||||
end
|
||||
|
|
|
@ -31,6 +31,7 @@ GEM
|
|||
metaclass (~> 0.0.1)
|
||||
msgpack (0.5.4)
|
||||
multi_json (1.0.4)
|
||||
network_interface (0.0.1)
|
||||
nokogiri (1.5.9)
|
||||
packetfu (1.1.8)
|
||||
pcaprub (0.11.3)
|
||||
|
@ -68,6 +69,7 @@ DEPENDENCIES
|
|||
json
|
||||
metasploit_data_models (~> 0.16.1)
|
||||
msgpack
|
||||
network_interface (~> 0.0.1)
|
||||
nokogiri
|
||||
packetfu (= 1.1.8)
|
||||
pcaprub
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -793,49 +793,6 @@ module Text
|
|||
buf << "\n"
|
||||
end
|
||||
|
||||
#
|
||||
# Converts a string a nicely formatted and addressed ex dump
|
||||
#
|
||||
def self.to_addr_hex_dump(str, start_addr=0, width=16)
|
||||
buf = ''
|
||||
idx = 0
|
||||
cnt = 0
|
||||
snl = false
|
||||
lst = 0
|
||||
addr = start_addr
|
||||
|
||||
while (idx < str.length)
|
||||
|
||||
buf << "%08x" % addr
|
||||
buf << " " * 4
|
||||
chunk = str[idx, width]
|
||||
line = chunk.unpack("H*")[0].scan(/../).join(" ")
|
||||
buf << line
|
||||
|
||||
if (lst == 0)
|
||||
lst = line.length
|
||||
buf << " " * 4
|
||||
else
|
||||
buf << " " * ((lst - line.length) + 4).abs
|
||||
end
|
||||
|
||||
chunk.unpack("C*").each do |c|
|
||||
if (c > 0x1f and c < 0x7f)
|
||||
buf << c.chr
|
||||
else
|
||||
buf << "."
|
||||
end
|
||||
end
|
||||
|
||||
buf << "\n"
|
||||
|
||||
idx += width
|
||||
addr += width
|
||||
end
|
||||
|
||||
buf << "\n"
|
||||
end
|
||||
|
||||
#
|
||||
# Converts a hex string to a raw string
|
||||
#
|
||||
|
|
|
@ -184,7 +184,7 @@ class Metasploit3 < Msf::Auxiliary
|
|||
|
||||
print_status("#{rhost}:#{rport} - Recovering Hashes...")
|
||||
json_info["result"]["resultSet"].each { |result|
|
||||
vprint_good("#{rhost}:#{rport} - Found cred: #{result["username"]}:#{result["password"]}")
|
||||
print_good("#{rhost}:#{rport} - Found cred: #{result["username"]}:#{result["password"]}")
|
||||
report_auth_info(
|
||||
:host => rhost,
|
||||
:port => rport,
|
||||
|
|
|
@ -44,7 +44,7 @@ class Metasploit3 < Msf::Auxiliary
|
|||
|
||||
@netifaces = true
|
||||
if not netifaces_implemented?
|
||||
print_error("WARNING : Pcaprub is not uptodate, some functionality will not be available")
|
||||
print_error("WARNING : NetworkInterface is not up-to-date, some functionality will not be available")
|
||||
@netifaces = false
|
||||
end
|
||||
|
||||
|
|
|
@ -23,37 +23,40 @@ $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
|
|||
|
||||
if RUBY_PLATFORM == "i386-mingw32"
|
||||
begin
|
||||
require 'pcaprub'
|
||||
require 'network_interface'
|
||||
rescue ::Exception => e
|
||||
$stderr.puts "Error: pcaprub is not installed..."
|
||||
$stderr.puts "Error: NetworkInterface is not installed..."
|
||||
exit
|
||||
end
|
||||
unless (Pcap.respond_to?(:lookupaddrs) and
|
||||
Pcap.respond_to?(:interfaces) and
|
||||
Pcap.respond_to?(:addresses))
|
||||
$stderr.puts "Error: Looks like you are not running the latest version of pcaprub"
|
||||
|
||||
unless (
|
||||
NetworkInterface.respond_to?(:interfaces) and
|
||||
NetworkInterface.respond_to?(:addresses) and
|
||||
NetworkInterface.respond_to?(:interface_info)
|
||||
)
|
||||
$stderr.puts "Error: Looks like you are not running the latest version of NetworkInterface"
|
||||
exit
|
||||
end
|
||||
found = false
|
||||
Pcap.interfaces.each_with_index do |iface, i|
|
||||
NetworkInterface.interfaces.each_with_index do |iface, i|
|
||||
found = true
|
||||
detail = Pcap.interface_info(iface)
|
||||
addr = Pcap.addresses(iface)
|
||||
detail = NetworkInterface.interface_info(iface)
|
||||
addr = NetworkInterface.addresses(iface)
|
||||
puts "#" * 70
|
||||
puts ""
|
||||
puts "INDEX : " + (i + 1).to_s
|
||||
puts "NAME : " + detail["name"]
|
||||
puts "DESCRIPTION : " + detail["description"]
|
||||
puts "GUID : " + detail["guid"]
|
||||
if addr[Pcap::AF_LINK][0]['addr']
|
||||
puts "MAC ADDRESSE : #{addr[Pcap::AF_LINK][0]['addr']}"
|
||||
if addr[NetworkInterface::AF_LINK][0]['addr']
|
||||
puts "MAC ADDRESS : #{addr[NetworkInterface::AF_LINK][0]['addr']}"
|
||||
else
|
||||
puts "MAC ADDRESSE : NONE"
|
||||
puts "MAC ADDRESS : NONE"
|
||||
end
|
||||
if addr[Pcap::AF_INET][0]['addr'] and addr[Pcap::AF_INET][0]['netmask']
|
||||
puts "IP ADDRESSE : #{addr[Pcap::AF_INET][0]['addr']}/#{addr[Pcap::AF_INET][0]['netmask']}"
|
||||
if addr[NetworkInterface::AF_INET][0]['addr'] and addr[NetworkInterface::AF_INET][0]['netmask']
|
||||
puts "IP ADDRESS : #{addr[NetworkInterface::AF_INET][0]['addr']}/#{addr[NetworkInterface::AF_INET][0]['netmask']}"
|
||||
else
|
||||
puts "IP ADDRESSE : NONE"
|
||||
puts "IP ADDRESS : NONE"
|
||||
end
|
||||
puts ""
|
||||
end
|
||||
|
@ -63,8 +66,6 @@ if RUBY_PLATFORM == "i386-mingw32"
|
|||
$stderr.puts "Error, no network interfaces have been detected"
|
||||
end
|
||||
else
|
||||
$stderr.puts "Error: This script is usefull only on Windows, under other OS just use the built-in commands (ifconfig, ip link show, ...)"
|
||||
$stderr.puts "Error: This script is useful only on Windows, under other OS just use the built-in commands (ifconfig, ip link show, ...)"
|
||||
exit
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue