Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # emaile : http://www.facebook.com/fysl.fyslm
- # ony to educ
- ~~ ked ans | hacker_1420 |hamza mahmah | bresco-dz | mosta_team | viper | elite trojen |hacker_fire | DZ mafia all algerian :p
- #!/bin/ruby
- characters_to_use="ABCD123456"
- minimum_password_length=5
- maximum_password_length=15
- def password_correct?(test_password)
- # This is just for testing. There's no need to alter this bit!
- return true if test_password == "root"
- return false
- end
- char_array=characters_to_use.split(//)
- is_access_granted = false
- (minimum_password_length..maximum_password_length).each do |password_length| # loop to gradually increase password length
- combinations=char_array.length**password_length
- (0..combinations-1).each do |perm_number| # loop through combinations for a given length
- password=""
- (1..password_length).each do |char_number| # loop through characters
- char_reference = (perm_number / char_array.length**(char_number-1)).floor % char_array.length
- character = char_array[char_reference]
- password << character
- end
- if password_correct?(password)
- puts "#{password} | Access Denied | #{perm_number} / #{combinations}"
- else
- puts "#{password} | Access Granted"
- is_access_granted = true
- break
- end
- end
- break if is_access_granted
- end
Advertisement
Add Comment
Please, Sign In to add comment