ctf_marker
ctf_marker copied to clipboard
Adding the Admin User during 'CREATE Users & Teams' fails due to lack of T_TYPE
https://github.com/rgajendran/ctf_marker/blob/5135484c7a8e912249ecea7d1350cfabe5df3dd0/admin.php#L1014
The users DB is defined with
`T_TYPE` varchar(1) NOT NULL,
But the Admin user is added without T_TYPE, which causes:
Field 'T_TYPE' doesn't have a default value
I added the Admin user with a T_TYPE of L based on what I could see from other spots in the code. It seems to work. Should line 1014 include a T_TYPE of L?
Yes you are correct line 1014 should include T_TYPE.
There were some events where we distributed tokens to the users and asked them to register via homepage ( index.php ). Later I've added a new features which automatically generates random username and password.
Users Register using tokens : T_TYPE = T
Auto Generated Logins : T_TYPE = L
Admin can have any characters in T_TYPE (Except T and L) - This option isnt used for the admins.
I haven't noticed this bug after adding the new feature, I will label this issue as a bug and will fix in the later update. However, this project is merged with my new CTF platform project (which is under development : https://github.com/rgajendran/ctf_platform) which is integrated with oVirt Virtualisation, SecGen, CTF Marker and custom created platform.
Just pulled ctf_platfrom, same issue.
What version of mysql are you using?
I am on mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
I use xampp for this project (phpMyadmin version 4.5.2, Apache/2.4.23). Try using xampp : Download XAMPP It has both phpMyAdmin and Apache.
I just tested the marker on xampp, it works perfectly for me.
I don't recommended you to use ctf_platform (Its under development now). For now, you can continue using ctf_marker. In ctf_platform admin account is removed and the system automatically spins up vulnerable vm using secgen and it imports flags and sets timer you. However, its not ready yet.
I double checked it, it works on my Fedora aswell.
Incase if you haven't used XAMPP, follow these steps.
- download xampp (
xampp-linux-x64-5.6.31-0-installer.run) chmod +x xampp-linux-x64-5.6.31-0-installer.run./xampp-linux-x64-5.6.31-0-installer.run- Finish the process and run
./opt/lampp/manager-linux-x64.run - Click
Manage ServersTab -> StartapacheandMySQL database git clone https://github.com/rgajendran/ctf_marker(Clone inside/opt/lampp/htdocs/)- Visit
http://localhost/ctf_markerand navigate tohttp://localhost/ctf_marker/admin.php - Click Database Management -> Click Create (Create all 6 Create Buttons)
- In case if you are forcefully logged out after creating users tables (Login with admin:admin)
- After creating all tables, You can create teams with team name and generate either logins or tokens.
I hope it works for you, let me know if you have any issues.
Got it working when using XAMPP vs manual apache2 and MySQL.
Looks like MySQL and MariaDB don't behave the same way. Might be helpful to put that XAMPP is the approved hosting solution in the README.md
For reference, this is the version of MariaDB that works for me:
mysqld Ver 10.1.25-MariaDB for Linux on x86_64 (Source distribution)
Thanks for troubleshooting with me.
This was very helpful. Thank you both.