<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>netstat command &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/netstat-command/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Fri, 28 Dec 2012 08:33:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>How Do I Display Summary Statistics For Each Protocol On Linux ?</title>
		<link>https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/</link>
					<comments>https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Tue, 31 Jan 2012 10:47:51 +0000</pubDate>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[netstat command]]></category>
		<category><![CDATA[netstat statistic]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1321</guid>

					<description><![CDATA[<p>Q. How do I display summary statistics for each protocol on Linux ? A. Using netstat command to display summary statistics for each protocol. netstat command netstat (network statistics) is a command-line tool that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics. It is available on Unix, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/">How Do I Display Summary Statistics For Each Protocol On Linux ?</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><span style="color: #ff0000;">Q</span>. How do I display summary statistics for each protocol on Linux ?<br />
<span style="color: #008000;">A</span>. Using netstat command to display summary statistics for each protocol.<br />
<span id="more-1321"></span></p>
<h2>netstat command</h2>
<p>netstat (network statistics) is a command-line tool that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics. It is available on Unix, Unix-like, and Windows NT-based operating systems.</p>
<h2>Display summary statistics using netstat</h2>
<p>Simply use netstat -s</p>
<pre># netstat -s</pre>
<p>Ouput</p>
<pre>Ip:
    927340778 total packets received
    7 with invalid headers
    1959 with invalid addresses
    0 forwarded
    0 incoming packets discarded
    922379597 incoming packets delivered
    1280879573 requests sent out
    27 outgoing packets dropped
    4 fragments dropped after timeout
    757 reassemblies required
    354 packets reassembled ok
    4 packet reassembles failed
    20 fragments failed
Icmp:
    36541 ICMP messages received
    124 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 26890
        timeout in transit: 348
        source quenches: 11
        echo requests: 9274
        echo replies: 1
    18720 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 9446
        echo replies: 9274
IcmpMsg:
        InType0: 1
        InType3: 26890
        InType4: 11
        InType8: 9274
        InType11: 348
        OutType0: 9274
        OutType3: 9446
Tcp:
    5916623 active connections openings
    36244722 passive connection openings
    102606 failed connection attempts
    3493764 connection resets received
    53 connections established
    918246879 segments received
    1254505238 segments send out
    22244556 segments retransmited
    0 bad segments received.
    5748855 resets sent
Udp:
    4086750 packets received
    9427 packets to unknown port received.
    0 packet receive errors
    4125646 packets sent
...</pre>
<p>To display the statistics for only the TCP or UDP protocols, type one of the following commands</p>
<pre># netstat -st
# netstat -su</pre>
<p>Ouput</p>
<pre>IcmpMsg:
    InType0: 1
    InType3: 26890
    InType4: 11
    InType8: 9274
    InType11: 348
    OutType0: 9274
    OutType3: 9446
Tcp:
    5917335 active connections openings
    36247817 passive connection openings
    102606 failed connection attempts
    3493814 connection resets received
    29 connections established
    918349626 segments received
    1254667978 segments send out
    22246760 segments retransmited
    0 bad segments received.
    5749332 resets sent
...</pre>
<p>To display the quick interfaces statistics, type the following command</p>
<pre># netstat -i</pre>
<p>Ouput</p>
<pre>Kernel Interface table
Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0       1500   0 767575580      0      0      0 1120000223      0      0      0 BMRU
lo        16436   0 161102011      0      0      0 161102011      0      0      0 LRU</pre>
<p>To display the extended interfaces statistics, type the following command</p>
<pre># netstat -ie</pre>
<p>Ouput</p>
<pre>Kernel Interface table
eth0      Link encap:Ethernet  HWaddr 00:25:90:0B:A3:E4
          inet addr:221.132.34.8  Bcast:221.132.34.95  Mask:255.255.255.224
          inet6 addr: fe80::225:90ff:fe0b:a3e4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:767588970 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1120021944 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4030025515 (3.7 GiB)  TX bytes:2208549264 (2.0 GiB)
          Interrupt:169 Memory:fb5e0000-fb600000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:161106440 errors:0 dropped:0 overruns:0 frame:0
          TX packets:161106440 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3387569934 (3.1 GiB)  TX bytes:3387569934 (3.1 GiB)</pre>
<g:plusone href="https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/">How Do I Display Summary Statistics For Each Protocol On Linux ?</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-do-i-display-summary-statistics-for-each-protocol-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How Do I Find Hidden Processes and Ports ?</title>
		<link>https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/</link>
					<comments>https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 30 Dec 2011 02:09:03 +0000</pubDate>
				<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[bruteforcing]]></category>
		<category><![CDATA[dependency tree]]></category>
		<category><![CDATA[forensic tool]]></category>
		<category><![CDATA[hidden processes]]></category>
		<category><![CDATA[kernels]]></category>
		<category><![CDATA[lkms]]></category>
		<category><![CDATA[ms windows operating systems]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[netstat command]]></category>
		<category><![CDATA[posix]]></category>
		<category><![CDATA[process ids]]></category>
		<category><![CDATA[security projects]]></category>
		<category><![CDATA[ss command]]></category>
		<category><![CDATA[tcp udp ports]]></category>
		<category><![CDATA[unhide-tcp command]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1274</guid>

					<description><![CDATA[<p>Unhide is a forensic tool to find hidden processes and TCP/UDP ports by rootkits / LKMs or by another hidden technique. Unhide (ps) Detecting hidden processes. Implements six techniques Compare /proc vs /bin/ps output  Compare info gathered from /bin/ps with info gathered by walking thru the procfs. Compare info gathered from /bin/ps with info gathered [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/">How Do I Find Hidden Processes and Ports ?</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Unhide</strong> is a forensic tool to find hidden processes and TCP/UDP ports by rootkits / LKMs or by another hidden technique.<span id="more-1274"></span><br />
<strong>Unhide (ps)</strong><br />
Detecting hidden processes. Implements six techniques</p>
<ul>
<li>Compare /proc vs /bin/ps output</li>
<li> Compare info gathered from /bin/ps with info gathered by walking thru the procfs.</li>
<li>Compare info gathered from /bin/ps with info gathered from syscalls (syscall scanning).</li>
<li>Full PIDs space occupation (PIDs bruteforcing)</li>
<li>Reverse search, verify that all thread seen by ps are also seen by the kernel ( /bin/ps output vs /proc, procfs walking and syscall )</li>
<li>Quick compare /proc, procfs walking and syscall vs /bin/ps output.</li>
</ul>
<p><strong>Unhide-TCP</strong><br />
Identify TCP/UDP ports that are listening but not listed in /bin/netstat doing brute forcing of all TCP/UDP ports availables.</p>
<h2>How do I install unhide</h2>
<p>To install Unhide under CentOS/RedHat, login as root and type the following command</p>
<pre>
# yum install unhide
</pre>
<p>Sample outputs</p>
<pre>
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package unhide.x86_64 0:0.0.20080519-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package       Arch          Version                      Repository       Size
================================================================================
Installing:
 unhide        x86_64        0.0.20080519-1.el5.rf        rpmforge        528 k

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 528 k
Is this ok [y/N]: y
Downloading Packages:
unhide-0.0.20080519-1.el5.rf.x86_64.rpm                  | 528 kB     00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : unhide                                                   1/1

Installed:
  unhide.x86_64 0:0.0.20080519-1.el5.rf

Complete!
</pre>
<h2>How do I use this tool</h2>
<p>You can use it as follows:</p>
<pre>
# unhide proc | sys | brute
</pre>
<p>Example, type the following command to find hidden proc</p>
<pre>
# unhide proc
Unhide 20080519
yjesus@security-projects.com
[*]Searching for Hidden processes through /proc scanning
</pre>
<p>Example, type the following command to find the hidden TCP/UDP ports</p>
<pre>
# unhide-tcp
</pre>
<p>Sample outputs</p>
<pre>
Unhide 20080519
yjesus@security-projects.com
Starting TCP checking
Starting UDP checking
</pre>
<p>No found hidden ports using the unhide-tcp command.</p>
<g:plusone href="https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/">How Do I Find Hidden Processes and Ports ?</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-do-i-find-hidden-processes-and-ports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>10 lsof Command Examples</title>
		<link>https://lifelinux.com/10-lsof-command-examples/</link>
					<comments>https://lifelinux.com/10-lsof-command-examples/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Sat, 14 May 2011 16:41:13 +0000</pubDate>
				<category><![CDATA[Bash Shell]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[command line options]]></category>
		<category><![CDATA[fuser command]]></category>
		<category><![CDATA[grep command]]></category>
		<category><![CDATA[grep program]]></category>
		<category><![CDATA[internet connections]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux-distributions]]></category>
		<category><![CDATA[list open files]]></category>
		<category><![CDATA[ls command]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[lsof command]]></category>
		<category><![CDATA[netstat command]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[port numbers]]></category>
		<category><![CDATA[process id]]></category>
		<category><![CDATA[proto]]></category>
		<category><![CDATA[ps command]]></category>
		<category><![CDATA[running processes]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[udp]]></category>
		<category><![CDATA[UNIX]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=523</guid>

					<description><![CDATA[<p>The lsof command or &#8220;list open files&#8221; command in Linux is a powerful tool. In Linux and Unix everything behind the scenes are just files. This includes IP sockets, pipes, unix sockets, directories, devices, even inodes are just files. This means that lsof can actually tell you a lot of information of what is going [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/10-lsof-command-examples/">10 lsof Command Examples</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>The <strong>lsof command</strong> or &#8220;list open files&#8221; command in Linux is a powerful tool. In Linux and Unix everything behind the scenes are just files. This includes IP sockets, pipes, unix sockets, directories, devices, even inodes are just files. This means that lsof can actually tell you a lot of information of what is going on on your system.<span id="more-523"></span></p>
<h3>Synopsis</h3>
<pre>
lsof [ -?abChlnNOPRstUvVX ] [ -A A ] [ -c c ] [ +|-d d ] [ +|-D D ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ +|-L [l] ] [ -m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -- ] [names] 
</pre>
<h3>Example 1: Show all opened files</h3>
<p>Type the following command</p>
<pre>
lsof | more
</pre>
<p>Sample outputs</p>
<pre>
COMMAND     PID      USER   FD      TYPE     DEVICE      SIZE       NODE NAME
init          1      root  cwd       DIR      253,4      4096          2 /
init          1      root  rtd       DIR      253,4      4096          2 /
init          1      root  txt       REG      253,4     38652   41746599 /sbin/init
init          1      root  mem       REG      253,4    129900   16252964 /lib/ld-2.5.so
init          1      root  mem       REG      253,4   1693812   16252965 /lib/libc-2.5.so
init          1      root  mem       REG      253,4     20668   16253168 /lib/libdl-2.5.so
init          1      root  mem       REG      253,4    245376   16253222 /lib/libsepol.so.1
init          1      root  mem       REG      253,4     93508   16253815 /lib/libselinux.so.1
init          1      root   10u     FIFO       0,17                 1277 /dev/initctl
...
</pre>
<h3>Example 2: Show all opened internet sockets</h3>
<p>Using the -i flag lsof will list the internet sockets currently opened</p>
<pre>
lsof -i
</pre>
<p>Sample outputs</p>
<pre>
COMMAND     PID   USER   FD   TYPE   DEVICE SIZE NODE NAME
sshd       2537   root    3u  IPv6     5348       TCP *:rockwell-csp2 (LISTEN)
mysqld     2625  mysql   11u  IPv4     5463       TCP *:mysql (LISTEN)
httpd      2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
...
</pre>
<h3>Example 3: Shows all networking related to a given port 80</h3>
<pre>
lsof -i :80
</pre>
<p>Sample outputs</p>
<pre>
COMMAND   PID   USER   FD   TYPE   DEVICE SIZE NODE NAME
httpd    2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
httpd    2731 apache   58u  IPv6 39448263       TCP server.com:http->adsl-dynamic-pool-xxx.hcm.fpt.vn:23527 (ESTABLISHED)
httpd    2731 apache   60u  IPv6 39448302       TCP server.com:http->crawl-66-249-69-83.googlebot.com:35190 (ESTABLISHED)
httpd    2731 apache   61u  IPv6 39448336       TCP server.com:http->v16-13.opera-mini.net:37548 (ESTABLISHED)
httpd    2731 apache   62u  IPv6 39448388       TCP server.com:http->v16-13.opera-mini.net:37561 (ESTABLISHED)
httpd    2731 apache   64u  IPv6 39447543       TCP server.com:http->adsl.viettel.vn:13636 (FIN_WAIT2)
</pre>
<h3>Example 4: Show all TCP/UDP connections</h3>
<pre>
lsof -i TCP
</pre>
<p>Sample outputs</p>
<pre>
sshd       2537   root    3u  IPv6     5348       TCP *:rockwell-csp2 (LISTEN)
mysqld     2625  mysql   11u  IPv4     5463       TCP *:mysql (LISTEN)
httpd      2731 apache    3u  IPv6 30048993       TCP *:http (LISTEN)
...
</pre>
<h3>Example 5: List open files associated with process ID</h3>
<p>The flag +p will display all open files associated with specific process ID, example with process ID is 2625</p>
<pre>
lsof +p 2625
</pre>
<p>Sample outputs</p>
<pre>
COMMAND  PID  USER   FD   TYPE     DEVICE      SIZE     NODE NAME
mysqld  2625 mysql  cwd    DIR      253,4      4096 21495811 /var/lib/mysql
mysqld  2625 mysql  rtd    DIR      253,4      4096        2 /
mysqld  2625 mysql  txt    REG      253,4   7020300 50999198 /usr/libexec/mysqld
mysqld  2625 mysql  DEL    REG      253,4           16253135 /lib/libcrypto.so.0.9.8e.#prelink#.64u8kX
mysqld  2625 mysql  mem    REG      253,4           16252984 /lib/libm-2.5.so (path inode=16253122)
mysqld  2625 mysql  DEL    REG      253,4           50996047 /usr/lib/libgssapi_krb5.so.2.2.#prelink#.YYIHuy
mysqld  2625 mysql  mem    REG      253,4           16252990 /lib/libselinux.so.1 (path inode=16253815)
mysqld  2625 mysql  mem    REG      253,4           16256252 /lib/libsepol.so.1 (path inode=16253222)
mysqld  2625 mysql  mem    REG      253,4     50848 16253138 /lib/libnss_files-2.5.so
mysqld  2625 mysql  mem    REG      253,4           16253825 /lib/librt-2.5.so (path inode=16253220)
mysqld  2625 mysql  mem    REG      253,4           16252942 /lib/ld-2.5.so (path inode=16252964)
mysqld  2625 mysql  mem    REG      253,4           50996107 /usr/lib/libstdc++.so.6.0.8 (path inode=50989584)
mysqld  2625 mysql  mem    REG      253,4           50996061 /usr/lib/libkrb5.so.3.3 (path inode=50999803)
mysqld  2625 mysql  mem    REG      253,4           16252980 /lib/libdl-2.5.so (path inode=16253168)
...
</pre>
<h3>Example 6: Show what a given user has open</h3>
<p>The flag -u will show what a given user has open</p>
<pre>
lsof -u apache
</pre>
<p>Sample outputs</p>
<pre>
COMMAND   PID   USER   FD   TYPE     DEVICE      SIZE     NODE NAME
httpd    2731 apache  cwd    DIR      253,4      4096        2 /
httpd    2731 apache  rtd    DIR      253,4      4096        2 /
httpd    2731 apache  txt    REG      253,4   3120954 51157630 /usr/local/apache/bin/httpd
httpd    2731 apache  mem    REG      253,4    375710 51157607 /usr/local/apache/lib/libaprutil-1.so.0.3.10
httpd    2731 apache  mem    REG      253,4     45432 16253184 /lib/libcrypt-2.5.so
httpd    2731 apache  mem    REG      253,4      7748 16253849 /lib/libcom_err.so.2.1
httpd    2731 apache  mem    REG      253,4      7880 16253845 /lib/libkeyutils-1.2.so
httpd    2731 apache  mem    REG      253,4    937178 51157689 /usr/local/apache/modules/mod_security2.so
httpd    2731 apache  mem    REG      253,4    129208 16253851 /lib/libpcre.so.0.0.1
...
</pre>
<g:plusone href="https://lifelinux.com/10-lsof-command-examples/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/10-lsof-command-examples/">10 lsof Command Examples</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/10-lsof-command-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
