Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default Security issue? netstat -ntu shows blank line in output

    Here are the bottom 10 or so lines after running:
    netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

    2 210.213.238.11
    2 213.96.228.45
    2 65.54.188.142
    2 66.249.65.162
    2 67.170.117.81
    6 127.0.0.1
    7 203.59.162.161
    20
    26 60.230.255.210

    Should I be concerned about line #20 there?

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    See what output you get without piping through "cut"

  3. #3
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Quote Originally Posted by Spiral View Post
    See what output you get without piping through "cut"

    Thanks much.

    Would the line just look like this, then?:

    netstat -ntu | awk '{print $5}' | -f1 | sort | uniq -c | sort -n

  4. #4
    Member
    Join Date
    Feb 2006
    Posts
    19

    Default

    -f1 is not a command to pipe to iirc

  5. #5
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Remove the '-f1' ... that's part of the "cut" command.

    Code:
    cut -d: -f1
    That basically says to take the output text being piped through
    and cut up the lines into columns divided by a colon character
    and return only the first section of each line that appears
    before the first colon character and discard the rest.

    I suspect your so called extra line from netstat is appearing
    because you are filtering a line through that cut pipe that
    is not really netstat output but perhaps formatting lines or
    surrounding comment or title text instead resulting in
    a blank line being output in your final output.

    If you don't pipe through "cut" then you can see the actual
    real output that resulted from netstat without it being trimmed
    and can see what really appears on that blank line of yours.

Similar Threads & Tags
Similar threads

  1. Replies: 7
    Last Post: 04-04-2010, 04:39 PM
  2. netstat output truncates octets?
    By elkram in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-09-2009, 11:59 AM
  3. netstat shows many TIME_WAIT
    By nikcool in forum New User Questions
    Replies: 0
    Last Post: 02-25-2009, 12:47 PM
  4. Apache 2.2. security issue? Raw index shows system details.
    By jols in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 01-22-2008, 06:56 PM
  5. webmail shows blank
    By meeti in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 01-15-2008, 10:30 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube