Merge branch 'master' of https://github.com/rapid7/metasploit-framework
commit
b8ce98b896
1
Gemfile
1
Gemfile
|
@ -23,6 +23,7 @@ group :db do
|
||||||
end
|
end
|
||||||
|
|
||||||
group :pcap do
|
group :pcap do
|
||||||
|
gem 'network_interface', '~> 0.0.1'
|
||||||
# For sniffer and raw socket modules
|
# For sniffer and raw socket modules
|
||||||
gem 'pcaprub'
|
gem 'pcaprub'
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,6 +31,7 @@ GEM
|
||||||
metaclass (~> 0.0.1)
|
metaclass (~> 0.0.1)
|
||||||
msgpack (0.5.4)
|
msgpack (0.5.4)
|
||||||
multi_json (1.0.4)
|
multi_json (1.0.4)
|
||||||
|
network_interface (0.0.1)
|
||||||
nokogiri (1.5.9)
|
nokogiri (1.5.9)
|
||||||
packetfu (1.1.8)
|
packetfu (1.1.8)
|
||||||
pcaprub (0.11.3)
|
pcaprub (0.11.3)
|
||||||
|
@ -68,6 +69,7 @@ DEPENDENCIES
|
||||||
json
|
json
|
||||||
metasploit_data_models (~> 0.16.1)
|
metasploit_data_models (~> 0.16.1)
|
||||||
msgpack
|
msgpack
|
||||||
|
network_interface (~> 0.0.1)
|
||||||
nokogiri
|
nokogiri
|
||||||
packetfu (= 1.1.8)
|
packetfu (= 1.1.8)
|
||||||
pcaprub
|
pcaprub
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -793,49 +793,6 @@ module Text
|
||||||
buf << "\n"
|
buf << "\n"
|
||||||
end
|
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
|
# Converts a hex string to a raw string
|
||||||
#
|
#
|
||||||
|
|
|
@ -184,7 +184,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
print_status("#{rhost}:#{rport} - Recovering Hashes...")
|
print_status("#{rhost}:#{rport} - Recovering Hashes...")
|
||||||
json_info["result"]["resultSet"].each { |result|
|
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(
|
report_auth_info(
|
||||||
:host => rhost,
|
:host => rhost,
|
||||||
:port => rport,
|
:port => rport,
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
|
|
||||||
@netifaces = true
|
@netifaces = true
|
||||||
if not netifaces_implemented?
|
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
|
@netifaces = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,37 +23,40 @@ $:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
|
||||||
|
|
||||||
if RUBY_PLATFORM == "i386-mingw32"
|
if RUBY_PLATFORM == "i386-mingw32"
|
||||||
begin
|
begin
|
||||||
require 'pcaprub'
|
require 'network_interface'
|
||||||
rescue ::Exception => e
|
rescue ::Exception => e
|
||||||
$stderr.puts "Error: pcaprub is not installed..."
|
$stderr.puts "Error: NetworkInterface is not installed..."
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
unless (Pcap.respond_to?(:lookupaddrs) and
|
|
||||||
Pcap.respond_to?(:interfaces) and
|
unless (
|
||||||
Pcap.respond_to?(:addresses))
|
NetworkInterface.respond_to?(:interfaces) and
|
||||||
$stderr.puts "Error: Looks like you are not running the latest version of pcaprub"
|
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
|
exit
|
||||||
end
|
end
|
||||||
found = false
|
found = false
|
||||||
Pcap.interfaces.each_with_index do |iface, i|
|
NetworkInterface.interfaces.each_with_index do |iface, i|
|
||||||
found = true
|
found = true
|
||||||
detail = Pcap.interface_info(iface)
|
detail = NetworkInterface.interface_info(iface)
|
||||||
addr = Pcap.addresses(iface)
|
addr = NetworkInterface.addresses(iface)
|
||||||
puts "#" * 70
|
puts "#" * 70
|
||||||
puts ""
|
puts ""
|
||||||
puts "INDEX : " + (i + 1).to_s
|
puts "INDEX : " + (i + 1).to_s
|
||||||
puts "NAME : " + detail["name"]
|
puts "NAME : " + detail["name"]
|
||||||
puts "DESCRIPTION : " + detail["description"]
|
puts "DESCRIPTION : " + detail["description"]
|
||||||
puts "GUID : " + detail["guid"]
|
puts "GUID : " + detail["guid"]
|
||||||
if addr[Pcap::AF_LINK][0]['addr']
|
if addr[NetworkInterface::AF_LINK][0]['addr']
|
||||||
puts "MAC ADDRESSE : #{addr[Pcap::AF_LINK][0]['addr']}"
|
puts "MAC ADDRESS : #{addr[NetworkInterface::AF_LINK][0]['addr']}"
|
||||||
else
|
else
|
||||||
puts "MAC ADDRESSE : NONE"
|
puts "MAC ADDRESS : NONE"
|
||||||
end
|
end
|
||||||
if addr[Pcap::AF_INET][0]['addr'] and addr[Pcap::AF_INET][0]['netmask']
|
if addr[NetworkInterface::AF_INET][0]['addr'] and addr[NetworkInterface::AF_INET][0]['netmask']
|
||||||
puts "IP ADDRESSE : #{addr[Pcap::AF_INET][0]['addr']}/#{addr[Pcap::AF_INET][0]['netmask']}"
|
puts "IP ADDRESS : #{addr[NetworkInterface::AF_INET][0]['addr']}/#{addr[NetworkInterface::AF_INET][0]['netmask']}"
|
||||||
else
|
else
|
||||||
puts "IP ADDRESSE : NONE"
|
puts "IP ADDRESS : NONE"
|
||||||
end
|
end
|
||||||
puts ""
|
puts ""
|
||||||
end
|
end
|
||||||
|
@ -63,8 +66,6 @@ if RUBY_PLATFORM == "i386-mingw32"
|
||||||
$stderr.puts "Error, no network interfaces have been detected"
|
$stderr.puts "Error, no network interfaces have been detected"
|
||||||
end
|
end
|
||||||
else
|
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
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue