Module: Msf::Exploit::Remote::HTTP::Wordpress::Login
- Included in:
- Msf::Exploit::Remote::HTTP::Wordpress
- Defined in:
- lib/msf/core/exploit/remote/http/wordpress/login.rb
Instance Method Summary collapse
-
#wordpress_login(user, pass, timeout = 20) ⇒ String?
performs a wordpress login.
Instance Method Details
#wordpress_login(user, pass, timeout = 20) ⇒ String?
performs a wordpress login
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/msf/core/exploit/remote/http/wordpress/login.rb', line 10 def wordpress_login(user, pass, timeout = 20) redirect = "#{target_uri}#{Rex::Text.rand_text_alpha(8)}" res = send_request_cgi({ 'method' => 'POST', 'uri' => wordpress_url_login, 'vars_post' => wordpress_helper_login_post_data(user, pass, redirect) }, timeout) if res && res.redirect? && res.redirection && res.redirection.to_s == redirect = res. # Check if a valid wordpress cookie is returned return if # current Wordpress =~ /wordpress(?:_sec)?_logged_in_[^=]+=[^;]+;/i || # Wordpress 2.0 =~ /wordpress(?:user|pass)_[^=]+=[^;]+;/i || # Wordpress 2.5 =~ /wordpress_[a-z0-9]+=[^;]+;/i end nil end |