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

Tips & Tricks

Some one-liners that make your life easier!
    ac -p on a BSD-System: connect time accounting
    cat alert | gzip -1 - | ssh user@target cat ">" alert.odin.gz zips a file via the network
    chsh change the loginshell of a user
    dd if=modifyme of=modifyme.tmp ibs=4 skip=1 >/dev/null 2>&1 creates a copy of a file without the first 4 bytes
    echo -e "\e[31;5m" changes the color to red and blinks. Escape sequences can be found under: http://consult.stanford.edu/pub/mail/color
    fdisk -l Shows the partitions
    iostat gives performance data on a solaris machine about the drives.
    lsattr Show the ext2-attributes of files
    lsdev Prints information about the devices!
    lspci -v PCI information
    lynx -head -nolist -dump http://localhost dumps a Web page into a file.
    lynx http://www.raffy.ch/castle.html -dump > raffy-contents.txt
    mount -t iso9660 -o loop my.iso /tmp/isomount mounts an ISO to have a look at it!
    netstat -s shows you statistics on your network interfaces
    netstat -lnp shows open ports and processes attachd to it.
    notify %2 Notifies you when job 2 has completed.
    passwd -l user Locks a user.
    perl -pie 's/this/that/g' filename
    pidof shows pid of a process
    pgrep httpd shows all the PIDs of httpd
    procinfo -f Show information about memory, irqs and processes.
    ps -w shows ps with 132 columns
    pwck check for inconsistencies in /etc/password
    pwconv keeps /etc/shadow and /etc/passwd in synch
    sa system accounting
    skill Use user-name, process-name, ... to kill processes.
    skill -STOP pts/2 Freeze the user on PTS/2
    skill -CONT pts/2 Continue the user on PTS/2
    tr -d "\015"
    vipw edit the /etc/passwd, /etc/group, /etc/shadow file with the right locks
    vmstat gives you virtual memory statistics
    watch -d -n 60 df -k Shows, in fullscreen, every 60 seconds the output of df -k
    xxd converts normal text into HEX - and vice versa



CopyLeft (l) 2003 by Raffael Marty