Linux/unix security auditing scripts "Lusas"


This is a collection of command line security auditing scripts for Linux/Unix. 
Originally by Sean Boran in 2000, with a few improvements over the years.

Auditing the security of an existing Solaris system can be time-consuming, and often requires on-site visits. There are several commercial tools and a few free ones that help, but they can be complicated and require local compilation or configuration.

So a tool was developed with the following aims:

This script automates the gathering of the information only. Of course, the difficult part is the interpretation of results and deciding what countermeasures to take


These tools are OpenSource. The GPL v2 applies.  Please share any fixes/improvements you make, if possible. Or help with documentation.

What does it do?

The tool consists of two main scripts, both of which look at the system, but do not make any modifications.

  1. Call two main audit scripts: and and collate results.
  2. is an example for running on many remote machines via SSH.
  3. (Bourne shell): This script is designed to run quickly and gather as much security information as possible about the system. 
    No file searches are conducted, to keep it fast.
    Tested on: Solaris 2.6/7/8/9, OpenBSD 2.6, RH 7, Suse 7.1/8.1, HP-UX11. Solaris is best supported.
  4. (perl): This second script searches the entire file system, listing SUID, SGID, world-writable, group-writable files. It also lists trust files and their contents. Finally it lists files with weird names (e.g., containing punctuation characters), which might be danger or a sign of penetration. On a large server with 100GB disks, this can take a few hours to run.
    Initially tested on SunOS 5.5/6/7/8/9, OpenBSD 2.6, RH 7, Suse 7.1/8.1/9, HP-UX11.Focus has been on Ubuntu and HP these last few years.

  5. is a minimal Bourne shell script, that replaces and old systems than don't have Perl. Normally you don't need to run this.
  6. Create a list of active tcp/udp connections and listenings in a common format and summarize them in a logfile avoiding very big samplefiles. Udp Sessions cannot be sampled on every architecture.
  7. Summarise results from on several machines
  8. Create a list of active tcp/udp connections by listening with tcpdump. Collect in a common format and summarize them in a logfile avoiding very big sample files.
  9. Create a list of active tcp/udp/icmp connections by listening with tcpdump. Collect in a common format to allow easy viewing in excel Ony record one row for each "connection" (optimise space). WARNING: This script is an optimised version of "", however it seg faults after one hour on one of my test machines, so it can't be considered production ready (SunOS 5.8 Generic_117350-25 sun4u, perl 5.005_03)
  10. Summarise results from on several machines. We ignore multiple ICMP & tcp sessions with same from/to IP. UDP: ignore multiple packets to ports 514|53|123 with same from/to IP.
  11. ssh-key-crack: There is a sub directory included ssh-key-crack containing two different tools for analysing the strength of pass phrases used to protect SSH private keys. ssh-privkey-crack.c is more complete than ssh-privkey-crack.c. These tools are include in the auditing bundle since they don't have a site of their own.



Running the Tool

These scripts are meant for system administrators. Read the headers in each script and checkout the configuration settings at the top of the script, for example:

# Don't examine these filesystems
$exclude ='/backup|/dir2';     # Don't examine these filesystems

# do not search these directories

$group_rw = '';                 # '1'=Report group-writeable files (often a huge list we don't care about)

$debug ='';                     # '1'=debug (useful), ''=no debug (quiet)
$debug2='0';                    # '1'=print results to terminal also
                                # (default is to write to file only)
$email_results='0';             # '0'=write to file, don't email
$user='root';                   # send email to him/her

$aggressive = '0';              # '1'=Immediately DELETE baddies
                                # DO NOT DO THIS unless you
                                # have reviewed these sources and tested on a
                                # non-production machine first..

For the other auditing scripts, please read the script headers, they were developed for specific projects and many need tuning for your environment.

 To do