The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Security issue? netstat -ntu shows blank line in output

Discussion in 'Security' started by jols, Apr 1, 2007.

  1. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38
    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. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    See what output you get without piping through "cut"
     
  3. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    2
    Trophy Points:
    38

    Thanks much.

    Would the line just look like this, then?:

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

    kevinm Member

    Joined:
    Feb 22, 2006
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    -f1 is not a command to pipe to iirc
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    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.
     
Loading...

Share This Page