↤ go back, or return home

LabNet goodies


Permitting access to files in the .www dir

for the apache user to access your files, ensure your .www directory has open permissions within it, set usually by:

mkdir -p ~/.www
echo "Hello, World!" > ~/.www/index.html
chmod 755 ~/.www
chmod 655 ~/.www/index.html
curl "https://www.cs.mun.ca/~$USER/index.html" # produces "Hello, World!"

PHP

Apache will execute arbitrary .php files in your home directory, it also seems to have quite a permissive set of extensions open, such as arbitrary commands as the apache user simply using backticks .-.

<?php
phpinfo();
?>

Limiting access to specific LabNet users

example .htaccess file, which forces https, and uses muns internal ldap server for authentication, the require line being used to limit what users can access the resource

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]

&lt;If &quot;%{HTTPS} == 'on'&quot;&gt;
	AuthType Basic
	AuthBasicProvider ldap
	AuthName &quot;Protected Endpoint&quot;
	AuthLDAPURL ldaps://ldap.cs.mun.ca/ou=People,ou=CSMath,dc=mun,dc=ca STARTTLS
	require user jaharrhy johndoe janedoe # ...
&lt;/If&gt;

throw it in a directory and boom, mun auth!

NOTE: since the files are likely set to be visible to all users within labnet, the files can still be accessed quite easily by others navigating muns internal directory, but ofc. using this method means you should avoid public web scraping