Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/tools/password/vxdigger.rb
Views: 11768
#!/usr/bin/env ruby12#3# This script scans a memory dump or firmware image for any password hashes that4# happen to match the "master password" list generated by vxmaster. This is a5# simple way to determine whether a device has a hardcoded password.6#7# (C) 2010 Rapid78#910def usage11$stderr.puts "usage: #{$0} [dump-file] <master password list>"12exit13end1415# Force binary encoding for Ruby versions that support it16if(Object.const_defined?('Encoding') and ::Encoding.respond_to?('default_external='))17::Encoding.default_external = ::Encoding.default_internal = "binary"18end1920dump = ARGV.shift || usage()21list = ARGV.shift || File.join(File.dirname(__FILE__), "..", "data", "wordlists", "vxworks_collide_20.txt")2223$stderr.puts "[*] Loading master password list..."24ohashes = []25hashes = []26File.read(list).split("\n").each do |x|27xid,enc,raw = x.split("|", 3)28xid = xid.to_i29next if raw =~ /invalid/30raw,tmp = raw.split("\x00")31ohashes << [xid, enc, raw]32end3334$stderr.puts "[*] Loading memory dump..."35data = File.read(dump)3637$stderr.puts "[*] Digging through memory dump..."3839hashes = ohashes4041tot = hashes.length42cur = 043hashes.each do |r|44x,k,h = r4546cur += 147pct = cur/tot.to_f48pct = (pct * 100).to_i49$stdout.write(" \r[*] Progress: #{pct}% (#{cur}/#{tot})")50$stdout.flush5152next if not data.index(k)53$stdout.write("\n")54$stdout.flush55puts "[+]"56puts "[+] Password hash '#{k}' (##{x}) can be accessed with #{h.unpack("C*").map{|i| "\\x%.2x" % i}} [ '#{h}' ]"57puts "[+]"58end596061