tcpdump Grab Bag:
want to output dot decimal: tcpdump-n * * *
Want to output MAC address: TCPDUMP-E * * *
Catch target a package: tcpdump DST A//requires root permission, or sudo.
The contents of the network package, including the source IP address, port and destination IP, port, we can be based on the target IP and port filtering tcpdump capture results, the following command illustrates this usage:
Tcpdump-i eth0 DST 10.70.121.92 and Port 22
7. Specify the type of grab package
We can only catch some kind of protocol package, TCPDUMP support specifies the following protocol: Ip,ip6,arp,tcp,udp,wlan. The following example captures only the packets of the ARP protocol:
tcpdump- i eth0 ARP
8. Specify the bag-holding port
If you want to grab a packet for a particular port, you can use the following command:
Tcpdump-i eth0 Port 22
Route add Routes:
Routes added to a network segment: Route add-net desip Rouip Dev eth0
Routes added to an IP: route add-host desip Rouip Dev eth0
DNS query:
Nslookup www.baidu.com
You will see the IP address of Baidu and the address that is returned from that DNS server.
You can use Nslookup www.baidu.com | awk '/[0-9]. [0-9]. [0-9]. [0-9]/{print $} ' | awk-f# ' {print} ' extracts the IP address. First intercept the IP address, and then remove the port number.
Host Www.baidu.com
Will see Baidu's IP address, but do not know from that DNS server returned.
You can use host Www.baidu.com | awk '/[0-9]. [0-9]. [0-9]. [0-9]/{print $} ' extracts the IP address.
Version development to determine whether it is the same file:
md5sum * > FileName/Multiple current directory of all files for MD5 checksum, and officers transferred Guevara test results written in the filename.
MD5SUM-C filename//can determine if any files have been modified under the current directory.
If the file is modified, then md5sum-c filename will be seen to be unsuccessful if no modification will be seen to be successful.