Security Consulting
  Unix Administration     Firewall     Intrusion Detection     Network Security     Hacking     MORE     HOME    

Scripting

Some things you should do in scripts:
    Set the PATH manually in your script
    Set the IFS manuall: IFS=' '
    set -o noglob switch off filename expansion
    set -o noglob switch off filename expansion
    Use unset for every variable before you use it.
    Check every argument to see if it meets the required specifications: user=${1##*[ \\$/;()|\>\<& ]}
    Do not use eval in your scripts
    Before you create a file, add a trap on EXIT to delete it if the script aborts
    Do not use temporary files!

Arguments

    The 10th argument: ${10} NOT $10!!!
    Setting the arguments new: set foo bar
    Setting arguments with "-" set --foo
    Deleting all old arguments set --

Backquotes

    command1 ${comand2} executes command2 and uses the return value to start command1



CopyLeft (l) 2003 by Raffael Marty