Merge remote branch 'sectorix/module-enumdb'

bug/bundler_fix
Tod Beardsley 2012-09-26 12:53:30 -05:00
commit 594669cbff
2 changed files with 40 additions and 25 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ tags
*.swp
*.orig
*.rej
*.nonsense-ignore-just-testing

View File

@ -106,6 +106,9 @@ class Metasploit3 < Msf::Post
elsif registry_enumkeys(key).include?("SYSMAN")
print_status("\tOracle Server found.")
return true
elsif registry_enumkeys(key).include?("KEY_XE")
print_status("\tOracle Server found.")
return true
end
return false
rescue
@ -175,18 +178,26 @@ class Metasploit3 < Msf::Post
# method to identify oracle instances
def enumerate_oracle
results = []
basekey = "HKLM\\SOFTWARE\\Oracle\\SYSMAN"
found_key = false
basekey_set = ["HKLM\\SOFTWARE\\Oracle\\SYSMAN","HKLM\\SOFTWARE\\ORACLE\\KEY_XE"]
basekey_set.each do |basekey|
next if found_key
instances = registry_enumkeys(basekey)
if instances.nil? or instances.empty?
print_error("\t\t! Oracle instances not found")
return results
next
else
found_key = true
end
instances.each do |i|
if basekey.include?"KEY_XE"
val_ORACLE_SID = registry_getvaldata(basekey,"ORACLE_SID")
val_ORACLE_HOME = registry_getvaldata(basekey,"ORACLE_HOME")
else
key = "#{basekey}\\#{i}"
val_ORACLE_SID = registry_getvaldata(key,"ORACLE_SID")
val_ORACLE_HOME = registry_getvaldata(key,"ORACLE_HOME")
end
if not exist?(val_ORACLE_HOME + "\\NETWORK\\ADMIN\\tnsnames.ora")
print_error("\t\t! #{val_ORACLE_SID} (No Listener Found)")
next
@ -201,9 +212,11 @@ class Metasploit3 < Msf::Post
print_error("\t\t! #{val_ORACLE_SID} (No Listener Found)")
end
end
end
if not found_key
print_error("\t\t! Oracle instances not found")
end
return results
rescue
print_error("\t\t! could not identify information")
return results || []
@ -337,3 +350,4 @@ class Metasploit3 < Msf::Post
end
end