diff --git a/cheatsheets/grep b/cheatsheets/grep index fced336..cb004e9 100644 --- a/cheatsheets/grep +++ b/cheatsheets/grep @@ -24,3 +24,6 @@ grep -rnw 'directory' -e "pattern" # Exclude grep from your grepped output of ps. # Add [] to the first letter. Ex: sshd -> [s]shd ps aux | grep '[h]ttpd' + +# Colour in red {bash} and keep all other lines +ps aux | grep -E --color 'bash|$' diff --git a/cheatsheets/nmap b/cheatsheets/nmap index 81c54a8..f46a01c 100644 --- a/cheatsheets/nmap +++ b/cheatsheets/nmap @@ -23,13 +23,15 @@ nmap -source-port [port] [target] nmap -A [target] # Speedup your scan: -nmap -T5 --min-parallelism=50 [target] +# -n => disable ReverseDNS +# --min-rate=X => min 300 packets / sec +nmap -T5 --min-parallelism=50 -n --min-rate=300 [target] # Traceroute: nmap -traceroute [target] # Ping scan only: -sP -# Don't ping: -PN +# Don't ping: -PN <- Use full if a host don't reply to a ping. # TCP SYN ping: -PS # TCP ACK ping: -PA # UDP ping: -PU @@ -38,6 +40,9 @@ nmap -traceroute [target] # Example: Ping scan all machines on a class C network nmap -sP 192.168.0.0/24 +# Force TCP scan: -sT +# Force UDP scan: -sU + # Use some script: nmap --script default,safe @@ -55,3 +60,10 @@ nmap --script "default and safe" # Loads scripts in the default, safe, or intrusive categories, except for those whose names start with http-. nmap --script "(default or safe or intrusive) and not http-*" + +# Scan for the heartbleed +# -pT:443 => Scan only port 443 with TCP (T:) +nmap -T5 --min-parallelism=50 -n --script "ssl-heartbleed" -pT:443 127.0.0.1 + +# Show all informations (debug mode) +nmap -d ... diff --git a/cheatsheets/rm b/cheatsheets/rm index d119df2..2a8fc02 100644 --- a/cheatsheets/rm +++ b/cheatsheets/rm @@ -1,5 +1,8 @@ # Remove files and subdirs rm -rf path/to/the/target/ -# Ignore non existent files +# Ignore non existent files rm -f path/to/the/target + +# Remove a file with his inode +find /tmp/ -inum 6666 -exec rm -i '{}' \; diff --git a/cheatsheets/wget b/cheatsheets/wget index fb9a45a..0439650 100644 --- a/cheatsheets/wget +++ b/cheatsheets/wget @@ -30,3 +30,6 @@ wget -r -l1 -A.extension http://myserver.com/directory # Allows you to download just the headers of responses (-S --spider) and display them on Stdout (-O -). wget -S --spider -O - http://google.com + +# Change the User-Agent to 'User-Agent: toto' +wget -U 'toto' http://google.com