Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nordvpn how to obtain the private key #15

Open
trungkien006 opened this issue Sep 4, 2023 · 18 comments
Open

Nordvpn how to obtain the private key #15

trungkien006 opened this issue Sep 4, 2023 · 18 comments

Comments

@trungkien006
Copy link

URL to the Wiki page

https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers/nordvpn.md#obtain-your-wireguard-private-key

What's incorrect?

Nordvpn - Obtain your Wireguard private key via docker no longer work
https://github.com/qdm12/gluetun-wiki/blob/main/setup/providers/nordvpn.md#obtain-your-wireguard-private-key
If you need TOKEN to test it, please let me know, I am happy to help.

docker run --rm --cap-add=NET_ADMIN
-e TOKEN='e9fxxxxx' ghcr.io/bubuntux/nordlynx:get_private_key
Waiting for daemon to start up...
A new version of NordVPN is available! Please update the application.
Welcome to NordVPN! You can now connect to VPN by using 'nordvpn connect'.
A new version of NordVPN is available! Please update the application.
Technology is already set to 'NORDLYNX'.
A new version of NordVPN is available! Please update the application.
Connecting to Singapore #514 (sg514.nordvpn.com)
Whoops! Connection failed. Please try again. If the problem persists, contact our customer support.
############################################################
Device "nordlynx" does not exist.
IP:
Unable to access interface: No such device
Private Key:
\(^O^)/
############################################################

@joeydh
Copy link

joeydh commented Sep 5, 2023

I have the same problem, were you able to find another way to get the private key

@JAKAMI99
Copy link

NordVPN changed some things in the backend.
They revoked all private-keys.
You need to retrieve your private-key over their web interface again under manual setup.
Lately, you need to confirm the creation of a private key by mail.
Will have something to do with stolen NordVPN accounts, where people use the private-key from a 3rd party account.

@qdm12
Copy link
Owner

qdm12 commented Sep 24, 2023

@JAKAMI99 thanks!

Was this retrieval possible before, or is this a new feature on their web interface? And is this feature to stay?
I would rather get it from the interface and drop the dependency on the docker image / nordlynx to get it ideally.
Thanks!

@qdm12
Copy link
Owner

qdm12 commented Sep 24, 2023

I updated the wiki with what you mentioned @JAKAMI99 please open another issue if this doesn't resolve it to get your private key. Thanks!

@sebastianvelezg
Copy link

is it not possible to get the wireguard key now?? or is there a way??

@cedvan
Copy link

cedvan commented Nov 1, 2023

@sebastianvelezg this method work : https://gist.github.com/bluewalk/7b3db071c488c82c604baf76a42eaad3

@aounakram
Copy link

@sebastianvelezg this method work : https://gist.github.com/bluewalk/7b3db071c488c82c604baf76a42eaad3

This is the only way that worked for me. I didn't want to install NordVPN and Wireguard on my host system (Synology), so I ended up running an ubuntu VM, and doing the process on there. Retrieved the key, disconnected from Nord on the VM and shut it down, and then added and rebuilt my docker compose "project". No errors, and works well! Thanks for the link @sebastianvelezg !

@qdm12
Copy link
Owner

qdm12 commented Aug 1, 2024

Seeing these comments, is it still possible to create a key on their web interface @JAKAMI99 ??
If so, could you please provide the url to that page (even if it's behind a login wall)? Thanks!

EDIT: also related and perhaps outdated is qdm12/gluetun#134 (comment)

Re-opening this issue in order to clarify how to get the keys for nordvpn.

@qdm12 qdm12 reopened this Aug 1, 2024
@qdm12 qdm12 changed the title Nordvpn - Obtain your Wireguard private key via docker no longer work Nordvpn how to obtain the private key Aug 1, 2024
@Guyanthalas
Copy link

This is a website the has the capability of getting your key. They have many different ways to generate config files, as well as a web interface to get your key. However... the web interface does require your token submission to get the key so users beware.

https://github.com/mustafachyi/NordVPN-WireGuard-Config-Generator

@qdm12
Copy link
Owner

qdm12 commented Aug 3, 2024

Is it not possible to obtain the wg private key from Nordvpn's website directly?

@Guyanthalas
Copy link

Is it not possible to obtain the wg private key from Nordvpn's website directly?

Perhaps I'm just dull, but I don't see a way to do it via the website and a quick google search has LOTS of people looking for how to get the wg key. The Nord website lets you create a token to use for login purposes, but they are not the same thing as the key. Happy to be wrong though!

@stephenjoly
Copy link

I am not sure how this works but the website that is linked in the project above works (https://github.com/mustafachyi/NordVPN-WireGuard-Config-Generator?tab=readme-ov-file) --> https://nord-configs-crafter.pages.dev/key

I am curious as to how it gets this private key.

@Zalatis
Copy link

Zalatis commented Aug 20, 2024

I am not sure how this works but the website that is linked in the project above works (https://github.com/mustafachyi/NordVPN-WireGuard-Config-Generator?tab=readme-ov-file) --> https://nord-configs-crafter.pages.dev/key

I am curious as to how it gets this private key.

You can see how it is generated here :

import requests

def get_key(token):
    if not token:
        print("Error: Token is empty. Please provide a valid token.")
        return

    headers = {
        'Authorization': f'token:{token}'
    }

    try:
        response = requests.get("https://api.nordvpn.com/v1/users/services/credentials", headers=headers)
        response.raise_for_status()  # Check if the request was successful
        data = response.json()
        key = data.get('nordlynx_private_key')

        if key:
            print(f"Key: {key}")
        else:
            print("Key not found in the response")

    except Exception as e:
        print(f"Error fetching key: {e}")

if __name__ == "__main__":
    token = input("Enter your token: ").strip()
    get_key(token)

You basically need to call a API endpoint with the token you got from the manual setup on the nordvpn website

@Guyanthalas
Copy link

I'm not a developer, but since a different project has the ability to get the wireguard key via a token, a developer could theoretically use the same method within gluetun to get a wireguard key (looking at the above API). Once you have the WG key you really don't need to do this again, and since I was able to get mine things seem to be working well, but I'd say that its worth of a low priority request that you could submit your token via an environment variable and have gluetun automatically request and store the WG key if the token/api returns one.

I'm putting this in the "me asking and not actually doing anything about it", so it's certainly low priority. But, if one of the developers here knows how to do this kind of work, I think it would make the program more feature complete.

@KTH0R
Copy link

KTH0R commented Dec 14, 2024

For me, it's now impossible to get Private Keys, mustafachyi website was working, but they changed it and i'm not able to get throught the process now...

@neal421
Copy link

neal421 commented Dec 17, 2024

Same, unable to get a key from the website at this time.

@mustafachyi
Copy link

For me, it's now impossible to get Private Keys, mustafachyi website was working, but they changed it and i'm not able to get throught the process now...

check the new update it should have all you need and more ! (just updated)

@juanbretti
Copy link

I just got the token or nordlynx_private_key using this PowerShell script: https://gist.github.com/bluewalk/7b3db071c488c82c604baf76a42eaad3?permalink_comment_id=5272086#gistcomment-5272086

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests