[ Linux Commands ]

Take screenshot of the desktop:
import -window root filename

Release ip and get a new one from DHCP:
dhclient -r

Shows which directory you're currently in

Shows who is logged in

Create an empty file or update the access and modification times of a file

hostname -i:
Display the network address of the host name

ps -ef:
Display all currently running processes on the system

Fix Ubuntus Broken Sound Server:
sudo killall -9 pulseaudio; pulseaudio >/dev/null 2>&1 &

Fix Ubuntus Broken Sound Server:
sudo killall -9 pulseaudio; pulseaudio >/dev/null 2>&1 &

Download an entire website:
wget -r -p -U Mozilla websitename.com

Check Ram Speed and Type in Linux:
sudo dmidecode --type 17 | more

Tail a log over ssh:
ssh -t remotebox "tail -f /var/log.remote.log"

View ~/.ssh/know_hosts key information:
ssh-keygen -l -f ~/.ssh/known_hosts

Run a command when a file is changed:
while inotifywait -e modify /tmp/myfile; do firefox; done

Analyze traffic remotely over ssh w/wireshark:
ssh root@host tcpdump -U -s0 -w - 'not port 22' | wireshark -k -i -

Get Your External IP Address:
curl -q0- icanhazip.com

List Network Tools:
apropos network |more

Repeat a command every one second:
watch -n 1 "do foo"

List files in directory

cd ..
Go back a directory

ls -a
Show Hidden Files

Get all IPs via ifconfig:
ifconfig -a | perl -nle'/{\d+\.\d+\.\d+}/ && print $1'

run shell or command on another UNIX system

Execute a command at any given time:

echo "ls -l" | at afternoon

Download an entire website:

wget --random-wait -r -p -e robots=off -U mozilla http://www.example.com

Create a script of the last command executed:

echo "!!" > foo.sh

Save a command to output image:
ifconfig | convert label:@- ip.png

Eaves drop on your system:
diff <(lsof -p 1234) <(sleep 10; lsof -p 1234)

Add timestamp to history:

Find files that have been modified in last 60 minutes:
sudo find / -mmin 60 -type f

Intercept, manipulate and monitor tcp connections:
mkfifo /tmp/fifo; cat /tmp/fifo | nc -l -p 1234 | tee -a to.log | nc machine port | tee -a from.log > /tmp/fifo

Take a screen shot via ssh:
DISPLAY=:0.0 import -window root /tmp/shot.png
Find geo location of an ip address:
lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\'

Find broken sym links and delete them:
find -L /path/to/check -type l -delete

[ Nmap Commands ]

Detect OS and traceroute:

nmap -A

Print Host interfaces and Routes:

nmap --iflist

Scan a TCP port:

nmap -p T:8888,80 sitename.com

Scan remote hosts using TCP ACK (PA) and TCPSyn (PS):

nmap -PS

csrf nmap scripts:

nmap -p80 --script http-csrf.nse


The pages that contain the forms to check. For example, {/upload.php, /login.php}. Default: nil (crawler mode on)


If this is set the script will also calculate the entropy of the field's value to determine if it is a token, rather than just checking its name. Default: true


nmap --script=mysql-brute target

nmap --script ftp-brute -p 21

sql nmap script:

nmap -sV --script=http-sql-injection

xss scripts:

nmap -p80 --script http-stored-xss.nse
nmap -p80 --script http-dombased-xss.nse


nmap -sU --script dns-fuzz --script-args timelimit=2h target