GoToolSharing / htb-cli

Interact with Hackthebox using your terminal - Be faster and more competitive !
https://github.com/GoToolSharing/htb-cli
GNU General Public License v3.0
87 stars 6 forks source link

[BUG] Start VPN dont work/start #100

Closed suljov closed 10 months ago

suljov commented 10 months ago

OBS: i dont really know GO and how it works hence why im here kinda.

Got it to work so it downloads the VPN(s)

but staring for exmaple competitive dont work

$ htb-cli vpn -m competitive --start
2024-01-14T01:08:10.466+0100    ERROR   cmd/vpn.go:122      {"error": "error reading file openvpn: open openvpn: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
    /home/suljov/Desktop/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/suljov/Desktop/htb-cli/cmd/root.go:43
main.main
    /home/suljov/Desktop/htb-cli/main.go:8
runtime.main
    /usr/lib/go-1.21/src/runtime/proc.go:267

for debbuging:

─$ ll .local/htb-cli/
total 52
-rw-r--r-- 1 suljov suljov 9325 Jan 14 01:05 -vpn.ovpn
-rw-r--r-- 1 suljov suljov 8435 Jan 14 01:05 EU_Fortress_1-vpn.ovpn
-rw-r--r-- 1 suljov suljov 9325 Jan 14 01:05 EU_Labs_1-vpn.ovpn
-rw-r--r-- 1 suljov suljov 9325 Jan 14 01:05 EU_Release_Arena_1-vpn.ovpn
-rw-r--r-- 1 suljov suljov   32 Jan 14 00:43 default.conf
$ htb-cli vpn -m competitive --start -vvv
2024-01-14T01:11:27.281+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-14T01:11:27.281+0100    INFO    config/config.go:179    Loading configuration file...
2024-01-14T01:11:27.281+0100    INFO    config/config.go:185    Configuration successfully loaded
2024-01-14T01:11:27.281+0100    DEBUG   config/config.go:186    map[Discord:False Update:False]
2024-01-14T01:11:27.281+0100    DEBUG   update/update.go:16 config.Version: v1.5.1
2024-01-14T01:11:27.281+0100    INFO    utils/utils.go:479  Sending an HTTP request
2024-01-14T01:11:27.281+0100    DEBUG   utils/utils.go:480  Request URL: https://api.github.com/repos/GoToolSharing/htb-cli/releases/latest
2024-01-14T01:11:27.281+0100    DEBUG   utils/utils.go:481  Request method: GET
2024-01-14T01:11:27.282+0100    DEBUG   utils/utils.go:482  Request body: {}
2024-01-14T01:11:27.533+0100    DEBUG   update/update.go:69 release.TagName : v1.5.1
2024-01-14T01:11:27.533+0100    DEBUG   update/update.go:70 config.Version : v1.5.1
2024-01-14T01:11:27.533+0100    DEBUG   cmd/root.go:35  Message : You're up to date ! (v1.5.1)
2024-01-14T01:11:27.533+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-14T01:11:27.533+0100    DEBUG   cmd/vpn.go:55   Mode: competitive
2024-01-14T01:11:27.533+0100    DEBUG   vpn/vpn.go:140  VPN config file : /home/suljov/.local/htb-cli/*Release_Arena*
2024-01-14T01:11:27.533+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-14T01:11:27.546+0100    DEBUG   vpn/vpn.go:164  VPN processes: [106881 sh -c pgrep -fa openvpn ]
2024-01-14T01:11:27.546+0100    ERROR   cmd/vpn.go:122      {"error": "error reading file openvpn: open openvpn: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
    /home/suljov/Desktop/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/suljov/Desktop/htb-cli/cmd/root.go:43
main.main
    /home/suljov/Desktop/htb-cli/main.go:8
runtime.main
    /usr/lib/go-1.21/src/runtime/proc.go:267

Also tried to dowload the pre-compiled binarie and use it but didnt work either

also tried this:

$ pwd                      
/home/suljov/.local/htb-cli

┌──(suljov㉿suljov)-[~/.local/htb-cli]
└─$ htb-cli vpn --download        
A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull

You do not have permissions to download the following vpn: endgames
VPN : EU_Labs_1 downloaded successfully
VPN :  downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully
VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/suljov/.local/htb-cli

┌──(suljov㉿suljov)-[~/.local/htb-cli]
└─$ htb-cli vpn -m competitive --start
A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull

2024-01-14T01:23:21.676+0100    ERROR   cmd/vpn.go:122      {"error": "error reading file openvpn: open openvpn: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/root.go:43
main.main
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/main.go:8
runtime.main
    /usr/lib/go-1.21/src/runtime/proc.go:267

here if i try to start labs

$ htb-cli vpn -m labs --start -vvv
2024-01-14T01:24:35.084+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-14T01:24:35.084+0100    INFO    config/config.go:179    Loading configuration file...
2024-01-14T01:24:35.084+0100    INFO    config/config.go:185    Configuration successfully loaded
2024-01-14T01:24:35.084+0100    DEBUG   config/config.go:186    map[Discord:False Update:False]
2024-01-14T01:24:35.084+0100    DEBUG   update/update.go:16 config.Version: f966281dc0d42553054aa70c538828849f10fad5
2024-01-14T01:24:35.084+0100    INFO    update/update.go:18 Development version detected
2024-01-14T01:24:35.084+0100    INFO    utils/utils.go:479  Sending an HTTP request
2024-01-14T01:24:35.084+0100    DEBUG   utils/utils.go:480  Request URL: https://api.github.com/repos/GoToolSharing/htb-cli/commits?sha=dev
2024-01-14T01:24:35.084+0100    DEBUG   utils/utils.go:481  Request method: GET
2024-01-14T01:24:35.084+0100    DEBUG   utils/utils.go:482  Request body: {}
2024-01-14T01:24:35.404+0100    DEBUG   update/update.go:26 Body: [{"sha":"c501fa6e5feb6aa74b8a7b82007c964dd224582b","node_id":"C_kwDOKQxmBtoAKGM1MDFmYTZlNWZlYjZhYTc0YjhhN2I4MjAwN2M5NjRkZDIyNDU4MmI","commit":{"author":{"name":"github","email":"github@qu35t-mail.simplelogin.com","date":"2024-01-11T11:34:17Z"},"committer":{"name":"github","email":"github@qu35t-mail.simplelogin.com","date":"2024-01-11T11:34:17Z"},"message":"Fix merge with main","tree":{"sha":"21e861e5d804f1df0d9ca8abc21222b74fca48cc","url":"https://api.github.com/repos/GoToolSharing/htb-cli/git/t
2024-01-14T01:24:35.404+0100    DEBUG   update/update.go:38 Commits : [{c501fa6e5feb6aa74b8a7b82007c964dd224582b {{github}}} {92429764d3906f6b8eebc1727febe18408e2565d {{github}}} {10b18b40c75de95ffa90851930f864d2929fb4d7 {{github}}} {1fc0949335f353739ab61f688a67e44fd4df68c2 {{github}}} {21357e29657a3e87aa508375e528846cb345a605 {{github}}} {20442b11faf9fe983b14db656cd53024e12caaf7 {{github}}} {e660c0af0f8bb4a8b23e1d38afbe3ba9905257ea {{github}}} {41bd1a337741fed2434bf7d3f71dd664bc695e89 {{Github Action}}} {df9a0904e40ac48835fff2efc1ae57d69ab89097 {{github}}} {eccf372c442a0ecd7f81fd679db0f2bc44d1090e {{github}}} {0625a7368ec7ee552466b8dc39fd3136bbcb8b10 {{Github Action}}} {32501bfab6e93e517a12b7017130f96e6b933311 {{QU35T-code}}} {a8cf63f6647033135f97312c52274613f859959e {{QU35T-code}}} {1ca7cd9911ef448dddb30cca224c7c609032ae9c {{Github Action}}} {a4cab218bb5f9851028091eb74469d4e21c469d0 {{github}}} {877a2f87e9f21afeff1e4855ac42bd0c7a4cfa77 {{github}}} {ffeb20b2d8aba458e75cb3967867c9aa28dde3d0 {{Github Action}}} {395883f75ab40db134f940c627d5b19b66c792c5 {{github}}} {e71bacb061db1018462cc892838b0b858eb281a9 {{Github Action}}} {f966281dc0d42553054aa70c538828849f10fad5 {{github}}} {1bbea5ce597671dbfea226ebf1a7375583b73788 {{github}}} {2989e34e296d63495dbbbe611e32081bcf7bf23a {{github}}} {462747d7bee638c0dded90e72aadc64274de27c3 {{Github Action}}} {23bcd72d532ccff057f784afab567c4214e14037 {{github}}} {97c36d59753d907c39abe029d7b19bdc727af3e4 {{github}}} {b03cb5f284a41729356dc5213437990ef0487145 {{Github Action}}} {4fdb0dc1c930b971ea27746ec295bdc3f6419e5f {{github}}} {763012b3fc115db3b7a0ff57044fc34be37b848f {{Github Action}}} {cc08ff0d969bbc372d35ed6fb8569332cf513c67 {{github}}} {bab8807421e1007eb9fc1ea57be7a5b2293b0720 {{Github Action}}}]
2024-01-14T01:24:35.404+0100    DEBUG   update/update.go:43 Last commit hash : c501fa6e5feb6aa74b8a7b82007c964dd224582b
2024-01-14T01:24:35.404+0100    DEBUG   cmd/root.go:35  Message : A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull
A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull

2024-01-14T01:24:35.404+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-14T01:24:35.404+0100    DEBUG   cmd/vpn.go:55   Mode: labs
2024-01-14T01:24:35.404+0100    DEBUG   vpn/vpn.go:140  VPN config file : /home/suljov/.local/htb-cli/*Labs*
2024-01-14T01:24:35.404+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-14T01:24:35.417+0100    DEBUG   vpn/vpn.go:164  VPN processes: [114026 sh -c pgrep -fa openvpn ]
2024-01-14T01:24:35.417+0100    ERROR   cmd/vpn.go:122      {"error": "error reading file openvpn: open openvpn: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/root.go:43
main.main
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/main.go:8
runtime.main
    /usr/lib/go-1.21/src/runtime/proc.go:267

and here is competitive (in the same folder as the vpn:s etc)

$ htb-cli vpn -m competitive --start -vvv
2024-01-14T01:25:28.832+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-14T01:25:28.832+0100    INFO    config/config.go:179    Loading configuration file...
2024-01-14T01:25:28.832+0100    INFO    config/config.go:185    Configuration successfully loaded
2024-01-14T01:25:28.832+0100    DEBUG   config/config.go:186    map[Discord:False Update:False]
2024-01-14T01:25:28.832+0100    DEBUG   update/update.go:16 config.Version: f966281dc0d42553054aa70c538828849f10fad5
2024-01-14T01:25:28.832+0100    INFO    update/update.go:18 Development version detected
2024-01-14T01:25:28.832+0100    INFO    utils/utils.go:479  Sending an HTTP request
2024-01-14T01:25:28.832+0100    DEBUG   utils/utils.go:480  Request URL: https://api.github.com/repos/GoToolSharing/htb-cli/commits?sha=dev
2024-01-14T01:25:28.832+0100    DEBUG   utils/utils.go:481  Request method: GET
2024-01-14T01:25:28.832+0100    DEBUG   utils/utils.go:482  Request body: {}
2024-01-14T01:25:29.120+0100    DEBUG   update/update.go:26 Body: [{"sha":"c501fa6e5feb6aa74b8a7b82007c964dd224582b","node_id":"C_kwDOKQxmBtoAKGM1MDFmYTZlNWZlYjZhYTc0YjhhN2I4MjAwN2M5NjRkZDIyNDU4MmI","commit":{"author":{"name":"github","email":"github@qu35t-mail.simplelogin.com","date":"2024-01-11T11:34:17Z"},"committer":{"name":"github","email":"github@qu35t-mail.simplelogin.com","date":"2024-01-11T11:34:17Z"},"message":"Fix merge with main","tree":{"sha":"21e861e5d804f1df0d9ca8abc21222b74fca48cc","url":"https://api.github.com/repos/GoToolSharing/htb-cli/git/t
2024-01-14T01:25:29.120+0100    DEBUG   update/update.go:38 Commits : [{c501fa6e5feb6aa74b8a7b82007c964dd224582b {{github}}} {92429764d3906f6b8eebc1727febe18408e2565d {{github}}} {10b18b40c75de95ffa90851930f864d2929fb4d7 {{github}}} {1fc0949335f353739ab61f688a67e44fd4df68c2 {{github}}} {21357e29657a3e87aa508375e528846cb345a605 {{github}}} {20442b11faf9fe983b14db656cd53024e12caaf7 {{github}}} {e660c0af0f8bb4a8b23e1d38afbe3ba9905257ea {{github}}} {41bd1a337741fed2434bf7d3f71dd664bc695e89 {{Github Action}}} {df9a0904e40ac48835fff2efc1ae57d69ab89097 {{github}}} {eccf372c442a0ecd7f81fd679db0f2bc44d1090e {{github}}} {0625a7368ec7ee552466b8dc39fd3136bbcb8b10 {{Github Action}}} {32501bfab6e93e517a12b7017130f96e6b933311 {{QU35T-code}}} {a8cf63f6647033135f97312c52274613f859959e {{QU35T-code}}} {1ca7cd9911ef448dddb30cca224c7c609032ae9c {{Github Action}}} {a4cab218bb5f9851028091eb74469d4e21c469d0 {{github}}} {877a2f87e9f21afeff1e4855ac42bd0c7a4cfa77 {{github}}} {ffeb20b2d8aba458e75cb3967867c9aa28dde3d0 {{Github Action}}} {395883f75ab40db134f940c627d5b19b66c792c5 {{github}}} {e71bacb061db1018462cc892838b0b858eb281a9 {{Github Action}}} {f966281dc0d42553054aa70c538828849f10fad5 {{github}}} {1bbea5ce597671dbfea226ebf1a7375583b73788 {{github}}} {2989e34e296d63495dbbbe611e32081bcf7bf23a {{github}}} {462747d7bee638c0dded90e72aadc64274de27c3 {{Github Action}}} {23bcd72d532ccff057f784afab567c4214e14037 {{github}}} {97c36d59753d907c39abe029d7b19bdc727af3e4 {{github}}} {b03cb5f284a41729356dc5213437990ef0487145 {{Github Action}}} {4fdb0dc1c930b971ea27746ec295bdc3f6419e5f {{github}}} {763012b3fc115db3b7a0ff57044fc34be37b848f {{Github Action}}} {cc08ff0d969bbc372d35ed6fb8569332cf513c67 {{github}}} {bab8807421e1007eb9fc1ea57be7a5b2293b0720 {{Github Action}}}]
2024-01-14T01:25:29.121+0100    DEBUG   update/update.go:43 Last commit hash : c501fa6e5feb6aa74b8a7b82007c964dd224582b
2024-01-14T01:25:29.121+0100    DEBUG   cmd/root.go:35  Message : A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull
A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b)
Update with : git pull

2024-01-14T01:25:29.121+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-14T01:25:29.121+0100    DEBUG   cmd/vpn.go:55   Mode: competitive
2024-01-14T01:25:29.121+0100    DEBUG   vpn/vpn.go:140  VPN config file : /home/suljov/.local/htb-cli/*Release_Arena*
2024-01-14T01:25:29.121+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-14T01:25:29.133+0100    DEBUG   vpn/vpn.go:164  VPN processes: [114491 sh -c pgrep -fa openvpn ]
2024-01-14T01:25:29.133+0100    ERROR   cmd/vpn.go:122      {"error": "error reading file openvpn: open openvpn: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
    /home/suljov/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/cmd/root.go:43
main.main
    /home/suljov/go/pkg/mod/github.com/!go!tool!sharing/htb-cli@v1.5.2/main.go:8
runtime.main
    /usr/lib/go-1.21/src/runtime/proc.go:267
QU35T-code commented 10 months ago

@suljov,

Thank you for all these tests. I will analyze all this and it will be fixed on update v1.6.0. Overall this is related to this issue : #86, but I'm keeping both open just in case.

QU35T-code commented 10 months ago

@suljov,

Can you check if « pgrep » and « openvpn » is installed on your machine ? This will be replaced in the future but for now, it is necessary to have the both programs accessible via the PATH.

suljov commented 10 months ago

@suljov,

Can you check if « pgrep » and « openvpn » is installed on your machine ? This will be replaced in the future but for now, it is necessary to have the both programs accessible via the PATH.

yes openvpn is installed and i belive also pgrep is installed since both is installed per default on kali linux?

danjo133 commented 10 months ago

I also have this problem on Kali. Don't know if it matters that pgrep is in usr/bin and openvpn is in usr/sbin ?

QU35T-code commented 10 months ago

I also have this problem on Kali. Don't know if it matters that pgrep is in usr/bin and openvpn is in usr/sbin ?

It simply needs to be installed and accessible via the PATH

QU35T-code commented 10 months ago

@suljov / @danjo133,

Can you run these commands in your terminal ?

pgrep -fa openvpn

and :

pgrep --version

Thanks !

danjo133 commented 10 months ago

Running it with no openvpn running, the first gives an empty result, running it with openvpn connected to htb gives: $ pgrep -fa openvpn 75856 sudo openvpn competitive.ovpn 78640 sudo openvpn competitive.ovpn 78644 openvpn competitive_.ovpn

$ pgrep --version pgrep from procps-ng 4.0.4

running with sudo: sudo /home/kali/go/bin/htb-cli vpn --start -m competitive A new update is now available (dev) ! (c501fa6e5feb6aa74b8a7b82007c964dd224582b) Update with : git pull

? VPN was not found. Would you like to download it ? Yes 2024-01-16T21:59:34.103+0100 ERROR cmd/vpn.go:122 {"error": "environment variable is not set : HTB_TOKEN\n"}

QU35T-code commented 10 months ago

Thanks @danjo133 - I made a few change in dev.

1) First, can you switch with the dev branch with : go install github.com/GoToolSharing/htb-cli@dev and check with : htb-cli version 2) Kill all vpn processes with : pkill openvpn and check with : pgrep -fa openvpn 3) Remove all vpn files with : rm ~/.local/htb-cli/*.ovpn 4) Run this command :

htb-cli vpn -m competitive --start -vvv

Note : You don’t need to run htb-cli with sudo

danjo133 commented 10 months ago

Seems to have solved it!

❯ htb-cli vpn -m competitive --start -vvv 2024-01-16T22:08:15.019+0100 DEBUG cmd/root.go:24 Verbosity level : 3 2024-01-16T22:08:15.021+0100 INFO config/config.go:180 Loading configuration file... 2024-01-16T22:08:15.025+0100 INFO config/config.go:186 Configuration successfully loaded 2024-01-16T22:08:15.025+0100 DEBUG config/config.go:187 map[Discord:False Update:False] 2024-01-16T22:08:15.025+0100 DEBUG cmd/root.go:30 Check for updates : false 2024-01-16T22:08:15.025+0100 DEBUG update/update.go:14 config.Version: dev 2024-01-16T22:08:15.025+0100 INFO update/update.go:16 Development version detected 2024-01-16T22:08:15.025+0100 DEBUG cmd/root.go:37 Message : Development version (git pull to update) 2024-01-16T22:08:15.025+0100 INFO cmd/vpn.go:18 VPN command executed 2024-01-16T22:08:15.025+0100 DEBUG cmd/vpn.go:55 Mode: competitive 2024-01-16T22:08:15.025+0100 DEBUG vpn/vpn.go:144 VPN config file : [] ? VPN was not found. Would you like to download it ? Yes 2024-01-16T22:08:18.123+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.123+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=competitive 2024-01-16T22:08:18.123+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.123+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.125+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.125+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=endgames 2024-01-16T22:08:18.126+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.126+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.127+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.127+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=labs 2024-01-16T22:08:18.128+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.128+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:08:18.129+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.129+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=starting_point 2024-01-16T22:08:18.130+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.130+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:08:18.130+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.130+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=fortresses 2024-01-16T22:08:18.130+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.130+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.470+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.470+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/429/0 2024-01-16T22:08:18.470+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.471+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:08:18.471+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.471+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/413/0 2024-01-16T22:08:18.472+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.472+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.486+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.486+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/244/0 2024-01-16T22:08:18.487+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.487+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.505+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.506+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:08:18.506+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.506+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:08:18.670+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:08:18.670+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:08:18.670+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:08:18.670+0100 DEBUG utils/utils.go:387 Request body: {} VPN : EU_Labs_2 downloaded successfully VPN : EU_Endgame_VIP_1 downloaded successfully VPN : EU_Release_Arena_2 downloaded successfully VPN : EU_Fortress_1 downloaded successfully VPN : EU_StartingPoint_VIP_1 downloaded successfully

VPNs are located at the following path : /home/kali/.local/htb-cli 2024-01-16T22:08:20.970+0100 INFO vpn/vpn.go:154 VPN is starting... 2024-01-16T22:08:21.024+0100 DEBUG vpn/vpn.go:164 VPN processes: [] VPN Started Successfully! 2024-01-16T22:08:22.720+0100 INFO cmd/vpn.go:139 Exit vpn command correctly

❯ ps aux | grep openvpn kali 128468 0.0 0.0 2584 1664 pts/1 S 22:08 0:00 sh -c sudo openvpn /home/kali/.local/htb-cli/Release_Arena root 128469 0.0 0.0 16412 6528 pts/1 S 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128470 0.0 0.0 16412 2004 pts/3 Ss+ 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128471 0.2 0.1 15620 9984 pts/3 S 22:08 0:00 openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn kali 128615 0.0 0.0 6348 2176 pts/1 S+ 22:08 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

QU35T-code commented 10 months ago

Can you check your interfaces with : ip a / ifconfig VPN should be up Should work

QU35T-code commented 10 months ago

Thanks for testing @danjo133 !

@suljov, can you doble check following these steps ? https://github.com/GoToolSharing/htb-cli/issues/100#issuecomment-1894513017

danjo133 commented 10 months ago

Yep, after the switch to dev, I can reach monitored.htb

ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether brd ff:ff:ff:ff:ff:ff inet /24 brd 10.0.2.255 scope global dynamic noprefixroute eth0 valid_lft 83950sec preferred_lft 83950sec inet6 /64 scope link noprefixroute valid_lft forever preferred_lft forever 3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether brd ff:ff:ff:ff:ff:ff inet /16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever 4: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default link/ether brd ff:ff:ff:ff:ff:ff inet /32 scope global flannel.1 valid_lft forever preferred_lft forever inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 5: cni0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000 link/ether brd ff:ff:ff:ff:ff:ff inet /24 brd 10.42.0.255 scope global cni0 valid_lft forever preferred_lft forever inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 6: veth08e9fd9c@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 7: vethb9c382f6@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 8: vetha952c42e@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 9: vethe287b210@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 10: veth0ae746e5@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 11: veth6e6f11c3@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 13: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500 link/none inet /23 scope global tun0 valid_lft forever preferred_lft forever inet6 dead:beef:/64 scope global valid_lft forever preferred_lft forever inet6 /64 scope link stable-privacy proto kernel_ll valid_lft forever preferred_lft forever

QU35T-code commented 10 months ago

Yep, after the switch to dev, I can reach monitored.htb

ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether brd ff:ff:ff:ff:ff:ff inet /24 brd 10.0.2.255 scope global dynamic noprefixroute eth0 valid_lft 83950sec preferred_lft 83950sec inet6 /64 scope link noprefixroute valid_lft forever preferred_lft forever 3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether brd ff:ff:ff:ff:ff:ff inet /16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever 4: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default link/ether brd ff:ff:ff:ff:ff:ff inet /32 scope global flannel.1 valid_lft forever preferred_lft forever inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 5: cni0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default qlen 1000 link/ether brd ff:ff:ff:ff:ff:ff inet /24 brd 10.42.0.255 scope global cni0 valid_lft forever preferred_lft forever inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 6: veth08e9fd9c@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 7: vethb9c382f6@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 8: vetha952c42e@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 9: vethe287b210@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 10: veth0ae746e5@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 11: veth6e6f11c3@if2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue master cni0 state UP group default link/ether inet6 /64 scope link proto kernel_ll valid_lft forever preferred_lft forever 13: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 500 link/none inet /23 scope global tun0 valid_lft forever preferred_lft forever inet6 dead:beef:/64 scope global valid_lft forever preferred_lft forever inet6 /64 scope link stable-privacy proto kernel_ll valid_lft forever preferred_lft forever

Enjoy :tada:

danjo133 commented 10 months ago

re-running listed steps:

❯ go install github.com/GoToolSharing/htb-cli@dev ~/dev/ctf/htb │ master ?115 ❯ htb-cli version Development version (dev branch)

❯ ps aux | grep openvpn kali 128468 0.0 0.0 2584 1664 pts/1 S 22:08 0:00 sh -c sudo openvpn /home/kali/.local/htb-cli/Release_Arena root 128469 0.0 0.0 16412 6528 pts/1 S 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128470 0.0 0.0 16412 2004 pts/3 Ss+ 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128471 0.0 0.1 15620 9984 pts/3 S 22:08 0:00 openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn kali 143346 0.0 0.0 6348 2048 pts/1 S+ 22:22 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

❯ pkill openvpn pkill: killing pid 128471 failed: Operation not permitted

❯ sudo pkill openvpn

❯ ps aux | grep openvpn kali 143586 0.0 0.0 6348 2176 pts/1 S+ 22:22 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

❯ pgrep -fa openvpn

❯ rm ~/.local/htb-cli/*.ovpn

❯ htb-cli vpn -m competitive --start -vvv 2024-01-16T22:23:16.782+0100 DEBUG cmd/root.go:24 Verbosity level : 3 2024-01-16T22:23:16.782+0100 INFO config/config.go:180 Loading configuration file... 2024-01-16T22:23:16.782+0100 INFO config/config.go:186 Configuration successfully loaded 2024-01-16T22:23:16.783+0100 DEBUG config/config.go:187 map[Discord:False Update:False] 2024-01-16T22:23:16.783+0100 DEBUG cmd/root.go:30 Check for updates : false 2024-01-16T22:23:16.783+0100 DEBUG update/update.go:14 config.Version: dev 2024-01-16T22:23:16.783+0100 INFO update/update.go:16 Development version detected 2024-01-16T22:23:16.783+0100 DEBUG cmd/root.go:37 Message : Development version (git pull to update) 2024-01-16T22:23:16.783+0100 INFO cmd/vpn.go:18 VPN command executed 2024-01-16T22:23:16.783+0100 DEBUG cmd/vpn.go:55 Mode: competitive 2024-01-16T22:23:16.783+0100 DEBUG vpn/vpn.go:144 VPN config file : [] ? VPN was not found. Would you like to download it ? Yes 2024-01-16T22:23:20.371+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=labs 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.372+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=competitive 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=endgames 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=starting_point 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=fortresses 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.692+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.692+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/413/0 2024-01-16T22:23:20.692+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.693+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.693+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.694+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/429/0 2024-01-16T22:23:20.694+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.695+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.700+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.700+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:23:20.701+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.701+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.770+0100 INFO utils/utils.go:384 Sending an HTTP HTB request ⠋2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/244/0 2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.858+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:387 Request body: {} VPN : EU_Labs_2 downloaded successfully VPN : EU_Endgame_VIP_1 downloaded successfully VPN : EU_Release_Arena_2 downloaded successfully VPN : EU_StartingPoint_VIP_1 downloaded successfully VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/kali/.local/htb-cli 2024-01-16T22:23:23.470+0100 INFO vpn/vpn.go:154 VPN is starting... 2024-01-16T22:23:23.511+0100 DEBUG vpn/vpn.go:164 VPN processes: [] VPN Started Successfully! 2024-01-16T22:23:26.567+0100 INFO cmd/vpn.go:139 Exit vpn command correctly

❯ ps aux | grep openvpn kali 144289 0.0 0.0 2584 1536 pts/1 S 22:23 0:00 sh -c sudo openvpn /home/kali/.local/htb-cli/Release_Arena root 144290 0.1 0.0 16412 6528 pts/1 S 22:23 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 144291 0.0 0.0 16412 1896 pts/3 Ss+ 22:23 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 144292 0.2 0.1 15620 9984 pts/3 S 22:23 0:00 openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn kali 144444 0.0 0.0 6348 2176 pts/1 S+ 22:23 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

It works fine, htb shows green checkbox around connection and I can access the 10-network of htb.

Thanks for the Super quick fix!

QU35T-code commented 10 months ago

Now you can use : htb-cli vpn -m competitive --start and htb-cli vpn --stop to manage vpns (https://htb-cli-documentation.qu35t.pw/commands/vpn/)

re-running listed steps:

❯ go install github.com/GoToolSharing/htb-cli@dev ~/dev/ctf/htb │ master ?115 ❯ htb-cli version Development version (dev branch)

❯ ps aux | grep openvpn kali 128468 0.0 0.0 2584 1664 pts/1 S 22:08 0:00 sh -c sudo openvpn /home/kali/.local/htb-cli/_ReleaseArena root 128469 0.0 0.0 16412 6528 pts/1 S 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128470 0.0 0.0 16412 2004 pts/3 Ss+ 22:08 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 128471 0.0 0.1 15620 9984 pts/3 S 22:08 0:00 openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn kali 143346 0.0 0.0 6348 2048 pts/1 S+ 22:22 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

❯ pkill openvpn pkill: killing pid 128471 failed: Operation not permitted

❯ sudo pkill openvpn

❯ ps aux | grep openvpn kali 143586 0.0 0.0 6348 2176 pts/1 S+ 22:22 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

❯ pgrep -fa openvpn

❯ rm ~/.local/htb-cli/*.ovpn

❯ htb-cli vpn -m competitive --start -vvv 2024-01-16T22:23:16.782+0100 DEBUG cmd/root.go:24 Verbosity level : 3 2024-01-16T22:23:16.782+0100 INFO config/config.go:180 Loading configuration file... 2024-01-16T22:23:16.782+0100 INFO config/config.go:186 Configuration successfully loaded 2024-01-16T22:23:16.783+0100 DEBUG config/config.go:187 map[Discord:False Update:False] 2024-01-16T22:23:16.783+0100 DEBUG cmd/root.go:30 Check for updates : false 2024-01-16T22:23:16.783+0100 DEBUG update/update.go:14 config.Version: dev 2024-01-16T22:23:16.783+0100 INFO update/update.go:16 Development version detected 2024-01-16T22:23:16.783+0100 DEBUG cmd/root.go:37 Message : Development version (git pull to update) 2024-01-16T22:23:16.783+0100 INFO cmd/vpn.go:18 VPN command executed 2024-01-16T22:23:16.783+0100 DEBUG cmd/vpn.go:55 Mode: competitive 2024-01-16T22:23:16.783+0100 DEBUG vpn/vpn.go:144 VPN config file : [] ? VPN was not found. Would you like to download it ? Yes 2024-01-16T22:23:20.371+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=labs 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.371+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.372+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=competitive 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=endgames 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=starting_point 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} ⠋2024-01-16T22:23:20.373+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/connections/servers?product=fortresses 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.373+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.692+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.692+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/413/0 2024-01-16T22:23:20.692+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.693+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.693+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.694+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/429/0 2024-01-16T22:23:20.694+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.695+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.700+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.700+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:23:20.701+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.701+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.770+0100 INFO utils/utils.go:384 Sending an HTTP HTB request ⠋2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/244/0 2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.770+0100 DEBUG utils/utils.go:387 Request body: {} 2024-01-16T22:23:20.858+0100 INFO utils/utils.go:384 Sending an HTTP HTB request 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:385 Request URL: https://labs.hackthebox.com/api/v4/access/ovpnfile/314/0 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:386 Request method: GET 2024-01-16T22:23:20.859+0100 DEBUG utils/utils.go:387 Request body: {} VPN : EU_Labs_2 downloaded successfully VPN : EU_Endgame_VIP_1 downloaded successfully VPN : EU_Release_Arena_2 downloaded successfully VPN : EU_StartingPoint_VIP_1 downloaded successfully VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/kali/.local/htb-cli 2024-01-16T22:23:23.470+0100 INFO vpn/vpn.go:154 VPN is starting... 2024-01-16T22:23:23.511+0100 DEBUG vpn/vpn.go:164 VPN processes: [] VPN Started Successfully! 2024-01-16T22:23:26.567+0100 INFO cmd/vpn.go:139 Exit vpn command correctly

❯ ps aux | grep openvpn kali 144289 0.0 0.0 2584 1536 pts/1 S 22:23 0:00 sh -c sudo openvpn /home/kali/.local/htb-cli/_ReleaseArena root 144290 0.1 0.0 16412 6528 pts/1 S 22:23 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 144291 0.0 0.0 16412 1896 pts/3 Ss+ 22:23 0:00 sudo openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn root 144292 0.2 0.1 15620 9984 pts/3 S 22:23 0:00 openvpn /home/kali/.local/htb-cli/EU_Release_Arena_2-vpn.ovpn kali 144444 0.0 0.0 6348 2176 pts/1 S+ 22:23 0:00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox openvpn

It works fine, htb shows green checkbox around connection and I can access the 10-network of htb.

Thanks for the Super quick fix!

suljov commented 10 months ago
```shell
htb-cli vpn -m competitive --start -vvv

yes it kinda seems to work. tho did i try it on my kali in wsl but should be no diff in a vm. tho i cant start the comp.

$ htb-cli vpn -m competitive --start
? VPN was not found. Would you like to download it ? Yes
You do not have permissions to download the following vpn: endgames
VPN : EU_Labs_1 downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully
VPN :  downloaded successfully
VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/suljov/.local/htb-cli
VPN Started Successfully!

┌──(suljov㉿electroville)-[~]
└─$ htb-cli vpn -m competitive --start
2024-01-17T12:14:59.195+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267

┌──(suljov㉿electroville)-[~]
└─$ ls /home/suljov/.local/htb-cli/
default.conf  EU_Fortress_1-vpn.ovpn  EU_Labs_1-vpn.ovpn  EU_Release_Arena_1-vpn.ovpn  -vpn.ovpn
$ htb-cli vpn -m competitive --start -vvv
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-17T12:16:39.854+0100    INFO    config/config.go:180    Loading configuration file...
2024-01-17T12:16:39.854+0100    INFO    config/config.go:186    Configuration successfully loaded
2024-01-17T12:16:39.854+0100    DEBUG   config/config.go:187    map[Discord:False Update:False]
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:30  Check for updates : false
2024-01-17T12:16:39.854+0100    DEBUG   update/update.go:14     config.Version: dev
2024-01-17T12:16:39.854+0100    INFO    update/update.go:16     Development version detected
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:37  Message : Development version (git pull to update)
2024-01-17T12:16:39.854+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-17T12:16:39.854+0100    DEBUG   cmd/vpn.go:55   Mode: competitive
2024-01-17T12:16:39.854+0100    DEBUG   vpn/vpn.go:144  VPN config file : [/home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn]
2024-01-17T12:16:39.854+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:164  VPN processes: [suljov    1212  0.0  0.0   2580   888 pts/0    S    12:12   0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena* root      1213  0.0  0.0  15920  6244 pts/0    S    12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1214  0.0  0.0  15920   940 pts/1    Ss+  12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1215  0.0  0.1  14512  9564 pts/1    S    12:12   0:00 openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn ]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:174  parts: [suljov 1212 0.0 0.0 2580 888 pts/0 S 12:12 0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena*]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:176  processPath: /home/suljov/.local/htb-cli/*Release_Arena*
2024-01-17T12:16:39.856+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267
QU35T-code commented 10 months ago
```shell
htb-cli vpn -m competitive --start -vvv

yes it kinda seems to work. tho did i try it on my kali in wsl but should be no diff in a vm. tho i cant start the comp.

$ htb-cli vpn -m competitive --start
? VPN was not found. Would you like to download it ? Yes
You do not have permissions to download the following vpn: endgames
VPN : EU_Labs_1 downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully
VPN :  downloaded successfully
VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/suljov/.local/htb-cli
VPN Started Successfully!

┌──(suljov㉿electroville)-[~]
└─$ htb-cli vpn -m competitive --start
2024-01-17T12:14:59.195+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267

┌──(suljov㉿electroville)-[~]
└─$ ls /home/suljov/.local/htb-cli/
default.conf  EU_Fortress_1-vpn.ovpn  EU_Labs_1-vpn.ovpn  EU_Release_Arena_1-vpn.ovpn  -vpn.ovpn
$ htb-cli vpn -m competitive --start -vvv
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-17T12:16:39.854+0100    INFO    config/config.go:180    Loading configuration file...
2024-01-17T12:16:39.854+0100    INFO    config/config.go:186    Configuration successfully loaded
2024-01-17T12:16:39.854+0100    DEBUG   config/config.go:187    map[Discord:False Update:False]
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:30  Check for updates : false
2024-01-17T12:16:39.854+0100    DEBUG   update/update.go:14     config.Version: dev
2024-01-17T12:16:39.854+0100    INFO    update/update.go:16     Development version detected
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:37  Message : Development version (git pull to update)
2024-01-17T12:16:39.854+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-17T12:16:39.854+0100    DEBUG   cmd/vpn.go:55   Mode: competitive
2024-01-17T12:16:39.854+0100    DEBUG   vpn/vpn.go:144  VPN config file : [/home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn]
2024-01-17T12:16:39.854+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:164  VPN processes: [suljov    1212  0.0  0.0   2580   888 pts/0    S    12:12   0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena* root      1213  0.0  0.0  15920  6244 pts/0    S    12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1214  0.0  0.0  15920   940 pts/1    Ss+  12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1215  0.0  0.1  14512  9564 pts/1    S    12:12   0:00 openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn ]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:174  parts: [suljov 1212 0.0 0.0 2580 888 pts/0 S 12:12 0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena*]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:176  processPath: /home/suljov/.local/htb-cli/*Release_Arena*
2024-01-17T12:16:39.856+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267

Please, can you run :

rm -rf ~/.local/htb-cli/*.ovpn
pkill openvpn
htb-cli vpn --list
htb-cli vpn -m competitive --start -vvv
ls -la /home/suljov/.local/htb-cli/
suljov commented 10 months ago
```shell
htb-cli vpn -m competitive --start -vvv

yes it kinda seems to work. tho did i try it on my kali in wsl but should be no diff in a vm. tho i cant start the comp.

$ htb-cli vpn -m competitive --start
? VPN was not found. Would you like to download it ? Yes
You do not have permissions to download the following vpn: endgames
VPN : EU_Labs_1 downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully
VPN :  downloaded successfully
VPN : EU_Fortress_1 downloaded successfully

VPNs are located at the following path : /home/suljov/.local/htb-cli
VPN Started Successfully!

┌──(suljov㉿electroville)-[~]
└─$ htb-cli vpn -m competitive --start
2024-01-17T12:14:59.195+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267

┌──(suljov㉿electroville)-[~]
└─$ ls /home/suljov/.local/htb-cli/
default.conf  EU_Fortress_1-vpn.ovpn  EU_Labs_1-vpn.ovpn  EU_Release_Arena_1-vpn.ovpn  -vpn.ovpn
$ htb-cli vpn -m competitive --start -vvv
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:24  Verbosity level : 3
2024-01-17T12:16:39.854+0100    INFO    config/config.go:180    Loading configuration file...
2024-01-17T12:16:39.854+0100    INFO    config/config.go:186    Configuration successfully loaded
2024-01-17T12:16:39.854+0100    DEBUG   config/config.go:187    map[Discord:False Update:False]
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:30  Check for updates : false
2024-01-17T12:16:39.854+0100    DEBUG   update/update.go:14     config.Version: dev
2024-01-17T12:16:39.854+0100    INFO    update/update.go:16     Development version detected
2024-01-17T12:16:39.854+0100    DEBUG   cmd/root.go:37  Message : Development version (git pull to update)
2024-01-17T12:16:39.854+0100    INFO    cmd/vpn.go:18   VPN command executed
2024-01-17T12:16:39.854+0100    DEBUG   cmd/vpn.go:55   Mode: competitive
2024-01-17T12:16:39.854+0100    DEBUG   vpn/vpn.go:144  VPN config file : [/home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn]
2024-01-17T12:16:39.854+0100    INFO    vpn/vpn.go:154  VPN is starting...
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:164  VPN processes: [suljov    1212  0.0  0.0   2580   888 pts/0    S    12:12   0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena* root      1213  0.0  0.0  15920  6244 pts/0    S    12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1214  0.0  0.0  15920   940 pts/1    Ss+  12:12   0:00 sudo openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn root      1215  0.0  0.1  14512  9564 pts/1    S    12:12   0:00 openvpn /home/suljov/.local/htb-cli/EU_Release_Arena_1-vpn.ovpn ]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:174  parts: [suljov 1212 0.0 0.0 2580 888 pts/0 S 12:12 0:00 sh -c sudo openvpn /home/suljov/.local/htb-cli/*Release_Arena*]
2024-01-17T12:16:39.856+0100    DEBUG   vpn/vpn.go:176  processPath: /home/suljov/.local/htb-cli/*Release_Arena*
2024-01-17T12:16:39.856+0100    ERROR   cmd/vpn.go:122          {"error": "error reading file /home/suljov/.local/htb-cli/*Release_Arena*: open /home/suljov/.local/htb-cli/*Release_Arena*: no such file or directory"}
github.com/GoToolSharing/htb-cli/cmd.glob..func15
        /home/suljov/htb-cli/cmd/vpn.go:122
github.com/spf13/cobra.(*Command).execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876
github.com/spf13/cobra.(*Command).ExecuteC
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990
github.com/spf13/cobra.(*Command).Execute
        /home/suljov/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918
github.com/GoToolSharing/htb-cli/cmd.Execute
        /home/suljov/htb-cli/cmd/root.go:46
main.main
        /home/suljov/htb-cli/main.go:8
runtime.main
        /usr/lib/go/src/runtime/proc.go:267

Please, can you run :

rm -rf ~/.local/htb-cli/*.ovpn
pkill openvpn
htb-cli vpn --list
htb-cli vpn -m competitive --start -vvv
ls -la /home/suljov/.local/htb-cli/

i kinda fixed it. i just re-installed using the command

go install github.com/GoToolSharing/htb-cli@dev

and made sure everything is in the PATH. tho i think this error comes up cuz if you try to start/download the vpn again then it gets a error. not sure.

but it seems to work. i just didnt read the docs enough to test start a comp machine the right way.

good job mate!

QU35T-code commented 10 months ago

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

suljov commented 10 months ago

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice!

one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

QU35T-code commented 10 months ago

Which machine's ip are you trying to retrieve? release ?

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice!

one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

suljov commented 10 months ago

Which machine's ip are you trying to retrieve?

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice! one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

the comp machine. currently its Monitored. right now htb-cli is just waiting to fetch ip. the tool can start the machine no problem.

QU35T-code commented 10 months ago

Which machine's ip are you trying to retrieve?

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice! one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

the comp machine. currently its Monitored. right now htb-cli is just waiting to fetch ip. the tool can start the machine no problem.

Can you compare with this command ?

❯ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
Machine spawned! Playing on the competitive server
Target: 10.129.237.169
htb-cli start -m Monitored  0.04s user 0.02s system 1% cpu 3.632 total
QU35T-code commented 10 months ago

Can be related to this issue : https://github.com/GoToolSharing/htb-cli/issues/98

suljov commented 10 months ago

Which machine's ip are you trying to retrieve?

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice! one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

the comp machine. currently its Monitored. right now htb-cli is just waiting to fetch ip. the tool can start the machine no problem.

Can you compare with this command ?

❯ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
Machine spawned! Playing on the competitive server
Target: 10.129.237.169
htb-cli start -m Monitored  0.04s user 0.02s system 1% cpu 3.632 total

get the same no mather what. kinda

$ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
⠸ Waiting for the machine to start in order to fetch the IP address (this might take a while).
$ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
Machine spawned! Playing on a free server
Target:

real    507.13s
user    0.99s
sys     1.63s
cpu     0%

get no ip tho

QU35T-code commented 10 months ago

Which machine's ip are you trying to retrieve?

It's only a v1, a few checks are missing to avoid bugs like this one. It's cool if it works 🎉

nice! one thing to maybe look over is that it takes some time to fetch the ip of the machine. maybe look over it and see if it can get better/faster. this might be just on my machine idk

the comp machine. currently its Monitored. right now htb-cli is just waiting to fetch ip. the tool can start the machine no problem.

Can you compare with this command ?

❯ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
Machine spawned! Playing on the competitive server
Target: 10.129.237.169
htb-cli start -m Monitored  0.04s user 0.02s system 1% cpu 3.632 total

get the same no mather what. kinda

$ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
⠸ Waiting for the machine to start in order to fetch the IP address (this might take a while).
$ time htb-cli start -m Monitored
? The following machine was found : Monitored Yes
Machine spawned! Playing on a free server
Target:

real    507.13s
user    0.99s
sys     1.63s
cpu     0%

get no ip tho

Yes it's this issue -> #98

Let's move on to the other issue