kh2hc 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/kh2hc/version.rb +1 -1
- data/lib/kh2hc.rb +4 -7
- metadata +16 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5fc579174cfb0a0a853d98c17aaa796a6167053142912cb0e035d6ad07aa62aa
|
|
4
|
+
data.tar.gz: be6ea1b720d8908a882e1eab389466b6a403c66e69c85b79207c0ce308bc51a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32f7bd1452206989b356534146928878567bebae23fe26b7ba2ebd67c130dc3850cc774885151123a675e417e3c8c71824824f1cb185635af03516bb87a8142e
|
|
7
|
+
data.tar.gz: 02ec0fb9fcbd10d822b84c48116e9bfbec102a3e3702481096a3f94295e1a07aa5205d4fc37682323885aec99b06e28ca15b3608c6cfc0a04d347fde2ed5e150
|
data/LICENSE
CHANGED
data/lib/kh2hc/version.rb
CHANGED
data/lib/kh2hc.rb
CHANGED
|
@@ -13,23 +13,20 @@ module Kh2hc
|
|
|
13
13
|
# @return [Array<Hash>] An array of Hash. Each Hash has two keys: the `:hash` of the host hash,
|
|
14
14
|
# the `:salt` of the host hash
|
|
15
15
|
def self.convert(khfile)
|
|
16
|
-
hosts = []
|
|
17
16
|
data = File.read(khfile)
|
|
18
17
|
# |<Magic string>|<salt>|<hash> <key algorithm> <public key sig.>
|
|
19
|
-
data.scan(/^\|1\|([^|]+)\|([^|].+) .+ .+$/).
|
|
18
|
+
data.scan(/^\|1\|([^|]+)\|([^|].+) .+ .+$/).map do |host|
|
|
20
19
|
# hash:salt
|
|
21
|
-
|
|
20
|
+
{ hash: host[1].from_b64.to_hex, salt: host[0].from_b64.to_hex }
|
|
22
21
|
end
|
|
23
|
-
hosts
|
|
24
22
|
end
|
|
25
23
|
|
|
26
24
|
# Convert OpenSSH known_hosts file hashed with HashKnownHosts to a hash file crackable by Hashcat.
|
|
27
25
|
# @param khfile [String] OpenSSH known_hosts file
|
|
28
26
|
# @return [String] hash file in Hashcat format
|
|
29
27
|
def self.convert1(khfile)
|
|
30
|
-
hc_out =
|
|
31
|
-
|
|
32
|
-
hc_out << "#{host[:hash]}:#{host[:salt]}"
|
|
28
|
+
hc_out = convert(khfile).map do |host|
|
|
29
|
+
"#{host[:hash]}:#{host[:salt]}"
|
|
33
30
|
end
|
|
34
31
|
hc_out.join("\n")
|
|
35
32
|
end
|
metadata
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kh2hc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexandre ZANNI
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ctf-party
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '4.0'
|
|
19
|
+
- - "<"
|
|
18
20
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
21
|
+
version: '6.0'
|
|
20
22
|
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
25
|
requirements:
|
|
24
|
-
- - "
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '4.0'
|
|
29
|
+
- - "<"
|
|
25
30
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
31
|
+
version: '6.0'
|
|
27
32
|
- !ruby/object:Gem::Dependency
|
|
28
33
|
name: docopt
|
|
29
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -61,8 +66,8 @@ metadata:
|
|
|
61
66
|
documentation_uri: https://noraj.github.io/kh2hc/
|
|
62
67
|
homepage_uri: https://noraj.github.io/kh2hc/
|
|
63
68
|
source_code_uri: https://github.com/noraj/kh2hc/
|
|
69
|
+
funding_uri: https://github.com/sponsors/noraj
|
|
64
70
|
rubygems_mfa_required: 'true'
|
|
65
|
-
post_install_message:
|
|
66
71
|
rdoc_options: []
|
|
67
72
|
require_paths:
|
|
68
73
|
- lib
|
|
@@ -70,18 +75,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
70
75
|
requirements:
|
|
71
76
|
- - ">="
|
|
72
77
|
- !ruby/object:Gem::Version
|
|
73
|
-
version: 3.
|
|
78
|
+
version: 3.2.0
|
|
74
79
|
- - "<"
|
|
75
80
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '
|
|
81
|
+
version: '5.0'
|
|
77
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
83
|
requirements:
|
|
79
84
|
- - ">="
|
|
80
85
|
- !ruby/object:Gem::Version
|
|
81
86
|
version: '0'
|
|
82
87
|
requirements: []
|
|
83
|
-
rubygems_version:
|
|
84
|
-
signing_key:
|
|
88
|
+
rubygems_version: 4.0.3
|
|
85
89
|
specification_version: 4
|
|
86
90
|
summary: Convert OpenSSH known_hosts file hashed with HashKnownHosts to hashes crackable
|
|
87
91
|
by Hashcat.
|