password_crack 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4908fe40c669e09e448b3c42279459536f28f08
4
- data.tar.gz: 6c6fe97748cda61b41b879fc6591334b20edb977
3
+ metadata.gz: 67187afcdbce88e22503272bf4b62cdcb4c6a9a3
4
+ data.tar.gz: 9dc934f9cc520151a5600dab1ffff527f3c4335a
5
5
  SHA512:
6
- metadata.gz: 6ad154b9c7017a78e35d2d7521bcec365eb1daa44eb2b456ab51332832d3557142312acfe3566befd91ff3b6fc9c2f2df8ab5ee1c7434d4bfda3842628900c4d
7
- data.tar.gz: b6465a6cc91e92ae5cea74e81509f85a85c0c38302312e2f0103ef48cb425fba74228f296a4b6f3c99ce0bc42c31f2cfce29164adbd234d5395c59635a2797c7
6
+ metadata.gz: 2f4feab52111994131c0a9b57d32d02d857506e18846ac64f06b899991578f17474816adbb9acd1b58bd68791822280a70de5c6a2ef12517aa66963e1d5f75f2
7
+ data.tar.gz: 78719e59d2623649440d46fd3ee9a90c733ff2e9fe78756d9135e7c4087f5033deb3900e45640d92e969b9b0f43d904b716e66ed32d725b336b3095039dd1ebd
data/README.md CHANGED
@@ -1,13 +1,15 @@
1
1
  # PasswordCrack
2
2
 
3
- crack password by dicts,
4
- suppert single thread md5 crack now
5
-
3
+ crack password by dicts
6
4
  all the dicts has created .This program will auto download the password dict which you specified.
7
5
 
8
6
  example dict_name:week_password_sample
9
7
  You could see all the dicts on: https://github.com/luaxlou/week_password/tree/master/dicts
10
8
 
9
+ ## features
10
+ - single thread md5 crack
11
+ - check password is week
12
+
11
13
  ## Installation
12
14
 
13
15
  Add this line to your application's Gemfile:
@@ -41,6 +43,24 @@ Or install it yourself as:
41
43
 
42
44
  ```
43
45
 
46
+
47
+ ```ruby
48
+
49
+ password = '12345679'
50
+ cracker = PasswordCrack::Cracker.new
51
+
52
+ expect('week_password_sample').to eq(cracker.check_is_week(password))
53
+
54
+ password = '1234569'
55
+
56
+ expect(nil).to eq(cracker.check_is_week(password))
57
+
58
+ password1 = '20140501'
59
+
60
+ expect('birthday').to eq(cracker.check_is_week(password1))
61
+
62
+ ```
63
+
44
64
  ## Command Line Usage
45
65
 
46
66
  ```bash
@@ -60,9 +80,25 @@ $ password_crack e10adc3949ba59abbe56e057f20f883e
60
80
  "crack success! result is:123456"
61
81
  ```
62
82
 
83
+ ```bash
84
+ $ password_is_week
85
+ check passwrod is week
86
+
87
+ Usage:
88
+ password_is_week <password>
89
+ Example:
90
+ password_is_week 12345679
91
+ -h, --help Show this message
92
+
93
+ $ password_is_week 12345679
94
+ "passowrd(12345679) is week,found in dict <week_password_sample>"
95
+ $ password_is_week 1234569
96
+ "passowrd(1234569) is strong now,just now."
97
+ ```
98
+
63
99
  ## Contributing
64
100
 
65
- Bug reports and pull requests are welcome on GitHub at https://github.com/luaxlou/password_crack. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
101
+ Bug reports and pull requests are welcome on GitHub at https://github.com/luaxlou/password_crack.
66
102
 
67
103
 
68
104
  ## License
data/bin/password_crack CHANGED
@@ -20,16 +20,16 @@ crypted_password = ARGV[0]
20
20
 
21
21
  opts = Trollop::options do
22
22
  banner <<-EOS
23
- creack passwrod by dicts
23
+ crack passwrod by dicts
24
24
 
25
25
  Usage:
26
26
  #{program} <crypted_password> [options]
27
27
  Example:
28
- #{program} e10adc3949ba59abbe56e057f20f883e
28
+ #{program} e10adc3949ba59abbe56e057f20f883e
29
29
  where [options] are:
30
30
  EOS
31
31
  opt :dict, "dict name",:default=>'week_password_sample'
32
- opt :crypt, "crypt type ",:default=>'md5'
32
+ opt :crypt, "crypt type : md5|none ",:default=>'md5'
33
33
  end
34
34
 
35
35
 
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env ruby
2
+ require "bundler/setup"
3
+ require "password_crack"
4
+ require 'trollop'
5
+
6
+ program = 'password_is_week'
7
+
8
+
9
+
10
+ password = ARGV[0]
11
+
12
+ if !password
13
+ ARGV[0] ='-h'
14
+
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+ opts = Trollop::options do
22
+
23
+ banner <<-EOS
24
+ check passwrod is week
25
+
26
+ Usage:
27
+ #{program} <password>
28
+ Example:
29
+ #{program} 12345679
30
+ EOS
31
+
32
+
33
+ end
34
+
35
+
36
+ c = PasswordCrack::Cracker.new
37
+
38
+ result = c.check_is_week password
39
+
40
+ p "passowrd(#{password}) is week,found in dict <#{result}>" if result
41
+ p "passowrd(#{password}) is strong now,just now." if !result
@@ -1,3 +1,3 @@
1
1
  module PasswordCrack
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -25,10 +25,51 @@ module PasswordCrack
25
25
  end
26
26
 
27
27
 
28
+ def check_is_week password
29
+
30
+ p = PasswordChecker.new
31
+
32
+ return p.check password
33
+
34
+ end
35
+
36
+
28
37
 
29
38
  end
30
39
 
31
40
 
41
+ class PasswordChecker
42
+
43
+ def check password
44
+
45
+
46
+ result = check_by_dict password,'week_password_sample'
47
+
48
+ return result if result
49
+
50
+ return check_by_dict password,'birthday'
51
+
52
+
53
+ end
54
+
55
+
56
+ def check_by_dict password,dict_name
57
+ d = Dict.new dict_name
58
+ File.open(d.create).each_line() do |pass|
59
+
60
+ pass.chomp!
61
+
62
+ return dict_name if pass == password
63
+
64
+ end
65
+
66
+ return nil
67
+ end
68
+
69
+
70
+ end
71
+
72
+
32
73
  class Md5Cracker
33
74
 
34
75
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
 
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- spec.executables = ['password_crack']
19
+ spec.executables = ['password_crack','password_is_week']
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.10"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: password_crack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - luax
@@ -57,6 +57,7 @@ email:
57
57
  - luax@qq.com
58
58
  executables:
59
59
  - password_crack
60
+ - password_is_week
60
61
  extensions: []
61
62
  extra_rdoc_files: []
62
63
  files:
@@ -69,6 +70,7 @@ files:
69
70
  - README.md
70
71
  - Rakefile
71
72
  - bin/password_crack
73
+ - bin/password_is_week
72
74
  - lib/password_crack.rb
73
75
  - lib/password_crack/version.rb
74
76
  - password_crack.gemspec