Linode Forum Index Linode Forum
Linode Community Forums
 


someone scanning my ports

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
BipBop



Joined: 28 Apr 2011
Posts: 9

Posted: Thu Apr 28, 2011 5:59 pm    Post subject: someone scanning my ports  

Hello guys,

I am a new Linode user and need a little help in analyzing my iptables log. :)

Yesterday (April 27) I setup iptables on my linode and decided to leave the linode running to see if the firewall would pick up any action. Today I looked at my log and looks like someone was scanning my ports.

Even though the source ip is different, all the packets are originating from the same mac address and are targeted towards some common ports like 22, 135, 8080 etc.

What would be a good way to deal with these scans? A program that can add rules to iptables to block requests originating from a particular nic or ip? The timing of these attacks/scans is really spread out also so.. I doubt I can capture them using some time limit.

Any help appreciated.
Back to top  
vonskippy



Joined: 27 Dec 2009
Posts: 469
Location: Colorado, USA

Posted: Thu Apr 28, 2011 6:04 pm    Post subject:  

Welcome to the internet, don't lose sleep over random port scans, it's a very common event.
Back to top  
BipBop



Joined: 28 Apr 2011
Posts: 9

Posted: Thu Apr 28, 2011 6:09 pm    Post subject:  

haha no no i am not losing sleep over it. But would be cool to know if the scanning user does turn malicious if it can be dealt with dynamically and all his packets get dropped by my firewall or he gets added to a ignore list or something. :)

I mean his packets are being dropped right now.. but if he tries something different.
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Thu Apr 28, 2011 7:44 pm    Post subject: Re: someone scanning my ports  

BipBop wrote: Even though the source ip is different, all the packets are originating from the same mac address and are targeted towards some common ports like 22, 135, 8080 etc.

That's the MAC address of the router between the Internet and you. MAC addresses are only used to identify entities within the same local area network (in the Linode architecture, a /24 subnet). Anything beyond there will (hopefully) have the MAC address of a router.

(Edit: Also, there is no "someone" or "the scanning user"; there's probably hundreds of thousands, if not millions, of computers out there which are doing this continuously in an attempt to bring your computer into their collective. Anthropomorphizing this activity into that of "some guy" is not a good way to think about it.)
Back to top  
BipBop



Joined: 28 Apr 2011
Posts: 9

Posted: Thu Apr 28, 2011 8:12 pm    Post subject:  

Thank you for that nugget of knowledge hoopycat. My networking knowledge is rudimentary at best.. so I really appreciate that. I knew I would learn a slew of new things trying to run/maintain my own VPS. :)
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Thu Apr 28, 2011 8:50 pm    Post subject:  

No problem. It's a lot of fun, and there's plenty to learn, especially with networking stuff in general. The Internet isn't magic, but the fact that it actually works is magic :-) -rt
Back to top  
eld101



Joined: 01 Sep 2008
Posts: 63

Posted: Fri Apr 29, 2011 8:51 am    Post subject:  

You can install something like OSSEC, which scans your logs and can notify you of port scans, brute force attempts, etc...
Back to top  
eld101



Joined: 01 Sep 2008
Posts: 63

Posted: Fri Apr 29, 2011 2:13 pm    Post subject:  

eld101 wrote: You can install something like OSSEC, which scans your logs and can notify you of port scans, brute force attempts, etc...

I forgot to mention it can also automatically block the suspect IP for a given amount of time. I think default is 5 minutes.
Back to top  
haus



Joined: 03 Mar 2010
Posts: 81

Posted: Sat Apr 30, 2011 8:44 pm    Post subject:  

CSF/LFD is another option, a favorite of mine. It will detect portscanning and login failures for various services and temporarily or permanently block them.

Also, while it's not "security", moving services like SSH to higher port numbers will cut down on failed login entries, since they will be less likely to hit the right port.
Back to top  
eld101



Joined: 01 Sep 2008
Posts: 63

Posted: Sun May 01, 2011 9:34 am    Post subject:  

Just found a guide to install ossec. Its specifically for Centos, but im sure it will work for several others....

http://www.securecentos.com/extra-security/install-ossec/
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1