diff --git a/sources/29 Practical Examples of Nmap Commands for Linux System/Network Administrators.md b/sources/29 Practical Examples of Nmap Commands for Linux System/Network Administrators.md new file mode 100644 index 0000000000..a15b90e27f --- /dev/null +++ b/sources/29 Practical Examples of Nmap Commands for Linux System/Network Administrators.md @@ -0,0 +1,645 @@ +29 Practical Examples of Nmap Commands for Linux System/Network Administrators +================================================================================ +The **Nmap** aka **Network Mapper** is an open source and a very versatile tool for Linux system/network administrators. **Nmap** is used for **exploring networks, perform security scans, network audit** and **finding open ports** on remote machine. It scans for Live hosts, Operating systems, packet filters and open ports running on remote hosts. + +![Nmap Commands](http://www.tecmint.com/wp-content/uploads/2013/12/Nmap-Commands.png) +*Nmap Commands and Examples* + +I’ll be covering most of **NMAP** usage in two different parts and this is the first part of nmap serious. Here in this setup, I have used two servers without firewall to test the working of the Nmap command. + +- 192.168.0.100 – server1.tecmint.com +- 192.168.0.101 – server2.tecmint.com + +### Nmap command usage ### + + # nmap [Scan Type(s)] [Options] {target specification} + +### How to Install NMAP in Linux ### + +Most of the today’s Linux distributions like **Red Hat, CentOS, Fedoro, Debian** and **Ubuntu** have included **Nmap** in their default package management repositories called [Yum][1] and [APT][2]. The both tools are used to install and manage software packages and updates. To install **Nmap** on distribution specific use the following command. + + # yum install nmap [on Red Hat based systems] + $ sudo apt-get install nmap [on Debian based systems] + +Once you’ve install latest nmap application, you can follow the example instructions provided in this article. + +### 1. Scan a System with Hostname and IP Address ### + +The **Nmap** tool offers various methods to scan a system. In this example, I am performing a scan using hostname as **server2.tecmint.com** to find out all open ports, services and MAC address on the system. + +#### Scan using Hostname #### + + [root@server1 ~]# nmap server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 15:42 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.415 seconds + You have new mail in /var/spool/mail/root + +#### Scan using IP Address #### + + [root@server1 ~]# nmap 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-18 11:04 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 958/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.465 seconds + You have new mail in /var/spool/mail/root + +### 2. Scan using “-v” option ### + +You can see that the below command with “**-v**” option is giving more detailed information about the remote machine. + + [root@server1 ~]# nmap -v server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 15:43 EST + Initiating ARP Ping Scan against 192.168.0.101 [1 port] at 15:43 + The ARP Ping Scan took 0.01s to scan 1 total hosts. + Initiating SYN Stealth Scan against server2.tecmint.com (192.168.0.101) [1680 ports] at 15:43 + Discovered open port 22/tcp on 192.168.0.101 + Discovered open port 80/tcp on 192.168.0.101 + Discovered open port 8888/tcp on 192.168.0.101 + Discovered open port 111/tcp on 192.168.0.101 + Discovered open port 3306/tcp on 192.168.0.101 + Discovered open port 957/tcp on 192.168.0.101 + The SYN Stealth Scan took 0.30s to scan 1680 total ports. + Host server2.tecmint.com (192.168.0.101) appears to be up ... good. + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.485 seconds + Raw packets sent: 1681 (73.962KB) | Rcvd: 1681 (77.322KB) + +#### Scan Multiple Hosts #### + +You can scan multiple hosts by simply writing their IP addresses or hostnames with Nmap. + + [root@server1 ~]# nmap 192.168.0.101 192.168.0.102 192.168.0.103 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:06 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + Nmap finished: 3 IP addresses (1 host up) scanned in 0.580 seconds + +### 4. Scan a whole Subnet ### + +You can scan a whole subnet or IP range with Nmap by providing *** wildcard** with it. + + [root@server1 ~]# nmap 192.168.0.* + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:11 EST + Interesting ports on server1.tecmint.com (192.168.0.100): + Not shown: 1677 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 111/tcp open rpcbind + 851/tcp open unknown + + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 256 IP addresses (2 hosts up) scanned in 5.550 seconds + You have new mail in /var/spool/mail/root + +On above output you can see that nmap scanned a whole subnet and gave the information about those hosts which are **Up** in the **Network**. + +### 5. Scan Multiple Servers using last octet of IP address ### + +You can perform scans on multiple IP address by simple specifying last octet of IP address. For example, here I performing a scan on IP addresses 192.168.0.101, 192.168.0.102 and 192.168.0.103. + + [root@server1 ~]# nmap 192.168.0.101,102,103 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:09 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 3 IP addresses (1 host up) scanned in 0.552 seconds + You have new mail in /var/spool/mail/root + +### 6. Scan list of Hosts from a File ### + +If you have more hosts to scan and all host details are written in a file , you can directly ask nmap to read that file and perform scans. Let’s see how to do that. + +Create a text file called “**nmaptest.txt**” and define all the IP addresses or hostname of the server that you want to do a scan. + + [root@server1 ~]# cat > nmaptest.txt + + localhost + server2.tecmint.com + 192.168.0.101 + +Next, run the following command with “**iL**” option with nmap command to scan all listed IP address in the file. + + [root@server1 ~]# nmap -iL nmaptest.txt + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-18 10:58 EST + Interesting ports on localhost.localdomain (127.0.0.1): + Not shown: 1675 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 25/tcp open smtp + 111/tcp open rpcbind + 631/tcp open ipp + 857/tcp open unknown + + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 958/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 958/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 3 IP addresses (3 hosts up) scanned in 2.047 seconds + +### 7. Scan an IP Address Range ### + +You can specify an IP range while performing scan with Nmap. + + [root@server1 ~]# nmap 192.168.0.101-110 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:09 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 10 IP addresses (1 host up) scanned in 0.542 seconds + +### 8. Scan Network Excluding Remote Hosts ### + +You can exclude some hosts while performing a full network scan or when you are scanning with wildcards with “**–exclude**” option. + + [root@server1 ~]# nmap 192.168.0.* --exclude 192.168.0.100 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:16 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 255 IP addresses (1 host up) scanned in 5.313 seconds + You have new mail in /var/spool/mail/root + +### 9. Scan OS information and Traceroute ### + +With Nmap, you can detect which OS and version is running on the remote host. To enable OS & version detection, script scanning and traceroute, we can use “**-A**” option with NMAP. + + [root@server1 ~]# nmap -A 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:25 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE VERSION + 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) + 80/tcp open http Apache httpd 2.2.3 ((CentOS)) + 111/tcp open rpcbind 2 (rpc #100000) + 957/tcp open status 1 (rpc #100024) + 3306/tcp open mysql MySQL (unauthorized) + 8888/tcp open http lighttpd 1.4.32 + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + No exact OS matches for host (If you know what OS is running on it, see http://www.insecure.org/cgi-bin/nmap-submit.cgi). + TCP/IP fingerprint: + SInfo(V=4.11%P=i686-redhat-linux-gnu%D=11/11%Tm=52814B66%O=22%C=1%M=080027) + TSeq(Class=TR%IPID=Z%TS=1000HZ) + T1(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW) + T2(Resp=N) + T3(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW) + T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=) + T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=) + T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=) + T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=) + PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) + + Uptime 0.169 days (since Mon Nov 11 12:22:15 2013) + + Nmap finished: 1 IP address (1 host up) scanned in 22.271 seconds + You have new mail in /var/spool/mail/root + +In above Output, you can see that nmap is came up with TCP/IP fingerprint of the OS running on remote hosts and being more specific about the port and services running on the remote hosts. + +### 10. Enable OS Detection with Nmap ### + +Use the option “-O” and “-osscan-guess” also helps to discover OS information. + + [root@server1 ~]# nmap -O server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:40 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + No exact OS matches for host (If you know what OS is running on it, see http://www.insecure.org/cgi-bin/nmap-submit.cgi). + TCP/IP fingerprint: + SInfo(V=4.11%P=i686-redhat-linux-gnu%D=11/11%Tm=52815CF4%O=22%C=1%M=080027) + TSeq(Class=TR%IPID=Z%TS=1000HZ) + T1(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW) + T2(Resp=N) + T3(Resp=Y%DF=Y%W=16A0%ACK=S++%Flags=AS%Ops=MNNTNW) + T4(Resp=Y%DF=Y%W=0%ACK=O%Flags=Option -O and -osscan-guess also helps to discover OSR%Ops=) + T5(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=) + T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=) + T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=) + PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E) + + Uptime 0.221 days (since Mon Nov 11 12:22:16 2013) + + Nmap finished: 1 IP address (1 host up) scanned in 11.064 seconds + You have new mail in /var/spool/mail/root + +### 11. Scan a Host to Detect Firewall ### + +The below command will perform a scan on a remote host to detect if any packet filters or Firewall is used by host. + + [root@server1 ~]# nmap -sA 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:27 EST + All 1680 scanned ports on server2.tecmint.com (192.168.0.101) are UNfiltered + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.382 seconds + You have new mail in /var/spool/mail/root + +### 12. Scan a Host to check its protected by Firewall ### + +To scan a host if it is protected by any packet filtering software or Firewalls. + + [root@server1 ~]# nmap -PN 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:30 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.399 seconds + +### 13. Find out Live hosts in a Network ### + +With the help of “**-sP**” option we can simply check which hosts are live and up in Network, with this option nmap skips port detection and other things. + + [root@server1 ~]# nmap -sP 192.168.0.* + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-18 11:01 EST + Host server1.tecmint.com (192.168.0.100) appears to be up. + Host server2.tecmint.com (192.168.0.101) appears to be up. + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + Nmap finished: 256 IP addresses (2 hosts up) scanned in 5.109 seconds + +### 14. Perform a Fast Scan ### + +You can perform a fast scan with “**-F**” option to scans for the ports listed in the nmap-services files and leaves all other ports. + + [root@server1 ~]# nmap -F 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:47 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1234 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.322 seconds + +### 15. Find Nmap version ### + +You can find out Nmap version you are running on your machine with “**-V**” option. + + [root@server1 ~]# nmap -V + + Nmap version 4.11 ( http://www.insecure.org/nmap/ ) + You have new mail in /var/spool/mail/root + +### 16. Scan Ports Consecutively ### + +Use the “**-r**” flag to don’t randomize. + + [root@server1 ~]# nmap -r 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 16:52 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.363 seconds + +17. Print Host interfaces and Routes + +You can find out host interface and route information with nmap by using “**–iflist**” option. + + [root@server1 ~]# nmap --iflist + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:07 EST + ************************INTERFACES************************ + DEV (SHORT) IP/MASK TYPE UP MAC + lo (lo) 127.0.0.1/8 loopback up + eth0 (eth0) 192.168.0.100/24 ethernet up 08:00:27:11:C7:89 + + **************************ROUTES************************** + DST/MASK DEV GATEWAY + 192.168.0.0/0 eth0 + 169.254.0.0/0 eth0 + +In above output, you can see that map is listing interfaces attached to your system and their respective routes. + +### 18. Scan for specific Port ### + +There are various options to discover ports on remote machine with Nmap. You can specify the port you want nmap to scan with “**-p**” option, by default nmap scans only **TCP** ports. + + [root@server1 ~]# nmap -p 80 server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:12 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 80/tcp open http + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) sca + +### 19. Scan a TCP Port ### + +You can also specify specific port types and numbers with nmap to scan. + + [root@server1 ~]# nmap -p T:8888,80 server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:15 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 80/tcp open http + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.157 seconds + +### 20. Scan a UDP Port ### + + [root@server1 ~]# nmap -sU 53 server2.tecmint.com + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:15 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 53/udp open http + 8888/udp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.157 seconds + +### 21. Scan Multiple Ports ### + +You can also scan multiple ports using option “**-p**“. + + [root@server1 ~]# nmap -p 80,443 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-18 10:56 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 80/tcp open http + 443/tcp closed https + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.190 seconds + +### 22. Scan Ports by Network Range ### + +You can scan ports with ranges using expressions. + + [root@server1 ~]# nmap -p 80-160 192.168.0.101 + +### 23. Find Host Services version Numbers ### + +We can find out service’s versions which are running on remote hosts with “**-sV**” option. + + [root@server1 ~]# nmap -sV 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:48 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE VERSION + 22/tcp open ssh OpenSSH 4.3 (protocol 2.0) + 80/tcp open http Apache httpd 2.2.3 ((CentOS)) + 111/tcp open rpcbind 2 (rpc #100000) + 957/tcp open status 1 (rpc #100024) + 3306/tcp open mysql MySQL (unauthorized) + 8888/tcp open http lighttpd 1.4.32 + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 12.624 seconds + +#### 24. Scan remote hosts using TCP ACK (PA) and TCP Syn (PS) #### + +Sometimes packet filtering firewalls blocks standard **ICMP** ping requests, in that case, we can use **TCP ACK** and **TCP Syn** methods to scan remote hosts. + + [root@server1 ~]# nmap -PS 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 17:51 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.360 seconds + You have new mail in /var/spool/mail/root + +### 25. Scan Remote host for specific ports with TCP ACK ### + + [root@server1 ~]# nmap -PA -p 22,80 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 18:02 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.166 seconds + You have new mail in /var/spool/mail/root + +### 26. Scan Remote host for specific ports with TCP Syn ### + + [root@server1 ~]# nmap -PS -p 22,80 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 18:08 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.165 seconds + You have new mail in /var/spool/mail/root + +### 27. Perform a stealthy Scan ### + + [root@server1 ~]# nmap -sS 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 18:10 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.383 seconds + You have new mail in /var/spool/mail/root + +### 28. Check most commonly used Ports with TCP Syn ### + + [root@server1 ~]# nmap -sT 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 18:12 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open ssh + 80/tcp open http + 111/tcp open rpcbind + 957/tcp open unknown + 3306/tcp open mysql + 8888/tcp open sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 0.406 seconds + You have new mail in /var/spool/mail/root + +### 29. Perform a tcp null scan to fool a firewall ### + + [root@server1 ~]# nmap -sN 192.168.0.101 + + Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-11-11 19:01 EST + Interesting ports on server2.tecmint.com (192.168.0.101): + Not shown: 1674 closed ports + PORT STATE SERVICE + 22/tcp open|filtered ssh + 80/tcp open|filtered http + 111/tcp open|filtered rpcbind + 957/tcp open|filtered unknown + 3306/tcp open|filtered mysql + 8888/tcp open|filtered sun-answerbook + MAC Address: 08:00:27:D9:8E:D7 (Cadmus Computer Systems) + + Nmap finished: 1 IP address (1 host up) scanned in 1.584 seconds + You have new mail in /var/spool/mail/root + +That’s it with **NMAP** for now, I’ll be coming up more creative options of **NMAP** in our second part of this serious. Till then, stay tuned with us and don’t forget to share your valuable comments. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/nmap-command-examples/ + +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/ +[2]:http://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/ \ No newline at end of file diff --git a/sources/Command Line Basics – watch.md b/sources/Command Line Basics – watch.md new file mode 100644 index 0000000000..d045794d00 --- /dev/null +++ b/sources/Command Line Basics – watch.md @@ -0,0 +1,65 @@ +Command Line Basics – watch +================================================================================ +There are several log files in a Linux system. Keeping an eye on these log files can be one of the important tasks of a Linux System administrator. You can easily view the end of a log file [using the tail command][1]. But if you want to monitor that file all day long it's pretty tedious to enter the tail command every few minutes to check on that log file. You could write a short [script with an infinite loop][2] to check the file periodically, but it turns out that there is already a program to handle repetitive tasks for you. + +### The Linux watch Command ### + +The **watch** command in Linux provides a way to handle repetitive tasks. By default **watch** will repeat the command that follows it every two seconds. As you can imagine, watch is a great tool to keep an eye on log files. Here's an example. + + watch tail /var/log/syslog + +In order to stop the command execution, just use the standard kill sequence, **[Ctrl]+C**. + +![Using the Linux watch command to monitor the syslog](http://tuxtweaks.com/wp-content/uploads/2013/12/Watch_01_wm.png) +*Using the Linux watch command to monitor the syslog* + +You can change the time interval by issuing the **-n** switch and specifying the interval in seconds. To check the log file every 10 seconds, try this. + + watch -n 10 tail /var/log/syslog + +### The Linux watch Command with a Pipe ### + +The **watch** command isn't limited to viewing log files. It can be used to repeat any command you give it. If you have your system [set up to monitor the CPU temperature][3], you can use **watch** to view that with the **sensors** command. + + watch -n 1 sensors + +The output on my netbook looks like this: + + acpitz-virtual-0 + Adapter: Virtual device + temp1: +45.0°C (crit = +100.0°C) + +I'd like to filter this output to only show the temperature output without all of the rest. + +I can use this command to view it one time. + + sensors | grep temp | awk '{ print $2 }' + +Keep in mind that the watch command will repeat the first command that is sees. Care must be taken when pipelining one command to the next. This can be managed by placing your command pipeline inside quotes. + + watch -n1 "sensors | grep temp | awk '{ print $2 }'" + +![Using the Linux watch command with a pipe](http://tuxtweaks.com/wp-content/uploads/2013/12/Watch_02_wm.png) +*Using the Linux watch command with a pipe* + +### Use watch as a clock ### + +As you've probably noticed by now, the **watch** command shows the time that the command was executed in the upper right corner of the terminal window. We can use **watch** as a simple clock by passing an empty command line argument. We can just enclose a space in quotes to act as the empty command. + + watch -n 1 " " + +So you can see, this gives another meaning for the command name, **watch**. You can use it just like your wrist watch. + +So now you know how to use the Linux watch command. What repetitive tasks will you use it to handle? + +-------------------------------------------------------------------------------- + +via: http://tuxtweaks.com/2013/12/linux-watch-command/ + +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://tuxtweaks.com/2011/02/command-line-basics-head-and-tail/ +[2]:http://tuxtweaks.com/2012/01/creating-a-terminal-window-clock/ +[3]:http://tuxtweaks.com/2008/08/how-to-control-fan-speeds-in-ubuntu/ \ No newline at end of file diff --git a/sources/Linux Foundation Gains New Cloud, Open Hardware and Gaming Members.md b/sources/Linux Foundation Gains New Cloud, Open Hardware and Gaming Members.md new file mode 100644 index 0000000000..3bc719ae58 --- /dev/null +++ b/sources/Linux Foundation Gains New Cloud, Open Hardware and Gaming Members.md @@ -0,0 +1,33 @@ +Linux Foundation Gains New Cloud, Open Hardware and Gaming Members +================================================================================ +> Cloudius Systems, HSA Foundation and Valve have become the newest members of the Linux Foundation, bringing strengths in the open source cloud, open-standard hardware and gaming. + +Cloud computing, open-standard hardware and gaming: These are all areas in which the [Linux Foundation][1] has recently forged important new connections, announcing the addition of [Cloudius Systems][2], [HSA Foundation][3] and [Valve Software][4] as the newest members of the organization. Together, these collaborations highlight the continuing dynamism of the open source world, and provide hints into where it is headed next. + +The Linux Foundation, a non-profit consortium that promotes the interests of [Linux][6] and related open source projects, detailed the signing-on of these three companies in an [announcement][5] that highlighted the particular strengths they stand to contribute to the open source ecosystem. + +First, Cloudius Systems will help to advance the open source cloud. Its major product is [OSv][7], a sleek operating system that the company recently introduced and designed specifically for the cloud. Interestingly, OSv—which runs as a guest virtual machine on top of the open source [KVM][8] and [Xen][9] hypervisors—could be considered a competitor with Linux, which forms the basis for many other cloud-oriented virtualization platforms. But Cloudious's entry into the Linux Foundation is a sign that the future of the open cloud is about more than Linux itself, and that open source innovators recognize that the Linux kernel, which was built for desktops and servers, can only go so far in the cloud. + +Meanwhile, the non-profit HSA Foundation aims to advance open hardware standards—a key interest for open source developers whether they focus on desktops, servers, the cloud or mobile. Lack of hardware compatibility due to proprietary, undocumented standards has been a thorn in Linux's side from day one, and investing in collaboration to help overcome that barrier is in the interest of virtually everyone within the open source ecosystem. + +Last but not least, Valve, which develops the popular [Steam][10] platform for cloud-based games and other content, injects the Linux world with new energy in the gaming realm, an area that has traditionally been very unwelcoming to Linux users. Valve could be on the forefront of a major shift in open source entertainment that will use the power of the cloud to bring Linux into the mainstream fold—while also promoting Linux as the basis for specialized gaming hardware such as Valve's [Steam Machines][11], home gaming devices that run on Linux. + +-------------------------------------------------------------------------------- + +via: http://thevarguy.com/open-source-application-software-companies/linux-foundation-gains-new-cloud-open-hardware-and-gaming + +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://linuxfoundation.org/ +[2]:http://www.cloudius-systems.com/ +[3]:http://hsafoundation.com/ +[4]:http://www.valvesoftware.com/ +[5]:http://www.linuxfoundation.org/news-media/announcements/2013/12/cloudius-systems-hsa-foundation-and-valve-join-linux-foundation +[6]:http://kernel.org/ +[7]:https://github.com/cloudius-systems/osv +[8]:http://www.linux-kvm.org/page/Main_Page +[9]:http://www.xenproject.org/ +[10]:http://store.steampowered.com/ +[11]:http://store.steampowered.com/livingroom/SteamMachines/ \ No newline at end of file diff --git a/sources/Our Top 10 Linux Applications of 2013.md b/sources/Our Top 10 Linux Applications of 2013.md new file mode 100644 index 0000000000..931059908d --- /dev/null +++ b/sources/Our Top 10 Linux Applications of 2013.md @@ -0,0 +1,136 @@ +Our Top 10 Linux Applications of 2013 +================================================================================ +![2013 – What A Year, Right?](http://www.omgubuntu.co.uk/wp-content/uploads/2013/12/apps1.jpg) + +*2013 – What A Year, Right?* + +**This time last year we knew nothing of Ubuntu Touch; Canonical attempting to raise $32 million for a cutting-edge smartphone would’ve sounded insane; Mir was a space station while Wayland was the future; and as far as Saucy Salamanders and Trusty Tahrs are concerned, they were nothing but adjunct words on the pages of untroubled thesaurus.** + +It’s been a busy year. Canonical continue to stride forwards towards a converged future for the OS, while an estimated 25 million people continue to use the regular desktop version for their day-to-day computing needs. + +But key to both experiences are apps. Last year we rounded up 10 of our favourite apps that debuted on the desktop. This year we’re doing things a little differently by also including updates released during the course of the year. + +We’ve opted to exclude ‘obvious’ choices like Firefox, Chrome, LibreOffice and Steam (because we all know they’re awesome anyway) to highlight lesser-known apps and utilities that, this year, made the desktop experience all the more awesome. + +What did we pick? Read on. + +### Geary ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/10/Screen-Shot-2013-10-04-at-14.30.29.png) + +2013 saw Yorba, the non-profit behind Geary, try, [and fail][1], to secure a future for the app through crowd funding. That could’ve been where things ended for the app; a dour footnote in the history of apps failing to reach their true potential. Thankfully it wasn’t. + +The release of Geary 0.4.x a few months after that disappointing set-up later proved a testament to the dedication and patience of its development team. Building on a strong release from earlier in the year, Geary 0.4 arrived in October with improved stability and performance and a veritable stuffed envelope of new improvements and features in tow. + +Those who insist that the days of desktop mail clients are over are fast being made to eat their words by Yorba. Right now, Geary is one of the the best mail apps on any platform, Linux or otherwise. + +- [Install Geary from Ubuntu Software Center][2] + +### Birdie Twitter App ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/07/Screen-Shot-2013-07-11-at-10.51.jpg) + +Twitter apps for Linux are a bit of an anomaly. While there are a good number of them, few seem to work as efficiently as proprietary apps on other operating systems. That all changed with the hatching of **Birdie** back in March of this year. As the year passed we got to see it grow from an unstable, crash-prone chick to a mature and confident app sure of its direction. + +While it remains far from being the full plumed wonder I’d like, it makes this list because it does what it aims to, looks good doing it, and holds a lot of promise for the future. + +- [Read more about Birdie’s Latest Release][3] + +### Springseed ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/07/springseed.jpg) + +For obsessive note-takers 2013 wasn’t short of options – from GNOME’s obtusely named *Bijiben*, to the powerful *Nitro*. But, for me, it was the nimble *Springseed* that grabbed my attention. + +Having been built from the ground-up to be resource-friendly, the app feels responsive and light. The feature set includes all of the vital ones needed to get organised – notebook creation, text formatting, markdown support and drobox sync, etc – all presented within an attractive interface that’s free of needless cruft. + +Springseed is a free and open-source and available to download directly from the project website. + +- [Download Springseed for Ubuntu][4] + +### Unity Tweak Tool ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/03/Unity-Tweak-Tool.png) + +First released in the beginning of the year, *Unity Tweak Tool* has grown to become the ’*must have*’ app name falling off the lips of anyone offering post-Ubuntu install advice. With a smorgasbord of settings and customisation tools on-hand, the utility makes tailoring the Unity experience to suit your own tastes a [doddle][5]. + +Routinely updated to take advantage of the latest options in each new release of Ubuntu, and offering the safety net of an ‘undo’ button should anything go wayward, it’s easy to see why the app has become a favourite tool for so many. + +- [Install Unity Tweak Tool on Ubuntu][6] + +### Intel Graphics Driver Installer ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png) + +Intel (specifically Intel’s *Open Source Technology Centre*) made installing the latest and greatest Intel graphics drivers easier on Linux this year with the release of the Intel Driver Manager. The utility automate the entire detection, download and install process for the user, requiring only a couple of clicks and the bit of patience. + +Initial releases of the manager were not without issue. Thankfully, subsequent releases have seen bugs fixed and quirks ironed out. If you tried it earlier in the year without success it might be well worth trying it again. + +- [Intel Driver Manager for Linux][7] + +### Ubuntu SDK ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/07/sdk.jpg) + +A left-field choice, but an important one. The Ubuntu SDK arrived this year primed with everything developers need to create apps for Ubuntu Touch, both on phone and tablet. + +It’s hard to wax too lyrical about a tool that few desktop users will appreciate, but July’s update in particular added some great functionality – including a unified actions API, Ubuntu One database syncing and support for creating converged layouts. + +- [Learn more about the Ubuntu SDK][8] + +### VoD Enablement App ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/01/netflix.jpg) + +Arguably this entry is not so much an app as a hack dressed up to look like one. Regardless, thanks to some clever packaging foo of Erich Hoover, Netflix, LoveFilm and a host of other Silverlight-based video streaming sites are now *easily* viewable on Ubuntu for the first time – albeit unofficially, of course! + +For the full skinny on what’s supported, what it install, and how to get it you’ll want to check out our article from January. + +- [How to Watch Netflix & Others on Ubuntu][9] + +### VLC ### + +Everyone’s (cue someone saying ‘not mine!’ – ed) favourite media player received a number of updates over the course of 2013, with its most recent major update landing back in September. + +Amongst the slew of features and refinements shipped with its Linux build was support for 4K video streams; VDPAU hardware decoding; tweaks to .MKV file playback and improved DBus and MPRIS interfaces. + +### Lightworks for Linux ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/02/lightworks.jpg) + +Lightworks has an odd, but rather brilliant, claim to fame: it’s too featured, too powerful, and too professional-orientated for most desktop users to get to grips with. Addmittedly that’s hardly a shock given the pedigree of the app (used to edit many an Oscar-winning Hollywood film, dontcha’ know). + +Editshare, the company behind the app, took their time publishing a Linux Beta (having delayed its arrival on numerous occasions). But, since its release back in April, they’ve been fastidious in ensuring that it maintains feature parity with the Windows builds – a feat only achieved in the most recent set of updates. + +Now, with new features and tweaks arriving by the week, there’s never been a better time for those who fancy themselves as the next great movie maker to try it out. + +- [Latest Lightworks for Linux Update][10] + +### GNOME Music Preview ### + +![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/gnome-music.jpg) + +Alright, alright: it’s not finished. In fact, if you’re not running a pair of highly unstable GNOME PPAs you can’t even use it in Ubuntu. + +But that’s beside the point; GNOME Music is one of my stand out apps of this year. For some it’s simple to the point of uselessness, for others the beauty lies in its simplicity. Sure, it doesn’t stack up well against apps tasked with doing ‘all the things!’, but that rather misses the point. + +The attention to detail in design and user experience is second to none. + +-------------------------------------------------------------------------------- + +via: http://www.omgubuntu.co.uk/2013/12/top-10-linux-apps-of-2013 + +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出 + +[1]:http://www.omgubuntu.co.uk/2013/04/geary-fundraiser-fails-at-half-way-mark +[2]:apt:geary +[3]:http://www.omgubuntu.co.uk/2013/07/birdie-twitter-app-updates-with-conversations +[4]:http://getspringseed.com/ +[5]:http://www.thefreedictionary.com/doddle +[6]:apt://unity-tweak-tool +[7]:https://01.org/linuxgraphics/downloads/2013/intelr-graphics-installer-1.0.2-linux +[8]:http://developer.ubuntu.com/apps/create/get-the-sdk/ +[9]:http://www.omgubuntu.co.uk/2013/01/how-to-watch-lovefilm-redbox-instant-or-netflix-on-ubuntu +[10]:http://www.omgubuntu.co.uk/2013/11/lightworks-for-linux-beta-updated \ No newline at end of file