Distribute OVPn keys


I will be hosting an event where a team will maximum contain 3 players and each player needs to get their own private ovpn key. So I plan to edit the CTFd team page code to make a system call and create 3 keys that show up after you have registered. But where would you recommend me to put these keys and in which html file would you recommend me to change?

I am thinking on the team page which shows up after you have registered, but maybe people will miss the keys there? Is there any better place?

It might be easiest / best to follow this plugin guide and change it to suit your needs.

I would think that it would be easiest to create a new custom page that the user clicks on to get these credentials. You will have to think about how you will securely store the credentials though.

Okay creating my own CTFd plugin will take some time I think. There is no way to make the docker create ovpn keys/profiles on the host? I got a bash script which creates a ovpn file: ./script.sh jimender
So it would only need to call that system function and then put them on some page after you have registered on account on CTFd.

Are you running the docker container or the actual python script @lee. You will need someway for the docker container to reach the host if you are using docker.

@jimender2 I am starting the docker with: docker-compose up

I just tried implementing email integration and adding email attachment in CTFd/utils/email/smtp.y where I got this code(I added code between the two comments line): https://pastebin.com/RdpHUyx4

I have made sure the bash script is in the docker folder and it works to run it, and access the ovpn file in the /root folder after that. But after I register a user, there is no email sent or received. The email settings in the admin panel should be right with the correct server, email and port.
I have tried with both port 587(TLS) and 456(SSL).

I have confirmed that the email settings are correct because if I use the normal smtp.py code without my additions, and try to send an email from the admin panel in CTFd to a user, it works to recieve that email.

I have added this in docker-compose.yml:
- LOG_FOLDER=/var/log/CTFd
- ACCESS_LOG=/var/log/CTFdAcc.log
- ERROR_LOG=/var/log/CTFdErr.log

But still I see no errors or something in the logs file after I try my new additions to smtp.py. So I don’t get any error or something so it’s difficult to debug…Do you have any thoughts what may be wrong or what I may be missing?