Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - SuSE Linux > ARCHIVES - Network & Security > ARCHIVES - Security
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Security Want to know if you should really apply the latest kernel patch? Want to know how to configure your firewall? Discuss any Security related topics in here!

 
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 27-Feb-2007, 23:46
felipe1982
Guest
 
Posts: n/a
Default

output of 'tail -n 500 /var/log/messages'

They are coming from http://wq.apnic.net/apnic-bin/whois.pl . Should I be concerned? I have set in my sshd "allowusers XXXXX" this represents only *ME*

What do I do??????????? [attachmentid=1411]
  #2 (permalink)  
Old 28-Feb-2007, 00:10
ghostintheruins
Guest
 
Posts: n/a
Default

That is a typical log of an ssh bruteforce attack. Try a forum / google search on the topic.

There are more ways to protect from these - one of them being not using normal auth with password but with ssh Key Authentication.

There are some programs that will block the offending IP when a ssh brute force attack is detected.

Good luck.

PS
The IP is from Korea, most likely a hacked computer.
  #3 (permalink)  
Old 28-Feb-2007, 00:14
Julian67
Guest
 
Posts: n/a
Default

Quote:
output of 'tail -n 500 /var/log/messages'

They are coming from http://wq.apnic.net/apnic-bin/whois.pl . Should I be concerned? I have set in my sshd "allowusers XXXXX" this represents only *ME*

What do I do??????????? [attachmentid=1411]
[/b]

I'm definitely no expert on these things but yes your PC is being attacked. Some people might set up a test account, and (bravely :lol: ) maybe not even password protect it, for checking out new apps etc so the attacker(script?) is trying the weakest possible accounts first and then working through all possible names for the user account name.....then it will start attacking the pasword and then he is in.

It would be better to protect your ssh log in with pgp key. There is a great podcast tutorial at Linux Reality. I don't remember which episode but check out Episode 47 OpenPGP and Episode 51 VNC which discusses using an encrypted SSH tunnel and pgp or gpg for security.
  #4 (permalink)  
Old 28-Feb-2007, 00:14
felipe1982
Guest
 
Posts: n/a
Default

Infected computer? D'ya think it may have windows on it?

I've added this to /etc/hosts.deny

ALL: xx.xx.xx.xx (ip address of intruder)

I did not need to restart sshd, but I did it anyways. All is well

for now ......................... dun dun duuun.
  #5 (permalink)  
Old 28-Feb-2007, 00:26
broch
Guest
 
Posts: n/a
Default

port knocking would take care of such problem.
setting unusual listen port may somewhat help too (it only works for stupid robots though)
  #6 (permalink)  
Old 28-Feb-2007, 01:09
felipe1982
Guest
 
Posts: n/a
Default

Quote:
port knocking would take care of such problem.
[/b]
What is port knocking?
  #7 (permalink)  
Old 28-Feb-2007, 05:24
geoffro
Guest
 
Posts: n/a
Default

Quote:
What is port knocking?
[/b]
I don't want to seem rude but try google
"Port knocking is a stealthy network authentication system that uses closed ports to carry out identification of trusted users......"

Read more here
  #8 (permalink)  
Old 28-Feb-2007, 06:10
oldcpu
Guest
 
Posts: n/a
Default

In addition to "ssh Key Authentication", another thing that you can do is change your ssh port # (for example, if one has an external router, and a LAN, ... then map a high port number to each PC), i.e.
- map router port 8001 to PC#1's port-22,
- map router port 8002 to PC#2's port-22,
- map router port 8003 to PC#3's port-22.
Once in place, that is very easy to remember and gives one easy access to any PC.

For defence against Brute Force attacks, I have also read about an app called "fail2ban", which I note is also available for SuSE.
http://www.fail2ban.org/wiki/index.php/Main_Page
http://www.ducea.com/2006/07/03/using-fail...-force-attacks/

General downlaods:
http://www.fail2ban.org/wiki/index.php/Downloads

SuSE specific downloads:
ftp://ftp.rauchs-home.de/suse/

For example, for SuSE-10.2.
ftp://ftp.rauchs-home.de/suse/10.2/RPMS/noarch/

I have not tried this myself.

I have not implemented ssh Key Authentication (yet) although I am considering it. The reason why I have NOT implemented it, is that I like the flexibility to jump on a friend's PC (when I don't have my usb stick with my authentication key with me), and access my home pc. I believe I lose that flexibility with an ssh Key Authentication.

My current defences are ssh mapped to a different port (as noted above, and it is easy for me to remember) and also disabling root ssh access on each PC. Plus I note that having a good password for both user root and regular user "oldpu" helps. But I think I may check out "fail2ban" as a further defence, which I'm hoping will also not limit my remote access flexibilty.
  #9 (permalink)  
Old 28-Feb-2007, 06:22
oldcpu
Guest
 
Posts: n/a
Default

Quote:
port knocking would take care of such problem.
setting unusual listen port may somewhat help too (it only works for stupid robots though)
[/b]
I haven't tried this myself, but I think it is a good idea. I've read one can set up a "port knocking daemon". Something more for me to read up on and learn about:
http://en.wikipedia.org/wiki/Port_knocking
http://www.linuxjournal.com/article/6811
http://www.portknocking.org/
I believe in such a case, one can then defend more than just port#22.

I've also read one can configure their firewall to only allow one connection per minute per ip address. Hence, if a connection attempt fails, the firewall will drop all connections from that ip address until there has been at least one minute since last attempt. I believe that will slow down the speed of a brute force attack. I haven't checked (yet) to see how this can be done in openSUSE. (I'm wondering if this might not also help in case of a Denial of Service attack, although a private user like myself is unlikely to ever be targetted in a Denial of Service attack).
  #10 (permalink)  
Old 28-Feb-2007, 06:38
paulh
Guest
 
Posts: n/a
Default

As oldcpu says its fairly straightforward to add some firewall rules along these lines

iptables -A INPUT -m tcp -p tcp --dport 22 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -m state --state NEW -m limit --limit 2/min --limit-burst 2 -j ACCEPT
iptables -A INPUT -m tcp -p tcp --dport 22 -j DROP

This will allow only three ssh attempts in any minute. I employee this idea on my machine and its very effective at stopping dictionary attacks - however its no good if you expect lots of genuine logins to your sshd.
 
Page 1 of 2 1 2

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2