Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
have I been hacked?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ahadley
n00b
n00b


Joined: 08 Jan 2004
Posts: 45
Location: UK

PostPosted: Sun Feb 13, 2005 11:37 am    Post subject: have I been hacked? Reply with quote

Hi, I have a server which runs nothing but server things (i.e. no xorg or anything other than apache, mysql and so on.) It serves wesites to the wider world and so on.

I recently completely ran out of space so did a few du commands to find oput what has used it all... it was all being used up in /var/tmp/, not a supprise i guess so i checked in there.

However the directory using all the space was one called '...', and which was owned by distcc, group daemon. weird I thought. inside this directory was only one, also called '...', inside this one called 'user' then 'site'... ls in here gives:

Code:
# ls -hl /var/tmp/.../.../usr/site/
total 5.5K
drwx------  3 distcc daemon 1.8K Feb 11 18:58 Ladies.In.Lavender.DVDRiP.XViD-HLS
drwx------  3 distcc daemon 1.2K Feb  9 01:20 SHREDDER.9-HOODLUM
drwx------  4 distcc daemon 1.9K Feb 12 02:36 Star.Trek.Enterprise.S04E14.HDTV.XviD-LOL


Which I am a little worried about...

Any suggestions?

Oh, not sure if it is connected but a few days ago I noticed someone connecting to my ports one at a time, I descovered them at port 4000ish with netstat, and watched as they slowly work up in port numbers.

Thanks in advance for your help,
Alex
_________________
Common sense is the collection of prejudices acquired by age eighteen.
Albert Einstein
Back to top
View user's profile Send private message
ahadley
n00b
n00b


Joined: 08 Jan 2004
Posts: 45
Location: UK

PostPosted: Sun Feb 13, 2005 11:44 am    Post subject: Reply with quote

on closer inspection a load more stuff in here:

Code:
# ls -lh /var/tmp/.../.../usr
total 7.5K
drwxrwxrwx  4 distcc daemon  760 Dec 19 18:57 bin
drwxrwxrwx  4 distcc daemon  520 Feb 13 00:59 etc
drwxrwxrwx  2 distcc daemon 2.9K Dec 10 14:24 help
drwxrwxrwx  3 distcc daemon  320 Feb 10 22:45 log
drwxrwxrwx  5 distcc daemon  712 Dec 10 15:14 msg
drwxrwxrwx  2 distcc daemon  152 Feb  8 20:41 sbin
drwxrwxrwx  5 distcc daemon  288 Feb 12 19:30 site


Code:
# ls -lh /var/tmp/.../.../usr/bin/
total 233K
-rwxrwxrwx  1 distcc daemon 8.3K Dec 10 14:24 checksum
-rwxrwxrwx  1 distcc daemon 8.8K Dec 10 14:24 dirdupe.pl
-rwxrwxrwx  1 distcc daemon 3.2K Dec 10 14:24 dirundupe.pl
-rwxrwxrwx  1 distcc daemon 5.3K Dec 10 14:24 fillrequest.pl
-rwxrwxrwx  1 distcc daemon 2.9K Dec 10 14:24 force_sfv.pl
-rwxrwxrwx  1 distcc daemon  17K Dec 10 14:24 glconv
-rwxrwxrwx  1 distcc daemon  12K Dec 10 14:24 glconv.pl
drwxrwxrwx  2 distcc daemon   80 Dec 10 14:24 grp
-rwxrwxrwx  1 distcc daemon 2.3K Dec 12 22:05 infoline.pl
-rwxrwxrwx  1 distcc daemon 6.4K Dec 10 14:24 lastdirs.pl
-rwxrwxrwx  1 distcc daemon 5.3K Dec 10 14:24 mkdir.pl
-rwxrwxrwx  1 distcc daemon  24K Dec 10 14:24 msg
-rwxrwxrwx  1 distcc daemon  165 Dec 10 14:24 msgcheck.sh
-rwxrwxrwx  1 distcc daemon 5.9K Dec 10 14:24 nuke.pl
-rwxrwxrwx  1 distcc daemon 2.6K Dec 10 14:24 oneliner.pl
-rwxrwxrwx  1 distcc daemon 6.3K Dec 10 14:24 pre.pl
-rwxrwxrwx  1 distcc daemon  39K Dec 10 14:45 primecheck.pl
-rwxrwxrwx  1 distcc daemon 7.9K Dec 10 14:24 primetools.pm
-rwxrwxrwx  1 distcc daemon 5.3K Dec 10 14:24 request.pl
-rwxrwxrwx  1 distcc daemon 1.2K Dec 10 14:24 rules.sh
-rwxrwxrwx  1 distcc daemon  14K Dec 10 14:24 sitebot.pl
-rwxrwxrwx  1 distcc daemon  12K Dec 10 14:24 stats.pl
-rwxrwxrwx  1 distcc daemon  845 Dec 10 14:24 test
drwxrwxrwx  2 distcc daemon   80 Dec 10 14:24 usr


Code:
# ls -lh /var/tmp/.../.../usr/etc/
total 49K
-rwxrwxrwx  1 distcc daemon   54 Dec 10 14:24 cdpath.cfg
-rwxrwxrwx  1 distcc daemon   81 Dec 10 14:24 check.cfg
-rwxrwxrwx  1 distcc daemon   77 Dec 10 14:24 checkdirdupe.cfg
-rwxrwxrwx  1 distcc daemon   16 Dec 10 14:24 checkdupe.cfg
-rwxrwxrwx  1 distcc daemon  902 Dec 10 14:24 customcmd.cfg
-rwxrwxrwx  1 distcc daemon   35 Dec 10 14:24 dirshortcut.cfg
-rwxrwxrwx  1 distcc daemon 1.1K Dec 10 14:58 dupelog.bin
-rw-------  1 distcc daemon  930 Feb  8 21:19 ftpd.reg
-rwxrwxrwx  1 distcc daemon  304 Dec 10 14:29 groups
-rwxrwxrwx  1 distcc daemon  101 Dec 10 21:15 limits.cfg
-rwxrwxrwx  1 distcc daemon 2.4K Dec 10 14:24 rel_nfo.lst
drwxrwxrwx  2 distcc daemon  344 Dec 10 20:53 sections
-rwxrwxrwx  1 distcc daemon  558 Dec 10 14:24 sections.cfg
drwxrwxrwx  2 distcc daemon  288 Feb 13 00:14 stats
-rw-------  1 distcc daemon    0 Feb 13 00:59 users


Code:
# ls -lh /var/tmp/.../.../usr/help/
total 356K
-rwxrwxrwx  1 distcc daemon  114 Dec 10 14:24 addgroupop.privileged
-rwxrwxrwx  1 distcc daemon   86 Dec 10 14:24 addgrp.privileged
-rwxrwxrwx  1 distcc daemon  122 Dec 10 14:24 addip.privileged
-rwxrwxrwx  1 distcc daemon   85 Dec 10 14:24 addnuker.privileged
-rwxrwxrwx  1 distcc daemon  112 Dec 10 14:24 addsiteop.privileged
-rwxrwxrwx  1 distcc daemon   89 Dec 10 14:24 addunduper.privileged
-rwxrwxrwx  1 distcc daemon  265 Dec 10 14:24 adduser.privileged
-rwxrwxrwx  1 distcc daemon  152 Dec 10 14:24 bind.privileged
-rwxrwxrwx  1 distcc daemon   99 Dec 10 14:24 chgrp.privileged
-rwxrwxrwx  1 distcc daemon  910 Dec 10 14:24 chmod.privileged
-rwxrwxrwx  1 distcc daemon  925 Dec 10 14:24 chmodr.privileged
-rwxrwxrwx  1 distcc daemon  272 Dec 10 14:24 chown.privileged
-rwxrwxrwx  1 distcc daemon  323 Dec 10 14:24 chownr.privileged
-rwxrwxrwx  1 distcc daemon  236 Dec 10 14:24 close.privileged
-rwxrwxrwx  1 distcc daemon   75 Dec 10 14:24 color
-rwxrwxrwx  1 distcc daemon   68 Dec 10 14:24 count
-rwxrwxrwx  1 distcc daemon  168 Dec 10 14:24 del.privileged
-rwxrwxrwx  1 distcc daemon   84 Dec 10 14:24 delgroupop.privileged
-rwxrwxrwx  1 distcc daemon   89 Dec 10 14:24 delgrp.privileged
-rwxrwxrwx  1 distcc daemon  146 Dec 10 14:24 delip.privileged
-rwxrwxrwx  1 distcc daemon   88 Dec 10 14:24 delnuker.privileged
-rwxrwxrwx  1 distcc daemon   82 Dec 10 14:24 delsiteop.privileged
-rwxrwxrwx  1 distcc daemon   92 Dec 10 14:24 delunduper.privileged
-rwxrwxrwx  1 distcc daemon   97 Dec 10 14:24 deluser.privileged
-rwxrwxrwx  1 distcc daemon   66 Dec 10 14:24 disable.privileged
-rwxrwxrwx  1 distcc daemon  156 Dec 10 14:24 dump.privileged
-rwxrwxrwx  1 distcc daemon   64 Dec 10 14:24 enable.privileged
-rwxrwxrwx  1 distcc daemon   89 Dec 10 14:24 exec.privileged
-rwxrwxrwx  1 distcc daemon  302 Dec 10 14:24 ff
-rwxrwxrwx  1 distcc daemon   82 Dec 10 14:24 fillrequest
-rwxrwxrwx  1 distcc daemon  219 Dec 10 14:24 gadduser
-rwxrwxrwx  1 distcc daemon  269 Dec 10 14:24 ginfo
-rwxrwxrwx  1 distcc daemon  227 Dec 10 14:24 give
-rwxrwxrwx  1 distcc daemon 1.3K Dec 10 14:24 group.change.privileged
-rwxrwxrwx  1 distcc daemon   50 Dec 10 14:24 group.normal
-rwxrwxrwx  1 distcc daemon  854 Dec 10 14:24 group.privileged
-rwxrwxrwx  1 distcc daemon  101 Dec 10 14:24 groups.normal
-rwxrwxrwx  1 distcc daemon  233 Dec 10 14:24 groups.privileged
-rwxrwxrwx  1 distcc daemon 2.9K Dec 10 14:24 help.normal
-rwxrwxrwx  1 distcc daemon 6.5K Dec 10 14:24 help.privileged
-rwxrwxrwx  1 distcc daemon   75 Dec 10 14:24 idle
-rwxrwxrwx  1 distcc daemon  261 Dec 10 14:24 info
-rwxrwxrwx  1 distcc daemon  443 Dec 10 14:24 ipban.privileged
-rwxrwxrwx  1 distcc daemon  508 Dec 10 14:24 kick.privileged
-rwxrwxrwx  1 distcc daemon   84 Dec 10 14:24 kill.privileged
-rwxrwxrwx  1 distcc daemon  114 Dec 10 14:24 lgrp
-rwxrwxrwx  1 distcc daemon   93 Dec 10 14:24 luser
-rwxrwxrwx  1 distcc daemon   85 Dec 10 14:24 mod
-rwxrwxrwx  1 distcc daemon  773 Dec 10 14:24 msg
-rwxrwxrwx  1 distcc daemon  203 Dec 10 14:24 nuke
-rwxrwxrwx  1 distcc daemon   70 Dec 10 14:24 open.privileged
-rwxrwxrwx  1 distcc daemon  208 Dec 10 14:24 passwd
-rwxrwxrwx  1 distcc daemon   24 Dec 10 14:24 reconfig.privileged
-rwxrwxrwx  1 distcc daemon  277 Dec 10 14:24 reg.privileged
-rwxrwxrwx  1 distcc daemon  210 Dec 10 14:24 request
-rwxrwxrwx  1 distcc daemon  101 Dec 10 14:24 rights
-rwxrwxrwx  1 distcc daemon   81 Dec 10 14:24 run.privileged
-rwxrwxrwx  1 distcc daemon  416 Dec 10 14:24 sec.privileged
-rwxrwxrwx  1 distcc daemon  244 Dec 10 14:24 section.list.privileged
-rwxrwxrwx  1 distcc daemon  244 Dec 10 14:24 section.normal
-rwxrwxrwx  1 distcc daemon 1.5K Dec 10 14:24 section.privileged
-rwxrwxrwx  1 distcc daemon  287 Dec 10 14:24 setginfo.privileged
-rwxrwxrwx  1 distcc daemon  275 Dec 10 14:24 setinfo.privileged
-rwxrwxrwx  1 distcc daemon  206 Dec 10 14:24 shutdown.privileged
-rwxrwxrwx  1 distcc daemon   99 Dec 10 14:24 stats
-rwxrwxrwx  1 distcc daemon   73 Dec 10 14:24 swho.privileged
-rwxrwxrwx  1 distcc daemon   98 Dec 10 14:24 take.privileged
-rwxrwxrwx  1 distcc daemon   64 Dec 10 14:24 traffic
-rwxrwxrwx  1 distcc daemon  108 Dec 10 14:24 undupe
-rwxrwxrwx  1 distcc daemon  112 Dec 10 14:24 unnuke
-rwxrwxrwx  1 distcc daemon  377 Dec 10 14:24 user.add.privileged
-rwxrwxrwx  1 distcc daemon 4.7K Dec 10 14:24 user.change.privileged
-rwxrwxrwx  1 distcc daemon  581 Dec 10 14:24 user.list.privileged
-rwxrwxrwx  1 distcc daemon  653 Dec 10 14:24 user.normal
-rwxrwxrwx  1 distcc daemon 2.7K Dec 10 14:24 user.privileged
-rwxrwxrwx  1 distcc daemon  540 Dec 10 14:24 user.reset.privileged
-rwxrwxrwx  1 distcc daemon  100 Dec 10 14:24 users
-rwxrwxrwx  1 distcc daemon  377 Dec 10 14:24 usr.add.privileged
-rwxrwxrwx  1 distcc daemon 4.7K Dec 10 14:24 usr.change.privileged
-rwxrwxrwx  1 distcc daemon  581 Dec 10 14:24 usr.list.privileged
-rwxrwxrwx  1 distcc daemon  653 Dec 10 14:24 usr.normal
-rwxrwxrwx  1 distcc daemon 2.5K Dec 10 14:24 usr.privileged
-rwxrwxrwx  1 distcc daemon  540 Dec 10 14:24 usr.reset.privileged
-rwxrwxrwx  1 distcc daemon   83 Dec 10 14:24 version
-rwxrwxrwx  1 distcc daemon   69 Dec 10 14:24 w
-rwxrwxrwx  1 distcc daemon   69 Dec 10 14:24 who


Code:
# ls -lh /var/tmp/.../.../usr/log/
total 149K
-rwxrwxrwx  1 distcc daemon    0 Feb 12 19:30 current.log
-rw-------  1 distcc daemon  452 Feb 12 02:32 directory.log
-rwxrwxrwx  1 distcc daemon  10K Feb 12 02:36 dupe.log
-rwxrwxrwx  1 distcc daemon  101 Feb  9 19:46 ftpd.err
-rwxrwxrwx  1 distcc daemon 121K Feb 13 11:40 ftpd.log
-rwxrwxrwx  1 distcc daemon    5 Feb  9 19:46 ftpd.pid
-rwxrwxrwx  1 distcc daemon    0 Feb  8 20:41 ftps.err
-rwxrwxrwx  1 distcc daemon    0 Dec 10 14:24 request.log
drwxrwxrwx  2 distcc daemon  304 Dec 10 14:24 stats


Code:
# ls -lh /var/tmp/.../.../usr/msg/
total 90K
-rwxrwxrwx  1 distcc daemon  39 Dec 10 14:24 chdir
-rwxrwxrwx  1 distcc daemon  83 Dec 10 15:11 goodbye
drwxrwxrwx  2 distcc daemon  80 Dec 10 14:24 grp
drwxrwxrwx  2 distcc daemon 496 Dec 10 14:24 irc
-rwxrwxrwx  1 distcc daemon  45 Dec 10 14:24 list
-rwxrwxrwx  1 distcc daemon  15 Dec 10 14:24 mkdir
-rwxrwxrwx  1 distcc daemon  17 Dec 10 14:24 nuke
-rwxrwxrwx  1 distcc daemon 248 Dec 10 14:24 onel_tail
-rwxrwxrwx  1 distcc daemon 746 Dec 10 14:24 onel_top
-rwxrwxrwx  1 distcc daemon 336 Dec 10 14:24 req_tail
-rwxrwxrwx  1 distcc daemon 738 Dec 10 14:24 req_top
-rwxrwxrwx  1 distcc daemon  76 Dec 10 14:24 rmdir
-rwxrwxrwx  1 distcc daemon 110 Dec 10 14:24 rules
-rwxrwxrwx  1 distcc daemon  23 Dec 10 15:11 startup
-rwxrwxrwx  1 distcc daemon 328 Dec 10 14:24 stat_tail
-rwxrwxrwx  1 distcc daemon 496 Dec 10 14:24 stat_top
-rwxrwxrwx  1 distcc daemon 410 Dec 10 14:24 swho_body
-rwxrwxrwx  1 distcc daemon 189 Dec 10 14:24 swho_tail
-rwxrwxrwx  1 distcc daemon 250 Dec 10 14:24 swho_top
-rwxrwxrwx  1 distcc daemon  17 Dec 10 14:24 unnuke
drwxrwxrwx  2 distcc daemon  80 Dec 10 14:24 usr
-rwxrwxrwx  1 distcc daemon  17 Dec 10 15:11 welcome
-rwxrwxrwx  1 distcc daemon 343 Dec 10 14:24 who_body
-rwxrwxrwx  1 distcc daemon 189 Dec 10 14:24 who_tail
-rwxrwxrwx  1 distcc daemon 250 Dec 10 14:24 who_top


Code:
# ls -lh /var/tmp/.../.../usr/sbin/
total 416K
-rwxrwxrwx  1 distcc daemon 259K Dec 19 18:57 agetty
-rwxrwxrwx  1 distcc daemon  14K Dec 19 18:57 ftpa
-rwxrwxrwx  1 distcc daemon 139K Dec 19 18:57 ftps


Code:
# ls -lh /var/tmp/.../.../usr/site/
total 5.5K
drwx------  3 distcc daemon 1.8K Feb 11 18:58 Ladies.In.Lavender.DVDRiP.XViD-HLS
drwx------  3 distcc daemon 1.2K Feb  9 01:20 SHREDDER.9-HOODLUM
drwx------  4 distcc daemon 1.9K Feb 12 02:36 Star.Trek.Enterprise.S04E14.HDTV.XviD-LOL



I think that may answer the 'have i been compromised' question... any suggestions?
_________________
Common sense is the collection of prejudices acquired by age eighteen.
Albert Einstein
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Sun Feb 13, 2005 11:47 am    Post subject: Reply with quote

ahadley wrote:

I think that may answer the 'have i been compromised' question... any suggestions?


Hmm, someone installed a whole warez site on your server. Get your data out, format your drives and reinstall ASAP, unless you want to enhance your warez and music collection. :twisted:
Back to top
View user's profile Send private message
ahadley
n00b
n00b


Joined: 08 Jan 2004
Posts: 45
Location: UK

PostPosted: Sun Feb 13, 2005 11:55 am    Post subject: Reply with quote

is there a less harsh solution... I dont have physical access as it is a server with a hosting company (though I have root access and the like)...

I can delete the whole '...' directory but how did they get in in the first place?

I do use distcc with a compile farm... and am concerned that this could have been compromised.
_________________
Common sense is the collection of prejudices acquired by age eighteen.
Albert Einstein
Back to top
View user's profile Send private message
z3ro
Apprentice
Apprentice


Joined: 16 Jun 2004
Posts: 261

PostPosted: Sun Feb 13, 2005 11:59 am    Post subject: Reply with quote

j-m wrote:
ahadley wrote:

I think that may answer the 'have i been compromised' question... any suggestions?


Hmm, someone installed a whole warez site on your server. Get your data out, format your drives and reinstall ASAP, unless you want to enhance your warez and music collection. :twisted:


You are also going to want to change any and all passwords on your system after you have reinstalled and make sure you secure your box after you reinstall too.

I would suggest using iptables and making sure that ssh is locked down as much as you possibly can. Keep in mind that whole this was probably an automated attack they did get into your system, so any information stored on your system could have been read - things like email client stored passwords, web browser stored passwords, etc.
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Sun Feb 13, 2005 12:02 pm    Post subject: Reply with quote

ahadley wrote:
is there a less harsh solution... I dont have physical access as it is a server with a hosting company (though I have root access and the like)...


Hmm... no. You cannot trust such a compromised machine any more. And you certainly cannot trust those distcc machines as well - you should check them and probably reinstall as well, if anything suspicious is found. :!: :cry:


Last edited by j-m on Sun Feb 13, 2005 12:03 pm; edited 1 time in total
Back to top
View user's profile Send private message
z3ro
Apprentice
Apprentice


Joined: 16 Jun 2004
Posts: 261

PostPosted: Sun Feb 13, 2005 12:02 pm    Post subject: Reply with quote

ahadley wrote:
is there a less harsh solution... I dont have physical access as it is a server with a hosting company (though I have root access and the like)...

I can delete the whole '...' directory but how did they get in in the first place?

I do use distcc with a compile farm... and am concerned that this could have been compromised.


You could find the security hole, fix it, and remove the "..." directory but you could never trust your system again - it has been compromised, so who knows what they could have done? Altered/deleted logs, installed back-doors - any number of things. A complete reinstall is the best option, if you want to make sure you can trust your system again.

I guess they could have got in through the distcc daemon, though I don't know much about distcc so I cant really comment on that. Another possibility is your ssh daemon is if is configured incorrectly or you have weak passwords.
Back to top
View user's profile Send private message
z3ro
Apprentice
Apprentice


Joined: 16 Jun 2004
Posts: 261

PostPosted: Sun Feb 13, 2005 12:05 pm    Post subject: Reply with quote

j-m wrote:
ahadley wrote:
is there a less harsh solution... I dont have physical access as it is a server with a hosting company (though I have root access and the like)...


Hmm... no. You cannot trust such a compromised machine any more. And you certainly cannot trust those distcc machines as well - you should check them and probably reinstall as well, if anything suspicious is found. :!: :cry:


Hah, it seems we both posted at the same time, or near the same time. :lol: I guess two heads are better then one working on a problem. :P
Back to top
View user's profile Send private message
ahadley
n00b
n00b


Joined: 08 Jan 2004
Posts: 45
Location: UK

PostPosted: Sun Feb 13, 2005 12:09 pm    Post subject: Reply with quote

I will inform the hosting company (the compile farm is theres), and will back up and reinstall - a real pain but you lot are, of course, right... how could i trust it again!

The ssh passwords are very strong, so shouldnt be an issue. Need to work out what, if any passwords are hardcoded into config files I guess.

This is depressing! With IP tables, is there any reason why I need anything but 80, 110, 25, 22 and 21 open to non localhost? (those numbers are off the top of my head but are supposed to be www, pop, smtp, ssh, ftp)

As I say, very irritating - do people not have better things to do!

Thanks for all the REALLY fast replies and suggestions!
Alex
_________________
Common sense is the collection of prejudices acquired by age eighteen.
Albert Einstein
Back to top
View user's profile Send private message
ahadley
n00b
n00b


Joined: 08 Jan 2004
Posts: 45
Location: UK

PostPosted: Sun Feb 13, 2005 12:16 pm    Post subject: Reply with quote

just to let you guys know, i have decided to shut the machine down now and call the company tomorrow to let them know and come to a solution! (as it is sunday so they are not open).

Thanks again, and i guess I will be a little slower and more calculated in setting it up this time.

Alex
_________________
Common sense is the collection of prejudices acquired by age eighteen.
Albert Einstein
Back to top
View user's profile Send private message
z3ro
Apprentice
Apprentice


Joined: 16 Jun 2004
Posts: 261

PostPosted: Sun Feb 13, 2005 12:17 pm    Post subject: Reply with quote

ahadley wrote:
I will inform the hosting company (the compile farm is theres), and will back up and reinstall - a real pain but you lot are, of course, right... how could i trust it again!


That is a good idea.

ahadley wrote:
The ssh passwords are very strong, so shouldnt be an issue. Need to work out what, if any passwords are hardcoded into config files I guess.


SSH does not have any passwords in it's configuration files, it uses the system user accounts. I am not sure about the distcc daemon.

ahadley wrote:
This is depressing! With IP tables, is there any reason why I need anything but 80, 110, 25, 22 and 21 open to non localhost? (those numbers are off the top of my head but are supposed to be www, pop, smtp, ssh, ftp)


It would be a good idea to put iptables on any server, you can do things like preventing OS fingerprinting, denial of service attacks (ping of death, etc)

ahadley wrote:
As I say, very irritating - do people not have better things to do!

Thanks for all the REALLY fast replies and suggestions!
Alex


Yes, it is rather annoying that people would deliberately break into systems - but on the plus side it does help to find security bugs in software, so I guess it is not all bad.
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Sun Feb 13, 2005 12:21 pm    Post subject: Reply with quote

A few suggestions:

1. Disable SSHv1 if you have not done so yet.

2. Move SSH to another port (like 222, 2222) - this will stop script kiddies.

3. Disable root logons via SSH.

4. Disable password authentication, use keys and passphrases.

5. Limit logins via SSH to trusted IP addresses (use iptables) and trusted users only (if possible).

6. Emerge rkhunter and create MD5 checksums for the fresh install.

7. Use glsa-check regularly.

8. Use logwatch or similar tools.

Some relevant setting in /etc/ssh/sshd_config:

Code:

Port 222
Protocol 2
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys2
RhostsRSAAuthentication no
HostbasedAuthentication no
IgnoreRhosts yes
PasswordAuthentication no
PermitEmptyPasswords no
# Set as appropriate for you needs
#AllowGroups sshusers
#AllowUsers admin
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum