ThePorgs / Exegol

Fully featured and community-driven hacking environment
https://exegol.readthedocs.io/
GNU General Public License v3.0
1.95k stars 191 forks source link

Incorrect port syntax : using vpn #205

Closed noahfraiture closed 9 months ago

noahfraiture commented 9 months ago

Describe the bug

Hello, when I try to create a container with a vpn connection, I got an error about the format. I use an openvpn configuration from Proton.

exegol start -vpn <path>/node-fr-18.protonvpn.net.udp.ovpn
[...]
[*] You can use a name that does not already exist to build a new image from local sources                                                                                                                                                               
[?] Select an image by its name (nightly): 
[V] Config: Enabling display sharing                                                                                                                                                                                                                     
[V] Config: Enabling host timezones                                                                                                                                                                                                                      
[V] Volume was successfully added for /etc/timezone                                                                                                                                                                                                      
[V] Volume was successfully added for /etc/localtime                                                                                                                                                                                                     
[!] Incorrect port syntax (n). Please use this format: [<host_ipv4>:]<host_port>[:<container_port>][:<protocol>]

The configuration :

client
dev tun
proto udp

remote 146.70.194.50 80
remote 146.70.194.50 1194
remote 146.70.194.50 4569
remote 146.70.194.50 5060
remote 146.70.194.50 51820

remote-random
resolv-retry infinite
nobind

cipher AES-256-GCM

setenv CLIENT_CERT 0
tun-mtu 1500
mssfix 0
persist-key
persist-tun

reneg-sec 0

remote-cert-tls server
auth-user-pass <pathToCredentials>
[certificates]

The openvpn configuration works well outsite exegol

Steps To Reproduce

  1. Create a new exegol container with an openvpn file from protonVPN
  2. Choose nightly version
  3. Crash

Exegol Wrapper Version

exegol version -vvv
[*] Exegol is currently in version v4.3.1
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏                                                                                                                                                                                  
[+] We thank HackTheBox for sponsoring the multi-arch support 💚                                                                                                                                                                                         
[D] Pip installation: Off 🪓                                                                                                                                                                                                                             
[D] Git source installation: On ✔                                                                                                                                                                                                                        
[D] Host OS: Linux (Kernel)                                                                                                                                                                                                                              
[D] Arch: amd64                                                                                                                                                                                                                                          
[D] Raw arch: x86_64                                                                                                                                                                                                                                     
[D] Docker desktop: Off 🪓                                                                                                                                                                                                                               
[D] Shell type: Linux                                                                                                                                                                                                                                    
[D] Last wrapper update check: 15/02/2024

### Host OS

Linux

### Configuration of the concerned container

_No response_

### Execution logs in debug mode

```Text
[*] Exegol is currently in version v4.3.1
[*] Exegol Discord serv.: https://discord.gg/cXThyp7D6P
[*] Exegol documentation: https://exegol.rtfd.io/
[+] We thank Capgemini for supporting the project (helping with dev) 🙏                                                                                                                                                                                  
[+] We thank HackTheBox for sponsoring the multi-arch support 💚                                                                                                                                                                                         
[D] Pip installation: Off 🪓                                                                                                                                                                                                                             
[D] Git source installation: On ✔                                                                                                                                                                                                                        
[D] Host OS: Linux (Kernel)                                                                                                                                                                                                                              
[D] Arch: amd64                                                                                                                                                                                                                                          
[D] Raw arch: x86_64                                                                                                                                                                                                                                     
[D] Docker desktop: Off 🪓                                                                                                                                                                                                                               
[D] Shell type: Linux                                                                                                                                                                                                                                    
[D] Last wrapper update check: 15/02/2024                                                                                                                                                                                                                

[*] Starting exegol                                                                                                                                                                                                                                      
[*] Arguments supplied with the command, skipping interactive mode                                                                                                                                                                                       
[D] Attribute not found in parameters: multicontainertag                                                                                                                                                                                                 
[V] Configuring new exegol container                                                                                                                                                                                                                     
[D] Attribute not found in parameters: multiimagetag                                                                                                                                                                                                     
[D] Fetching remote image tags, digests and sizes                                                                                                                                                                                                        
[D] Fetching information from: https://hub.docker.com/v2/repositories/nwodtuhs/exegol/tags?page_size=20                                                                                                                                                  
[D] Fetching information from: https://hub.docker.com/v2/repositories/nwodtuhs/exegol/tags?page=2&page_size=20                                                                                                                                           
[D] Max page limit reached. In non-verbose mode, downloads will stop there.                                                                                                                                                                              
[D] Fetching information from: https://hub.docker.com/v2/repositories/nwodtuhs/exegol/tags?page=3&page_size=20                                                                                                                                           
[D] Fetching information from: https://hub.docker.com/v2/repositories/nwodtuhs/exegol/tags?page=4&page_size=20                                                                                                                                           
[D] Fetching local image tags, digests (and other attributes)                                                                                                                                                                                            
[D] Comparing and merging local and remote images data                                                                                                                                                                                                   
[D] Searching a match for each image installed                                                                                                                                                                                                           
[D] └── nightly → (remote) sha256:158ed782ac31cb9fd8c618b4e7f4dd2f53e1a233109a842e1a909b9ea481674b                                                                                                                                                       
[D] └── web     → (remote) sha256:14a539bcb8563c2834cac944794ba52b643c3f1c2156be5cf9142820a436c4f8                                                                                                                                                       
[D] └── osint   → (remote) sha256:63d09a6cf88f496285e8b9d6d4f550fc793c0a7792c0d9bbd9d1bcdfdc208798                                                                                                                                                       
[D] └── osint   → (remote) sha256:63d09a6cf88f496285e8b9d6d4f550fc793c0a7792c0d9bbd9d1bcdfdc208798                                                                                                                                                       
[D] └── light   → (remote) sha256:ca91e8abc6998c3f13f13222d3670d2b9f3c90a697aa650b33d11d60de9c4cd6                                                                                                                                                       
[D] └── light   → (remote) sha256:ca91e8abc6998c3f13f13222d3670d2b9f3c90a697aa650b33d11d60de9c4cd6                                                                                                                                                       
[D] └── full    → (remote) sha256:a87696f3b27523be0dc5b915d7efcd6ef09bbd8f31f0ab61e8048b1f17c659e0                                                                                                                                                       
[D] └── ad      → (remote) sha256:41047b7a86315277b0b69191f0dfdd90bc4eb43056e8ade3fa715a0e8e7af09e                                                                                                                                                       
[D] └── ad      → (remote) sha256:41047b7a86315277b0b69191f0dfdd90bc4eb43056e8ade3fa715a0e8e7af09e                                                                                                                                                       
[D] └── web-3.1.1       → (remote) sha256:9108e175ebcd946d142de06f7ef8c7f8e9baaa996c83bf03c72b804239d925ba                                                                                                                                               
[D] └── osint-3.1.1     → (remote) sha256:4365185cd4082cac6bd05d97eab0c230ba1d2516b8c98e95e1b87e1eb125e3a3                                                                                                                                               
[D] └── light-3.1.1     → (remote) sha256:19a6748bfafb103cdfc51cb4a33ae931d4ffc81b8824399d20e1f9802ef744f8                                                                                                                                               
[D] └── full-3.1.1      → (remote) sha256:3d40ce1506e100b53cf27a653b1cad8ec7bfc1ceefeaa9a7f84e422942afeff3                                                                                                                                               
[D] └── full-3.1.1      → (remote) sha256:3d40ce1506e100b53cf27a653b1cad8ec7bfc1ceefeaa9a7f84e422942afeff3                                                                                                                                               
[D] └── ad-3.1.1        → (remote) sha256:6e7f9fbc6ec5d3609b5c9e3dfbad4584e68196a82978201509be7830a85d6357                                                                                                                                               
[D] └── ad-3.1.1        → (remote) sha256:6e7f9fbc6ec5d3609b5c9e3dfbad4584e68196a82978201509be7830a85d6357                                                                                                                                               
[D] └── web-3.1.0       → (remote) sha256:ca359990a79416693b00fac13cfc2f22a1e84e28106f982aa16a91bd84e5d3f2                                                                                                                                               
[D] └── web-3.1.0       → (remote) sha256:ca359990a79416693b00fac13cfc2f22a1e84e28106f982aa16a91bd84e5d3f2                                                                                                                                               
[D] └── osint-3.1.0     → (remote) sha256:335acb243b310c66ca011665d4e7462a427686eef217ac8dc9a2be45cea4eaea                                                                                                                                               
[D] └── light-3.1.0     → (remote) sha256:96c388d0d36695d71b0665dc9f966b438a562c72cba9c6f9fc97c97b6073017f                                                                                                                                               
[D] └── light-3.1.0     → (remote) sha256:96c388d0d36695d71b0665dc9f966b438a562c72cba9c6f9fc97c97b6073017f                                                                                                                                               
[D] └── ad-3.1.0        → (remote) sha256:2c9ced02cf893114557b17577a34c14b7030c5715d174b8e8ac2a2500da29d58                                                                                                                                               
[D] └── full-3.1.0      → (remote) sha256:b4c29bf24ec7d6055eaef632dbc8915d403f4b349da14599b9282e6f1ec6f695                                                                                                                                               
[D] └── full-3.1.0      → (remote) sha256:b4c29bf24ec7d6055eaef632dbc8915d403f4b349da14599b9282e6f1ec6f695                                                                                                                                               
[D] └── web-3.0.2       → (remote) sha256:2d48210c019f5b4014c8121c908bb832a0a41e78ab9dc70d396c84197619e5c8                                                                                                                                               
[D] └── osint-3.0.2     → (remote) sha256:69dd1008f8c80d2ab0310b1fd21c7aa5afdc58a349166e809805e2a38c8e5e22                                                                                                                                               
[D] └── full-3.0.2      → (remote) sha256:2c2257cb94a8047cd03c59c512c295b89101e5982105e982c406ed850deef7d9                                                                                                                                               
[D] └── full-3.0.2      → (remote) sha256:2c2257cb94a8047cd03c59c512c295b89101e5982105e982c406ed850deef7d9                                                                                                                                               
[D] └── light-3.0.2     → (remote) sha256:28b31faa4a4edf5a66fb21303a86e290d7178fb57a905ef135b933cfddf7e987                                                                                                                                               
[D] └── light-3.0.2     → (remote) sha256:28b31faa4a4edf5a66fb21303a86e290d7178fb57a905ef135b933cfddf7e987                                                                                                                                               
[D] └── ad-3.0.2        → (remote) sha256:3c72c440a5e087e1f90fdadd259ac6f01b8a8f0813510405ee5b2eb6830d85cd                                                                                                                                               
[D] └── web-3.0.1       → (remote) sha256:901640f976728b005c1291fc791db173583be4ce77e06c656fcc9ca1d90b9f78                                                                                                                                               
[D] └── osint-3.0.1     → (remote) sha256:6792268d4ffd890010482584becd8b04666025b71766b0fea76ed355d6b14c4c                                                                                                                                               
[D] └── light-3.0.1     → (remote) sha256:7f4cf4a55f34cc2419b57c8b4286be4e5a053316ecce2e23cce5f17a38590571                                                                                                                                               
[D] └── light-3.0.1     → (remote) sha256:7f4cf4a55f34cc2419b57c8b4286be4e5a053316ecce2e23cce5f17a38590571                                                                                                                                               
[D] └── full-3.0.1      → (remote) sha256:b595b71adbf4f0edc32a388f87771de377d82e059e0f9459fb62b49eb938b5cd                                                                                                                                               
[D] └── full-3.0.1      → (remote) sha256:b595b71adbf4f0edc32a388f87771de377d82e059e0f9459fb62b49eb938b5cd                                                                                                                                               
[D] └── ad-3.0.1        → (remote) sha256:4fc6a3d2d28929f13fb74ff4e9258f51daa8986a0603aaa37ad109bacc7f9381                                                                                                                                               
[D] └── light-3.0.0     → (remote) sha256:2fe0e78dcf1924785bffeb20b52ecde82609f9c91c0fad883bb293dd65d7443d                                                                                                                                               
[D] └── osint-3.0.0     → (remote) sha256:13b3d0f9d9946b0105c997260f84a5b3ea0e35d1b1da974a033def9375c109ea                                                                                                                                               
[D] └── web-3.0.0       → (remote) sha256:fe361319498cdbf0c62688fc675902a54dc12ceff164ef193789d67d1140d970                                                                                                                                               
[D] └── web-3.0.0       → (remote) sha256:fe361319498cdbf0c62688fc675902a54dc12ceff164ef193789d67d1140d970                                                                                                                                               
[D] └── ad-3.0.0        → (remote) sha256:a174289246c5ce40227a52caf4d82faf81420c915791caad6bbf85c7d02cd5c9                                                                                                                                               
[D] └── full-3.0.0      → (remote) sha256:6751cd3bf83461623a9bfab29c36edfef8b5d4e9b80c11015cf53a0061099dce                                                                                                                                               
[D] └── full-3.0.0      → (remote) sha256:6751cd3bf83461623a9bfab29c36edfef8b5d4e9b80c11015cf53a0061099dce                                                                                                                                               
[D] └── full-2.1.1      → (remote) sha256:c19d64e74f346999991a82a740acb392bf0da6c2fbb680c2403250f2bba31cfc                                                                                                                                               
[D] └── ad-2.1.1        → (remote) sha256:b2b9a7642cd765daae0e0e517544cb4f5b0b77f8149f19165479fceb92f14f84                                                                                                                                               
[D] └── web-2.1.1       → (remote) sha256:6ce49800b576f2f97d665e63ab0cb4fb946cf3d575b5918887e93887afe3c2d8                                                                                                                                               
[D] └── light-2.1.1     → (remote) sha256:c048d0ebe19613e01e65d27013c5174fb41cccbe2fd9f8cde9cbb2a56b919371                                                                                                                                               
[D] └── osint-2.1.1     → (remote) sha256:ffe3c2d9693b0b52d11d9104dd2a33f2cf2037b412249db340d59d7ee01497fa                                                                                                                                               
[D] └── full-2.1.0      → (remote) sha256:2462e5169f04b72123ab28d34ae7b326d40240097bcebe65bc968ade06c36a9c                                                                                                                                               
[D] └── ad-2.1.0        → (remote) sha256:eda497aebe8e35d685be9057793606c297548519dd16526b302d50a8f959179d                                                                                                                                               
[D] └── web-2.1.0       → (remote) sha256:4520239532ce14afdfb87e4fcd9633096b90a3e8a28d8b02044e628c53cfb17f                                                                                                                                               
[D] └── light-2.1.0     → (remote) sha256:ffa088736d8a3e2bab9cf3e3ae2b816d779e2a6a984ed41012ef989e3524e8b3                                                                                                                                               
[D] └── osint-2.1.0     → (remote) sha256:f706f54024324899836f7568aeda8608dacd93a98d7114cd5f5b3fd093beba08                                                                                                                                               
[D] └── full-2.0.2      → (remote) N/A                                                                                                                                                                                                                   
[D] └── light-2.0.2     → (remote) N/A                                                                                                                                                                                                                   
[D] └── ad-2.0.2        → (remote) N/A                                                                                                                                                                                                                   
[D] └── web-2.0.2       → (remote) N/A                                                                                                                                                                                                                   
[D] └── osint-2.0.2     → (remote) N/A                                                                                                                                                                                                                   
[D] └── full-2.0.1      → (remote) N/A                                                                                                                                                                                                                   
[D] └── ad-2.0.1        → (remote) N/A                                                                                                                                                                                                                   
[D] └── web-2.0.1       → (remote) N/A                                                                                                                                                                                                                   
[D] └── light-2.0.1     → (remote) N/A                                                                                                                                                                                                                   
[D] └── osint-2.0.1     → (remote) N/A                                                                                                                                                                                                                   
[D] └── web-2.0.0       → (remote) N/A                                                                                                                                                                                                                   
[D] └── light-2.0.0     → (remote) N/A                                                                                                                                                                                                                   
[D] └── osint-2.0.0     → (remote) N/A                                                                                                                                                                                                                   
[D] └── full-2.0.0b5    → (remote) N/A                                                                                                                                                                                                                   
[D] └── ad-2.0.0b5      → (remote) N/A                                                                                                                                                                                                                   
[D] └── web-2.0.0b5     → (remote) N/A                                                                                                                                                                                                                   
[D] └── light-2.0.0b5   → (remote) N/A                                                                                                                                                                                                                   
[D] └── osint-2.0.0b5   → (remote) N/A                                                                                                                                                                                                                   
[D] Updating image cache data                                                                                                                                                                                                                            
[D] └── nightly (version: 58d605bb)     → (remote) sha256:158ed782ac31cb9fd8c618b4e7f4dd2f53e1a233109a842e1a909b9ea481674b                                                                                                                               
[D] └── web (version: 3.1.2)    → (remote) sha256:14a539bcb8563c2834cac944794ba52b643c3f1c2156be5cf9142820a436c4f8                                                                                                                                       
[D] └── osint (version: 3.1.2)  → (remote) sha256:63d09a6cf88f496285e8b9d6d4f550fc793c0a7792c0d9bbd9d1bcdfdc208798                                                                                                                                       
[D] └── light (version: 3.1.2)  → (remote) sha256:ca91e8abc6998c3f13f13222d3670d2b9f3c90a697aa650b33d11d60de9c4cd6                                                                                                                                       
[D] └── full (version: 3.1.2)   → (remote) sha256:a87696f3b27523be0dc5b915d7efcd6ef09bbd8f31f0ab61e8048b1f17c659e0                                                                                                                                       
[D] └── ad (version: 3.1.2)     → (remote) sha256:41047b7a86315277b0b69191f0dfdd90bc4eb43056e8ade3fa715a0e8e7af09e                                                                                                                                       

🛸 Available images                                                                                            
┌───────────────┬─────────────────┬───────────────┬──────────────┬──────────────────┬─────────────────────────┐
│ Id            │ Image tag       │ Download size │ Size on disk │ Build date (UTC) │ Status                  │
├───────────────┼─────────────────┼───────────────┼──────────────┼──────────────────┼─────────────────────────┤
│ 3ddb48cccf32  │ nightly (amd64) │ 21.2GB        │ 50.5GB       │ 20/12/2023 18:39 │ Up to date (v.58d605bb) │
│ Not installed │ web (amd64)     │ 9.0GB         │ ~23.5GB      │ N/A              │ Not installed           │
│ Not installed │ osint (amd64)   │ 5.1GB         │ ~13.3GB      │ N/A              │ Not installed           │
│ Not installed │ light (amd64)   │ 5.5GB         │ ~14.2GB      │ N/A              │ Not installed           │
│ Not installed │ full (amd64)    │ 21.3GB        │ ~55.3GB      │ N/A              │ Not installed           │
│ Not installed │ ad (amd64)      │ 15.5GB        │ ~40.4GB      │ N/A              │ Not installed           │
└───────────────┴─────────────────┴───────────────┴──────────────┴──────────────────┴─────────────────────────┘

[*] You can use a name that does not already exist to build a new image from local sources                                                                                                                                                               
[?] Select an image by its name (nightly): 
[V] Config: Enabling display sharing                                                                                                                                                                                                                     
[V] Config: Enabling host timezones                                                                                                                                                                                                                      
[V] Volume was successfully added for /etc/timezone                                                                                                                                                                                                      
[V] Volume was successfully added for /etc/localtime                                                                                                                                                                                                     
[!] Incorrect port syntax (n). Please use this format: [<host_ipv4>:]<host_port>[:<container_port>][:<protocol>]

Exception

No response

Anything else?

No response

Dramelac commented 9 months ago

Hello, what is the full exegol command used ? The one submitted seems incomplete. It seems to have some argument missing.

noahfraiture commented 9 months ago

This was my full command, I wanted put the name and the image when exegol asked me how we can with exegol start. When I try exegol start france nightly --vpn <path>/vpn.ovpn --vpn-auth <path>/protonCredentials I get another problem. I first get this warning

[?] Are you sure you want to configure a VPN container based on the host's network? [y/N]: y
[!] Some OpenVPN config are missing to support VPN dynamic DNS servers! Please add the following line to your configuration file:

If I press 'N', my DNS is broken. I can ping 8.8.8.8 but not google.com. If I press 'y', I have a working dns but my host also send its connexion through the VPN. But I want to be able to separate the connection of my host and the connection of my container

Dramelac commented 9 months ago

But I want to be able to separate the connection of my host and the connection of my container

You have to choose 'N' to disable the sharing host network

For your DNS, if your VPN server provide a DNS server you must update your vpn config accordingly to the message provided by exegol. Otherwise you have to update yourself your dns server by updating /etc/resolv.conf. The default DNS server is the same one as your host but it might not be available while using your VPN try to use a public one.

And regarding your first error, I read it again, you have this error because you used -vpn (as -v -p -n) instead of --vpn.

Dramelac commented 9 months ago

In the absence of a reply, I'm going to close this ticket as my last reply should have solved the problem. If it doesn't, feel free to reopen it or create a ticket on the discord server for easier access to support. Have a nice day