CSN09101 Networked Services
Week 10: Using Apache Week 10: Using Apache
Module Leader: Dr Gordon Russell Lecturers: G. Russell
CSN09101 Networked Services Week 10: Using Apache Week 10: Using - - PowerPoint PPT Presentation
CSN09101 Networked Services Week 10: Using Apache Week 10: Using Apache Module Leader: Dr Gordon Russell Lecturers: G. Russell This lecture Apache Basic Authentication Log Analysis Security Issues Discussions
Module Leader: Dr Gordon Russell Lecturers: G. Russell
the directory to protect.
be protected must have AllowOveride AuthConfig
AuthType Basic AuthName "Restricted Files" AuthUserFile /home/gordon/password Require user andrew
– This is another option, which requests the passwords in an encrypted format. It is not as widely supported as Basic.
– As more users are added the file gets bigger. – On every page request the file has to be parsed again.
dbm). These are faster to access but more complex to manage.
Require user andrew
Require valid-user
idea for apache.
Groupname: user1 user2 user3 … Groupname: user1 user2 user3 …
group staff… staff: gordon andrew
– Yet some big sites use it!
– Order – read deny then allow or vice versa – Order – read deny then allow or vice versa – Allow from – allow this match to access – Deny from – stop this match
allow from all deny from 10.0.0.1
allow from all deny from 10.0.0.1
deny from 10.0.0.1 allow from all
deny bob.com jim.com deny bob.com jim.com allow all
deny 10.0.1.0/24 deny 10.0.1.0/24 deny 10.0.0.2 allow all
– Error Logs – Access Logs
– Fun for people who have hobby sites – Life or death if your business relies on the web site.
<VirtualHost> … ErrorLog logs/gr-error_log CustomLog logs/gr-access_log combined </VirtualHost>
request.
%h %l %u %t %r %>s %b Referrer UserAgent
each web page.
– Good if you don’t have access!
– You only get logs where there is javascript switched on. – Each page is slowed by having extra stuff on it. – It’s a little more complex.
– Convenience – Reliability – Reliability – Availability – Performance – Cost – Privacy – Complexity
– CGI is a program which runs when you view a page. – CGI is a program which runs when you view a page. – Its output is sent back to the user’s browser. – As it is an active process it can do permanent things to your server.
#!/bin/sh echo 'Content-Type: text/html; charset=ISO-8859-1' echo echo '<body><pre>' echo '<body><pre>' whoami env echo '</pre></body>'
apache SERVER_SIGNATURE=Apache/2.0.51 (Fedora) Server at servername Port 80 UNIQUE_ID=umn4CZKwogYAADNFYkcAAAAI HTTP_KEEP_ALIVE=300 HTTP_USER_AGENT=Mozilla/5.0 (Windows; U; Windows NT 5.1; en- GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 SERVER_PORT=80 SERVER_PORT=80 HTTP_HOST=servername DOCUMENT_ROOT=/home/gordon/public_html
etc.
– Transferring hacking programs to the server – Copying files from the server (e.g. /etc/passwd).
– The user “apache” is commonly used here. – In the httpd.conf, make sure there is: user apache user apache group apache
– Might be useful if a hacker is searching for a buggy apache version. – In httpd.conf ServerSignature Off ServerTokens Prod
<Directory /> Order Deny,Allow Deny from all </Directory> </Directory>
$ chown -R root:apache /etc/httpd $ chmod -R u=rwx,g=r,o-rwx /etc/httpd
$ iptables -A OUTPUT -m owner
characters a-z, “.”, and “/”. If they don’t then display the contents of “/noway.html”.
answer: