Top-Secret: Difference between revisions
No edit summary |
No edit summary |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
[[File:Top-secret-task.PNG|thumb|Top secret task]] | |||
[[File:000-config.PNG|thumb|000-default.conf]] | |||
===Description=== | ===Description=== | ||
Management found out that the highly sensitive and top secret documents are accessible to all! | Management found out that the highly sensitive and top secret documents are accessible to all! | ||
| Line 8: | Line 11: | ||
You must protect this apache web server with authentication! | You must protect this apache web server with authentication! | ||
Configure basic authentication to protect the page | Configure basic authentication to protect the page<blockquote>Use these credentials for authenticate | ||
Use these credentials for | |||
Username: mulder | Username: mulder | ||
Password: Scully-th3-b3st! | Password: Scully-th3-b3st!</blockquote> | ||
<blockquote> | |||
SSH Access: | SSH Access: | ||
| Line 23: | Line 23: | ||
Username: user | Username: user | ||
Password: Cool2Pass | Password: Cool2Pass</blockquote> | ||
===Solution=== | ===Solution=== | ||
The first thing I did was to make a .htpasswd file for the web page. | The first thing I did was to make a .htpasswd file for the web page. | ||
With the command <code>htpasswd -c / | With the command <code>sudo htpasswd -c /var/www/.htpasswd mulder</code> | ||
The program in question next asks for a password, which I set as instructed. Next I browsed to the folder<code>cd /etc/apache2/sites-enable/</code> and opened the file with the editor <code>000-default.conf</code>. | The program in question next asks for a password, which I set as instructed. Next I browsed to the folder<code>cd /etc/apache2/sites-enable/</code> and opened the file with the editor <code>000-default.conf</code>. | ||
I then added the following text to the file<syntaxhighlight lang="bash"> | I then added the following text to the file between <VirtualHost *:80></VirtualHost> tags<syntaxhighlight lang="bash"> | ||
<Directory "/var/www/html"> | <Directory "/var/www/html"> | ||
AuthType Basic | AuthType Basic | ||
AuthName "asd" | AuthName "asd" | ||
AuthUserFile / | AuthUserFile /var/www/.htpasswd | ||
Require valid-user | Require valid-user | ||
</Directory> | </Directory> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
I then restarted the apache2 service <code>service apache2 restart</code> | I then restarted the apache2 service <code>service apache2 restart</code> | ||
Test logging in with your browser and if everything works, submit the task for evaluation. | |||
===Tools=== | ===Tools=== | ||
* htpasswd | *htpasswd | ||
* nano | *nano | ||
* cd | *cd | ||
* service | *service | ||
===Flag=== | ===Flag=== | ||
No flag available, just set up basic authentication method. | |||
===Links=== | ===Links=== | ||
*[[CTF Challenges | Back to CTF Challenges page]] | *[[CTF Challenges | Back to CTF Challenges page]] | ||
Latest revision as of 13:16, 13 October 2022
Description
Management found out that the highly sensitive and top secret documents are accessible to all!
They must be hidden ASAP!
150pts
Task
You must protect this apache web server with authentication!
Configure basic authentication to protect the page
Use these credentials for authenticate
Username: mulder
Password: Scully-th3-b3st!
SSH Access:
Hostname: target....
Username: user
Password: Cool2Pass
Solution
The first thing I did was to make a .htpasswd file for the web page.
With the command sudo htpasswd -c /var/www/.htpasswd mulder
The program in question next asks for a password, which I set as instructed. Next I browsed to the foldercd /etc/apache2/sites-enable/ and opened the file with the editor 000-default.conf.
I then added the following text to the file between <VirtualHost *:80></VirtualHost> tags
<Directory "/var/www/html">
AuthType Basic
AuthName "asd"
AuthUserFile /var/www/.htpasswd
Require valid-user
</Directory>
I then restarted the apache2 service service apache2 restart
Test logging in with your browser and if everything works, submit the task for evaluation.
Tools
- htpasswd
- nano
- cd
- service
Flag
No flag available, just set up basic authentication method.