mirror of https://github.com/cheat/cheat.git
Merge pull request #154 from ImmortalPC/master
[IPTABLES,FIND,NMAP] Add some cheats for IPTables, Nmap and Find
This commit is contained in:
commit
406cf0dcf3
|
@ -39,3 +39,6 @@ find . -maxdepth 2 -name build -type d
|
||||||
|
|
||||||
# To search all files who are not in .git directory
|
# To search all files who are not in .git directory
|
||||||
find . ! -iwholename '*.git*' -type f
|
find . ! -iwholename '*.git*' -type f
|
||||||
|
|
||||||
|
# Find all files that have the same node (hard link) as MY_FILE_HERE
|
||||||
|
find / -type f -samefile MY_FILE_HERE 2>/dev/null
|
||||||
|
|
|
@ -16,3 +16,25 @@ iptables -A INPUT -i eth0 -p tcp --dport 902 -j REJECT --reject-with icmp-port-u
|
||||||
# icmp-host-prohibited or
|
# icmp-host-prohibited or
|
||||||
# icmp-admin-prohibited
|
# icmp-admin-prohibited
|
||||||
# tcp-reset
|
# tcp-reset
|
||||||
|
|
||||||
|
# Add a comment to a rule:
|
||||||
|
iptables ... -m comment --comment "This rule is here for this reason"
|
||||||
|
|
||||||
|
|
||||||
|
# To remove or insert a rule:
|
||||||
|
# 1) Show all rules
|
||||||
|
iptables -L INPUT --line-numbers
|
||||||
|
# OR iptables -nL --line-numbers
|
||||||
|
|
||||||
|
# Chain INPUT (policy ACCEPT)
|
||||||
|
# num target prot opt source destination
|
||||||
|
# 1 ACCEPT udp -- anywhere anywhere udp dpt:domain
|
||||||
|
# 2 ACCEPT tcp -- anywhere anywhere tcp dpt:domain
|
||||||
|
# 3 ACCEPT udp -- anywhere anywhere udp dpt:bootps
|
||||||
|
# 4 ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
|
||||||
|
|
||||||
|
# 2.a) REMOVE (-D) a rule. (here an INPUT rule)
|
||||||
|
iptables -D INPUT 2
|
||||||
|
|
||||||
|
# 2.b) OR INSERT a rule.
|
||||||
|
iptables -I INPUT {LINE_NUMBER} -i eth1 -p tcp --dport 21 -s 123.123.123.123 -j ACCEPT -m comment --comment "This rule is here for this reason"
|
||||||
|
|
|
@ -34,3 +34,21 @@ nmap -traceroute [target]
|
||||||
|
|
||||||
# Example: Ping scan all machines on a class C network
|
# Example: Ping scan all machines on a class C network
|
||||||
nmap -sP 192.168.0.0/24
|
nmap -sP 192.168.0.0/24
|
||||||
|
|
||||||
|
# Use some script:
|
||||||
|
nmap --script default,safe
|
||||||
|
|
||||||
|
# Loads the script in the default category, the banner script, and all .nse files in the directory /home/user/customscripts.
|
||||||
|
nmap --script default,banner,/home/user/customscripts
|
||||||
|
|
||||||
|
# Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy.
|
||||||
|
nmap --script 'http-*'
|
||||||
|
|
||||||
|
# Loads every script except for those in the intrusive category.
|
||||||
|
nmap --script "not intrusive"
|
||||||
|
|
||||||
|
# Loads those scripts that are in both the default and safe categories.
|
||||||
|
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-*"
|
||||||
|
|
Loading…
Reference in New Issue