Information Security

Block Disabling Context Menu, or Resizing My Windows

I do not like website to change how I use my browser. Some websites change my window size, and some disable my right click menu (context menu). 

In Firefox, we can do this to defeat the effort of disabling the context menu or resizing windows:

Option -> Content -> Advanced (Enable Javascript) 

I uncheck all checkboxes there, including "Move or resize existing windows", and "Disable or replace context menus".

Configure a User Account to Use Restricted Shell (rssh)

rssh is a restricted shell for use with OpenSSH, allowing only scp, sftp, rsync, rdist, and cvs. The rssh website provide downloads to its source code tarball, as well as source rpm package. The compilation is straightforward.     

Building Statically Linked "awk"

We use awk often to  manipulate text files: extract and then operate on data from parts of certain lines while discarding the rest, make changes in various text files wherever certain patterns appear, and so on.

Build Statically Linked GNU "less"

Gnu "less" is a filter for paging through text one screenful at a time. It's similar to "more", but allow both backward and forward movement. It starts up faster than programs like vi, because it doesn't have to load the entire input file before starting.

Build Statically Linked procps

The GNU procps package provides utilities such as free, kill, pgrep, snice, sysctl, top, uptime, vmstat, w, and watch, etc.

Building a Security Audit Toolkit

I am building my own security audit toolkit, which includes the chkrootkit, tcpdump, and a few other things. And I am building my toolkit on both CentOS-4 and CentOS-5. Due to version and platform differences, some of the packages were downloaded or compiled slightly differently. 

Password Crackers

http://sectools.org/crackers.html list a top 10 password cracker tools voted by a nmap hacker community. Nice list.

 

Cain and Abel : The top password recovery tool for Windows

OpenSSL Cheat Sheet

Create Certificate Request/Unsigned Key 

openssl req -nodes -new -keyout blah.key.pem -out blah.req.pem

  • blah.key.pem will act as a SSLCertificateKeyFile for Apache

Fingerprint for Unsigned Certificate 

openssl x509 -subject -dates -fingerprint -in blah.key.pem

Generate Key 

openssl genrsa -out blah.key.pem

SELinux and Apache

When the server has SELinux enabled, I can't even change the location of DocumentRoot. It kept giving me error about "DocumentRoot /var/www/newdir/html does not exist".

This is because the SELinux policy will deny httpd access to any unlabelled files by default.

Instead of disabling SELinux, we could try toggle the SELinux rule settings.

To see all SELinux values, do:
root# getsebool -a

To see all the apache related SELinux boolean values, do:
root# getsebool -a | grep httpd

Enable SSL on Apache-2.2

This is recorded on CentOS-5, Apache-2.2.3. Also, reference my notes on enabling ssl on apache 2.0.63.

Install httpd and mod_ssl:
root# yum install httpd mod_ssl
root# mkdir /etc/httpd/ssl
root# cd /etc/httpd/ssl
root# vi openssl.cnf

Here you can enter your content of openssl.cnf, and then generate a private key:
root# openssl genrsa -des3 -out server.key 1024