LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-29-2023, 06:30 PM   #1
catatung
LQ Newbie
 
Registered: May 2023
Posts: 2

Rep: Reputation: 1
iptraf shows many connections not displayed in netstat


Hello,

Recently I fired up iptraf-ng on a Debian 11 machine. I've not used this utility before, however I am familiar with tcpdump.

To my surprise, there were tons of connection data shown from iptraf. At first I was concerned, but that netstat shows none of this. It looks like the usual garbage noise you get from a cable modem connection. Port scans, attempted connections to RDP port 3389, etc.

I have my systems locked down with iptables -- generally everything is set to DROP unless I need it. I have a suspicion that iptraf can see traffic that is ultimately dropped by netfilter/iptables, and this is why it's not in netstat but appears in iptraf. I've searched for awhile now and cannot find any confirmation about this from someone who would know.

Rather than just go with my suspicion or hunch, does anyone know for fact and/or from experience -- if traffic is ultimately blocked from a firewall and/or iptables, will these connection attempts still be shown by iptraf? I imagine if it is hooked directly to the ethernet interface and not the kernel that it would be able to see such traffic.

I would like to get some opinions and/or knowledge from the community from anyone who would know. Thanks for any insight or help.
 
Old 05-29-2023, 07:17 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
Welcome to LQ!

For anyone to provide a useful answer we would need to know the iptraf and netstat commands you are using in order to compare what they will show.

In general, netstat is going to show listening applications and established connections (depending on command options) whereas iptraf may show all packets traversing the interface (again depending on command options).

If you are behind a router, which presumably you are, you should not see incoming probes unless you have some ports forwarded - but again depends on your configuration.

Last edited by astrogeek; 05-29-2023 at 07:20 PM.
 
Old 05-30-2023, 02:24 AM   #3
catatung
LQ Newbie
 
Registered: May 2023
Posts: 2

Original Poster
Rep: Reputation: 1
Hello Astrogeek --

With Netstat I usually use "netstat -atulpn | grep EST" to see established connections and "netstat -atulpn | grep LIST" to see listening ports.

With iptraf-ng, I was using "IP Traffic Monitor -- All Interfaces"

As far as direction is concerned I need to read up on iptraf in particular to discern the meaning of > vs = in the one column, I presume this specifies direction.

This PC in particular is the router -- the cable modem connects directly to the network interface, which is the reason for my aggressive and limiting iptables policy. Also is reason why I suspect this traffic is visible to iptraf. I am pretty confident all this noise I am seeing is ultimately blocked, because I have no services even running on, for example, port 3389, and I've checked and that port does not respond, however I would like to understand iptraf's reach and whether it is able to see blocked traffic and know this is the case rather than just have convinced myself.

Thanks for your input
 
1 members found this post helpful.
Old 05-31-2023, 07:39 AM   #4
callumbryne
LQ Newbie
 
Registered: May 2023
Posts: 1

Rep: Reputation: 0
nice
 
Old 05-31-2023, 12:03 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
If your PC connects directly to the modem then iptraf can see everything that arrives at the inteface, meaning you will see all the probes and mal-packets that pass by.

Your netstat command will show only listeners and established connections. In a simplistic way, difference between the iptraf output and netstat will be the dropped packets.

You should be able to look at your iptables rules counters to get a sense of what is actually being dropped (or write DROP rules just to get a count).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: NETSTAT Command: Learn to use netstat with examples LXer Syndicated Linux News 0 12-06-2017 12:24 PM
iptraf in current no eth0 displayed - link to patch disturbed1 Slackware 6 01-24-2011 03:00 PM
Slow internet connection iptraf shows a lot of UDP port 53 (Domain) traffic bucovaina78 Linux - Networking 3 12-22-2009 01:53 PM
2000 MySQL connections, still "too many connections" newlinuxnewbie Linux - General 0 11-07-2005 01:03 PM
any improved version of iptraf or any other utility like iptraf..? shahg_shahg Linux - Networking 1 03-07-2005 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration