LinuxQuestions.org
Visit Jeremy's Blog.
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-07-2011, 06:57 AM   #1
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Rep: Reputation: 17
Unknown stuff in IpTables log


Hi all!

On my desktop computer (Fedoro14), I use iptables, which logs to a file. In this file I see regularly some dropped data as in:
Quote:
May 7 09:29:32 richard kernel: [ 6416.992167] Dropped by firewall OUTPUT: IN= OUT=eth0 SRC=192.168.1.120 DST=87.248.203.253 LEN=52 TOS=0x00 PREC=0x00 TTL=64 ID=6821 DF PROTO=TCP SPT=35815 DPT=80 WINDOW=54 RES=0x00 ACK PSH FIN URGP=0
The DST IP address is used about 10 times. The next day, another IP address is mentioned. But always SPT=high range, DPT=80.

How can I find the source of this thing?
 
Old 05-07-2011, 07:44 AM   #2
OlRoy
Member
 
Registered: Dec 2002
Posts: 306

Rep: Reputation: 86
The source appears to be your own computer: 192.168.1.120. It's traffic that's going out to a web server, which you can tell by the DPT of 80. The high source port is to be expected.

Last edited by OlRoy; 05-07-2011 at 07:45 AM.
 
Old 05-08-2011, 01:06 AM   #3
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by OlRoy View Post
The source appears to be your own computer: 192.168.1.120. It's traffic that's going out to a web server, which you can tell by the DPT of 80. The high source port is to be expected.
Hi Olroy, thanks for replying!

The source is my own computer. If I type the remote IP numbers in my web browser, I never get a web page. So it is not a web server, who gives "normal" info. Also I never saw this behavior until a few weeks ago.

So I am worried about this traffic. And I want to investigate further.

What should I do to get more information about this trafic?
 
Old 05-08-2011, 06:11 AM   #4
OlRoy
Member
 
Registered: Dec 2002
Posts: 306

Rep: Reputation: 86
I'm willing to guess you have Avast installed since the destination IP is associated with Avast. I think you can relax and allow the traffic out.
 
Old 05-08-2011, 06:41 AM   #5
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by OlRoy View Post
I'm willing to guess you have Avast installed since the destination IP is associated with Avast. I think you can relax and allow the traffic out.
Thanks for the relaxing words ;-)

I searched with "rpm -qa | grep avast". This gives nothing.
A "updatedb; locate avast" also stays empty.

Further invertigation of the logfile with
Code:
tail -n 10000 IpTables.log | grep "DPT=80 " | grep -v "SPT=80 " | cut -dD -f3- | cut -c4- | cut -d" " -f1 | sort | uniq
gives a list of
Code:
130.161.131.20, 130.59.10.36, 134.109.228.1, 174.129.27.113, 174.35.67.56, 178.250.0.76, 178.250.0.77, 178.250.1.71, 178.250.1.77, 193.219.28.140, 195.219.150.10, 204.11.109.154, 204.11.109.155, 204.11.109.168, 213.244.185.15, 62.69.177.200, 62.69.177.201, 65.54.89.223, 66.102.13.101, 66.102.13.113, 66.102.13.138, 66.102.13.139, 66.196.118.49, 67.207.148.83, 68.67.179.208, 68.67.185.208, 68.67.185.209, 68.67.185.215, 69.147.83.198, 74.86.141.62, 75.126.79.130, 8.12.211.254, 83.149.75.183, 83.96.153.191, 87.248.203.253, 87.248.203.254, 89.151.66.198, 92.122.217.179, 93.184.220.20, 94.127.72.60, 94.127.72.90, 94.127.77.40, 94.75.223.121, 98.139.197.254
These addresses belongs to different companies. Not only avast.

So, I am back to the worrying state.

Do you have more tips? Or more relaxing words?
 
Old 05-08-2011, 07:12 AM   #6
OlRoy
Member
 
Registered: Dec 2002
Posts: 306

Rep: Reputation: 86
I just picked 68.67.185.209 randomly and it seems to of had a history of being malicious at some point. I tried another and it seemed to be related to advertisements, which you would expect by surfing the web and such. Maybe you're just surfing the web and some content like banners are causing you to download content from somewhere else. What are you doing when you one of those outbound packets are dropped?

I'm not sure how many IPs are malicious or what they are doing from the little I've seen so far. You can use tcpdump to capture traffic for a while and then go back and investigate the contents with tcpdump or an updated version of Wireshark.

Code:
sudo tcpdump -i <interface> -s0 -nn -w tcp80.pcap 'tcp port 80 or udp port 53'
Obviously, if you're using a blacklist of some kind for your IP tables rules, that would explain a lot. Do you know why the traffic is being dropped in the first place?

Last edited by OlRoy; 05-08-2011 at 07:18 AM.
 
1 members found this post helpful.
Old 05-08-2011, 08:26 AM   #7
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by OlRoy View Post
I just picked 68.67.185.209 randomly and it seems to of had a history of being malicious at some point. I tried another and it seemed to be related to advertisements, which you would expect by surfing the web and such. Maybe you're just surfing the web and some content like banners are causing you to download content from somewhere else. What are you doing when you one of those outbound packets are dropped?

I'm not sure how many IPs are malicious or what they are doing from the little I've seen so far. You can use tcpdump to capture traffic for a while and then go back and investigate the contents with tcpdump or an updated version of Wireshark.

Code:
sudo tcpdump -i <interface> -s0 -nn -w tcp80.pcap 'tcp port 80 or udp port 53'
Obviously, if you're using a blacklist of some kind for your IP tables rules, that would explain a lot. Do you know why the traffic is being dropped in the first place?
Perhaps I am surfing at that time. It is my desktop computer... But I did not relate the two together.

I have a list of "bad" ip's (who accesses my server in the past with strange stuff). But these are dropped before it reaches the "LOG" file.

In my IpTables.sh, I have:
Code:
$IPT -A OUTPUT -p tcp --dport 80 -m state --state NEW -j ACCEPT
So only new trafic is allowed to pass. My conclusion: it is related.

The next time, when I am at my desktop, I start the tail -f on my logfile and the tcpdump first. Than see what happens.

Thanks for your help!
 
Old 05-08-2011, 09:09 AM   #8
OlRoy
Member
 
Registered: Dec 2002
Posts: 306

Rep: Reputation: 86
No problem. Someone correct me if I'm wrong, but if that's the only output rule you have, you might need to change the rule to:

Code:
$IPT -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
However, if that's your only rule in OUTPUT, I would think you'd have to have a default accept OUTPUT policy because you'd need other protocols to send traffic out like DNS to get any use out of your computer's network connection.
 
Old 05-08-2011, 09:25 AM   #9
Zilvermeeuw
Member
 
Registered: Jan 2006
Distribution: Fedora 20, 21, 22, CentOS 6, CentOs 7
Posts: 92

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by OlRoy View Post
No problem. Someone correct me if I'm wrong, but if that's the only output rule you have, you might need to change the rule to:

Code:
$IPT -A OUTPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
However, if that's your only rule in OUTPUT, I would think you'd have to have a default accept OUTPUT policy because you'd need other protocols to send traffic out like DNS to get any use out of your computer's network connection.
he he he.... It is not the only rule.
I started my rules with a drop on each chain and a log rule. Than I added the ACCEPT rules as tight as possible, until the computer can do it's job.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Grub error unknown filesystem...really messed stuff up! sillyreed Linux - Newbie 10 01-11-2011 01:55 PM
Firewall log file, how to make several different log files with IPTables? newtovanilla Linux - Newbie 5 11-28-2008 12:39 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
weird stuff in /var/log/auth.log bschiett Linux - Security 3 03-12-2005 08:29 AM
Deleted /var/log/messages, can't log any files-iptables chingyenccy Linux - Newbie 7 02-27-2005 04:03 PM

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

All times are GMT -5. The time now is 11:41 AM.

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