<a href="https://wiki.skullsecurity.org/index.php?title=Linux_Commands">https://wiki.skullsecurity.org/index.php?title=Linux_Commands</a>
Types of record: NS, A, HINFO, MX, TXT, CNAME, SOA, RP, PTR, SRV
Zone transfer
Iterative zone transfer
Dump the ARP table of an snmp server at HOST
Parameters
-n -- use numbers
-i <interface>
-v -- be verbose
-r <file>/-w <file> -- read from/write to file
-x -- print hex
-A -- print ASCII
-X -- print hex and ASCII
-s <snaplen> -- length to capture (-s0 for all data)
Filter string
Protocol
ether, ip, ip6, arp, rarp, tcp, udp
Type
host <host>
net <network>
port <portnum>
portrange <start-end>
Direction
src
dst
Logic
and
or
Show TCP against target 10.10.10.10 in ASCII
Show all UDP from 10.10.10.10
Show all TCP port 80 packets going to or from host 10.10.10.10
TCP Flags
--syn, --fin, --rst, --push, --ack, --urg
Target selection
--rand-dest
--interface <int>
Source selection
--spoof <hostname>
--rand-source
Port selection
--destport <port>
--destport +<port> -- increment by one for each packet received
--destport ++<port> -- increment by one for each packet sent
--scan <portrange>
--baseport <port>
--keep -- don't increment the source port
Speed options
--fast, --faster, --flood
--interval <N> -- interval in seconds
--interval u<N> -- interval in microseconds
Other options
--count <N>
--beep
--file <filename>
--data <N>
-f <N> -- Initial TTL
-g <hostlist> -- Loose source route
-I -- use ICMP Echo instead of UDP
-m <N> -- maximum number of hops (default 30)
-n -- numeric
-p <baseport> -- set the base UDP port
-w <N> -- wait N seconds (default 5)
<a href="http://pwhois.org/lft/index.who">http://pwhois.org/lft/index.who</a>
Options
-u -- use UDP
-p -- use ICMP echo
-d <port> -- destination port (default 80)
-s <port> -- source port
-L <N> -- length (including layer 3/4 header)
-A -- look up AS number
-P -- traceroute via tcp
Pinging
-PN -- don't ping
-PB -- default, ICMP Echo + TCP to port 80
-PE -- ICMP Echo request
-PS[portlist] -- TCP SYN
-PP -- ICMP Timestamp request
-PM -- ICMP Address Mask request
-PR -- default on subnet, use ARP to identify hosts
Scanning
-sT -- TCP Connect scan
-sS -- SYN scan
-sA -- ACK scan
-sF -- FIN scan
-sN -- Null scan
-sX -- Xmas Tree scan
-sM -- Maimon scan
--scanflags specify your own flags
-sU -- UDP scan
Fingerprinting
-O -- OS fingerprint
-sV -- Version scan
Scripts
-sC -- run all scripts
--script=<category,dir,src,etc&/gt;
--script-trace
Timing
--paranoid, --sneaky, --polite, --normal, --aggressive, --insane
--host_timeout, --max_rtt_timeout, --min-rtt-timeout, --initial_rtt_timeout, --max-parallelism, --scan_delay
-p<ports>
-F -- fast (checks only ports in nmap-services)
--packet-trace
--traceroute
--badsum
-q -- quiet (omit closed ports)
-v -- verbose
-b -- print banners
Example:
Commands
Remotely:
-l -- listen mode
-L -- listen harder (Windows only)
-u -- UDP mode
-p -- local port (in listen mode, the port to listen on)
-e -- program to execute
-n -- don't resolve names
-z -- don't send any data
-w<N> -- timeout for connects
-v/-vv -- be verbose
Setting up a relay
Relaying port 22 to the local system
Running an exploit
Interacting with sessions
Creating a malicious VBScript
Creating a malicious Exe
Example autorun.inf file to run a malicious exe (goes with Metasploit)
Metasploit listener
Filesystem commands
Modules
Adding an ordinary user
Adding a root user (note: a non-uid-0 account may be required to log in)
Checking for inetd/xinetd
Adding telnet to /etc/inetd
Adding telnet to xinetd
Steal the file from a service that's running (files are in /etc/xinetd.d)
Change server to "/usr/sbin/in.telnetd"
Restarting inetd/xinetd (the "kill" command with the PID can also be used)
File should be in /etc/rc*. Ways to enable:
Creating a dictionary
Scraping a Web site
-i -- input file
-o -- output file
-m <N> -- minimum length
-M <N> -- maximum length
-c <N> -- the number of criteria
-l -- lower case
-u -- upper case
-n -- numbers
-p -- printable characters (lower/upper/num)
-s -- special characters (all others)
Example
-l <username>/-L <userfile> -- Login name/file
-p <password>/-P <passfile> -- Password/file
-e <n|s|ns> -- extended checks (n = null, s = same as username)
-t <N> -- thread count
smb password
ssh password
Show cracked passwords
Speed test
Running against a password file
Specifying type type
Combining passwd/shadow
Loading the hash
Mounting a drive
Adding a user
Updating
Single check
On the attacker machine
On the victim machine
本文轉自 simeon2005 51CTO部落格,原文連結:http://blog.51cto.com/simeon/2068854