Posted on Wednesday, 21st March 2012 by Michael

Quick Tips for Linux Security at the CCDC

This guide is to be high level and provide a reference for the CCDC Blue Cell to use to help secure their Linux boxes during the CCDC events. This being said this document does not guarantee your victory.

My understanding is during the contest tools can be downloaded if the tools are free for commercial use. With that being said I will base some of my suggestions on that. Remember time is important. We are already on your box. Also my thoughts may be different than other red cell members.

Before the event

  1. Study this: http://www.sans.org/score/checklists/ID_Linux.pdf
  2. Learn Linux basic administration and file editing.

Remote and Local Administration Security

  1. Logon to the console: service sshd stop
  2.  Change root password
  3. Disable root login in the sshd.conf
  4. Remove any keys that exist in .ssh
  5. Create new keys
  6. Disable password login and use keys in the sshd.conf
  7. Install apf firewall : http://www.rfxn.com/projects/advanced-policy-firewall/ or learn Iptables
  8. Edit the configuration lines for ingress and egress ports, don’t forget protocols as well so ping works.
  9. Install BFD: http://www.rfxn.com/projects/brute-force-detection/
  10. Edit the configuration files and start apf and bfd
  11. Start sshd backup
  12. Verify before disconnecting your keys work.
  13. Change keys often.
  14. Know what users belong on the system and which had been added.
  15. Last command to see who logged on to your box last and from where also w to see who is on now and from where. Unknown IP’s are an incident.
  16. Look for hidden directories mkdir “…” <= Bad
  17. Set none root users to a jailed shell so they can’t run anything.

Database Security:

  1. Change or add a password for mysql or postgres . Warning may damage some of the web apps depending how they were installed.

Web Security:

  1. Use ModSecurity for your web apps
  2. Use .htaccess files to restrict the admin sections of your web app to local IP addresses.
  3. Change default passwords
  4. Lock down access to phpmyadmin, no need for outside access to it.
  5. Lock down webdav, no need for that.
  6. Cat /var/log/http/access.log and error_log to look for web hacking attempts and who tried them.

Posted in CCDC | Comments (0)

Leave a Reply

*