htb 0.1.0 → 0.1.1
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/CHANGELOG.md +10 -0
- data/htb.gemspec +3 -1
- data/lib/htb/cli/main.rb +20 -12
- data/lib/htb/cli.rb +1 -1
- data/lib/htb/config.rb +2 -1
- data/lib/htb/version.rb +1 -1
- data/lib/htb/vm.rb +2 -2
- data/lib/htb/vpn.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad35da07fd9b2867d488dbf3559f26f7a4d892accd93f7787ef318e0c6ab4d6d
|
|
4
|
+
data.tar.gz: 77ae561b2b972ca331fe42b1dacfda49909bbd177d6f92406b659f19079974e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8af38c52092bf0738dc64d9752624bd4b996389e730561a6a4c54809e3752350847aabb8a16a4ff120e8e6132ea9fd8ea15b95518b7ef4fc8f5cfa02bebe2ba1
|
|
7
|
+
data.tar.gz: dc43a9683115267a1d0e9f2370cf69ed0c7d329ad2d09bafd50487a33a8fdb7f479484dad4f2e2404198bdd6c7ad03c2a7e6fac46a08da8c40c1cdd0acc6b948
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.1] - 2026-01-17
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Fixed VPN status endpoint from `/connections/status` to `/connection/status`
|
|
13
|
+
- Fixed VPN status response handling to properly parse Array response
|
|
14
|
+
- Fixed VM active endpoint from `/vm/active` to `/machine/active`
|
|
15
|
+
- Fixed config file YAML parsing to handle non-Hash responses gracefully
|
|
16
|
+
- Changed "Machine" label to "Challenge" in status output
|
|
17
|
+
|
|
8
18
|
## [0.1.0] - 2025-01-17
|
|
9
19
|
|
|
10
20
|
### Added
|
data/htb.gemspec
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "lib/htb/version"
|
|
4
|
+
|
|
3
5
|
Gem::Specification.new do |spec|
|
|
4
6
|
spec.name = "htb"
|
|
5
|
-
spec.version =
|
|
7
|
+
spec.version = HTB::VERSION
|
|
6
8
|
spec.authors = ["usiegj00"]
|
|
7
9
|
spec.email = ["usiegj00@users.noreply.github.com"]
|
|
8
10
|
|
data/lib/htb/cli/main.rb
CHANGED
|
@@ -44,7 +44,7 @@ module HTB
|
|
|
44
44
|
CLI.print_table(
|
|
45
45
|
["Field", "Value"],
|
|
46
46
|
[
|
|
47
|
-
["
|
|
47
|
+
["Challenge", info["name"] || "N/A"],
|
|
48
48
|
["IP", info["ip"] || "N/A"],
|
|
49
49
|
["Type", info["type"] || "N/A"],
|
|
50
50
|
["Expires", info["expires_at"] || "N/A"]
|
|
@@ -60,18 +60,26 @@ module HTB
|
|
|
60
60
|
puts CLI.pastel.bold("\n=== VPN Status ===")
|
|
61
61
|
begin
|
|
62
62
|
vpn_status = CLI.spinner("Fetching VPN status...") { client.vpn.status }
|
|
63
|
-
if vpn_status && vpn_status
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
["
|
|
67
|
-
|
|
68
|
-
["
|
|
69
|
-
[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
if vpn_status.is_a?(Array) && !vpn_status.empty?
|
|
64
|
+
vpn_status.each do |conn|
|
|
65
|
+
server = conn["server"] || {}
|
|
66
|
+
connection = conn["connection"] || {}
|
|
67
|
+
CLI.print_table(
|
|
68
|
+
["Field", "Value"],
|
|
69
|
+
[
|
|
70
|
+
["Type", conn["type"] || "N/A"],
|
|
71
|
+
["Location", conn["location_type_friendly"] || "N/A"],
|
|
72
|
+
["Server", server["friendly_name"] || "N/A"],
|
|
73
|
+
["Connected", connection["name"] ? "Yes" : "No"],
|
|
74
|
+
["IPv4", connection["ip4"] || "N/A"],
|
|
75
|
+
["IPv6", connection["ip6"] || "N/A"],
|
|
76
|
+
["Down", connection["down"] ? "#{connection['down']} KB/s" : "N/A"],
|
|
77
|
+
["Up", connection["up"] ? "#{connection['up']} KB/s" : "N/A"]
|
|
78
|
+
]
|
|
79
|
+
)
|
|
80
|
+
end
|
|
73
81
|
else
|
|
74
|
-
CLI.print_info("VPN
|
|
82
|
+
CLI.print_info("No active VPN connections")
|
|
75
83
|
end
|
|
76
84
|
rescue HTB::Error => e
|
|
77
85
|
CLI.print_error(e.message)
|
data/lib/htb/cli.rb
CHANGED
|
@@ -6,12 +6,12 @@ require "tty-spinner"
|
|
|
6
6
|
require "tty-prompt"
|
|
7
7
|
require "pastel"
|
|
8
8
|
|
|
9
|
-
require_relative "cli/main"
|
|
10
9
|
require_relative "cli/machines"
|
|
11
10
|
require_relative "cli/vm"
|
|
12
11
|
require_relative "cli/users"
|
|
13
12
|
require_relative "cli/challenges"
|
|
14
13
|
require_relative "cli/vpn"
|
|
14
|
+
require_relative "cli/main"
|
|
15
15
|
|
|
16
16
|
module HTB
|
|
17
17
|
module CLI
|
data/lib/htb/config.rb
CHANGED
|
@@ -12,7 +12,8 @@ module HTB
|
|
|
12
12
|
return {} unless File.exist?(CONFIG_FILE)
|
|
13
13
|
|
|
14
14
|
content = File.read(CONFIG_FILE)
|
|
15
|
-
YAML.safe_load(content, symbolize_names: true)
|
|
15
|
+
result = YAML.safe_load(content, symbolize_names: true)
|
|
16
|
+
result.is_a?(Hash) ? result : {}
|
|
16
17
|
rescue StandardError
|
|
17
18
|
{}
|
|
18
19
|
end
|
data/lib/htb/version.rb
CHANGED
data/lib/htb/vm.rb
CHANGED
data/lib/htb/vpn.rb
CHANGED
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: htb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- usiegj00
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2026-01-17 00:00:00.000000000 Z
|
|
@@ -203,7 +203,7 @@ metadata:
|
|
|
203
203
|
homepage_uri: https://github.com/aluminumio/htb-ruby
|
|
204
204
|
source_code_uri: https://github.com/aluminumio/htb-ruby
|
|
205
205
|
changelog_uri: https://github.com/aluminumio/htb-ruby/blob/main/CHANGELOG.md
|
|
206
|
-
post_install_message:
|
|
206
|
+
post_install_message:
|
|
207
207
|
rdoc_options: []
|
|
208
208
|
require_paths:
|
|
209
209
|
- lib
|
|
@@ -218,8 +218,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
218
218
|
- !ruby/object:Gem::Version
|
|
219
219
|
version: '0'
|
|
220
220
|
requirements: []
|
|
221
|
-
rubygems_version: 3.
|
|
222
|
-
signing_key:
|
|
221
|
+
rubygems_version: 3.5.22
|
|
222
|
+
signing_key:
|
|
223
223
|
specification_version: 4
|
|
224
224
|
summary: Ruby client for the Hack The Box API v4
|
|
225
225
|
test_files: []
|